]> granicus.if.org Git - llvm/commit
[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.
authorAlina Sbirlea <asbirlea@google.com>
Wed, 21 Aug 2019 17:00:57 +0000 (17:00 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Wed, 21 Aug 2019 17:00:57 +0000 (17:00 +0000)
commitf9146197d4b743e05cc9a2a3cd8e83e45a9b2596
treed1034522b5a6c16fb2034c4d3a56280b5e2b0903
parent7c120abd60b38ce8580d3e12977ba89d6f002999
[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.

Summary:
Add a flag to the FunctionToLoopAdaptor that allows enabling MemorySSA only for the loop pass managers that are known to preserve it.

If an LPM is known to have only loop transforms that *all* preserve MemorySSA, then use MemorySSA if `EnableMSSALoopDependency` is set.
If an LPM has loop passes that do not preserve MemorySSA, then the flag passed is `false`, regardless of the value of `EnableMSSALoopDependency`.

When using a custom loop pass pipeline via `passes=...`, use keyword `loop` vs `loop-mssa` to use MemorySSA in that LPM. If a loop that does not preserve MemorySSA is added while using the `loop-mssa` keyword, that's an error.

Add the new `loop-mssa` keyword to a few tests where a difference occurs when enabling MemorySSA.

Reviewers: chandlerc

Subscribers: mehdi_amini, Prazek, george.burgess.iv, sanjoy.google, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66376

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369548 91177308-0d34-0410-b5e6-96231b3b80d8
24 files changed:
include/llvm/Analysis/LoopAnalysisManager.h
include/llvm/Transforms/Scalar/LoopPassManager.h
lib/Analysis/LoopAnalysisManager.cpp
lib/Passes/PassBuilder.cpp
test/Analysis/BasicAA/store-promote.ll
test/Transforms/LICM/argmemonly-call.ll
test/Transforms/LICM/atomics.ll
test/Transforms/LICM/guards.ll
test/Transforms/LICM/hoist-deref-load.ll
test/Transforms/LICM/hoist-phi.ll
test/Transforms/LICM/promote-order.ll
test/Transforms/LICM/read-only-calls.ll
test/Transforms/LICM/store-hoisting.ll
test/Transforms/LoopInstSimplify/basic.ll
test/Transforms/LoopRotate/basic.ll
test/Transforms/LoopRotate/pr35210.ll
test/Transforms/SimpleLoopUnswitch/basictest-profmd.ll
test/Transforms/SimpleLoopUnswitch/basictest.ll
test/Transforms/SimpleLoopUnswitch/guards.ll
test/Transforms/SimpleLoopUnswitch/msan.ll
test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll
test/Transforms/SimpleLoopUnswitch/trivial-unswitch-profmd.ll
test/Transforms/SimpleLoopUnswitch/trivial-unswitch.ll
test/Transforms/SimpleLoopUnswitch/update-scev.ll