mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-28 02:37:37 +00:00
[MemorySSA] LoopSimplify preserves MemorySSA only when flag is flipped.
LoopSimplify can preserve MemorySSA after r360270. But the MemorySSA analysis is retrieved and preserved only when the EnableMSSALoopDependency is set to true. Use the same conditional to mark the pass as preserved, otherwise subsequent passes will get an invalid analysis. Resolves PR41853. llvm-svn: 360697
This commit is contained in:
parent
75ad8c5d63
commit
80c6e79602
@ -768,7 +768,8 @@ namespace {
|
||||
AU.addPreserved<DependenceAnalysisWrapperPass>();
|
||||
AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added.
|
||||
AU.addPreserved<BranchProbabilityInfoWrapperPass>();
|
||||
AU.addPreserved<MemorySSAWrapperPass>();
|
||||
if (EnableMSSALoopDependency)
|
||||
AU.addPreserved<MemorySSAWrapperPass>();
|
||||
}
|
||||
|
||||
/// verifyAnalysis() - Verify LoopSimplifyForm's guarantees.
|
||||
|
16
llvm/test/Analysis/MemorySSA/pr41853.ll
Normal file
16
llvm/test/Analysis/MemorySSA/pr41853.ll
Normal file
@ -0,0 +1,16 @@
|
||||
; RUN: opt -S -memoryssa -loop-simplify -early-cse-memssa -verify-memoryssa %s | FileCheck %s
|
||||
; RUN: opt -S -memoryssa -loop-simplify -early-cse-memssa -enable-mssa-loop-dependency -verify-memoryssa %s | FileCheck %s
|
||||
; REQUIRES: asserts
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
; CHECK-LABEL: @func()
|
||||
define void @func() {
|
||||
br i1 undef, label %bb5, label %bb3
|
||||
|
||||
bb5: ; preds = %bb5, %0
|
||||
store i16 undef, i16* undef
|
||||
br i1 undef, label %bb5, label %bb3
|
||||
|
||||
bb3: ; preds = %bb5, %0
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user