forked from OSchip/llvm-project
[EarlyCSE] Explicitly require AAResultsWrapperPass.
The MemorySSAWrapperPass depends on AAResultsWrapperPass and if MemorySSA is preserved but AAResultsWrapperPass is not, this could lead to a crash when updating the last user of the MemorySSAWrapperPass. Alternatively AAResultsWrapperPass could be marked preserved by GVN, but I am not sure if that would be safe. I am not sure what is required in order to preserve AAResultsWrapperPass. At the moment, it seems like a couple of passes that do similar transforms to GVN are preserving it. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D87137
This commit is contained in:
parent
32c8da41dc
commit
2bcc4db761
|
@ -1463,6 +1463,7 @@ public:
|
|||
AU.addRequired<TargetLibraryInfoWrapperPass>();
|
||||
AU.addRequired<TargetTransformInfoWrapperPass>();
|
||||
if (UseMemorySSA) {
|
||||
AU.addRequired<AAResultsWrapperPass>();
|
||||
AU.addRequired<MemorySSAWrapperPass>();
|
||||
AU.addPreserved<MemorySSAWrapperPass>();
|
||||
}
|
||||
|
@ -1504,6 +1505,7 @@ INITIALIZE_PASS_BEGIN(EarlyCSEMemSSALegacyPass, "early-cse-memssa",
|
|||
"Early CSE w/ MemorySSA", false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
|
||||
INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
|
||||
|
|
|
@ -2850,7 +2850,6 @@ public:
|
|||
if (Impl.isMemDepEnabled())
|
||||
AU.addRequired<MemoryDependenceWrapperPass>();
|
||||
AU.addRequired<AAResultsWrapperPass>();
|
||||
|
||||
AU.addPreserved<DominatorTreeWrapperPass>();
|
||||
AU.addPreserved<GlobalsAAWrapperPass>();
|
||||
AU.addPreserved<TargetLibraryInfoWrapperPass>();
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
; RUN: opt -memoryssa -gvn -early-cse-memssa %s -S | FileCheck %s
|
||||
|
||||
; CHECK: define void @foo(
|
||||
|
||||
define void @foo() {
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue