Index: llvm/include/llvm/Analysis/MemorySSA.h =================================================================== --- llvm/include/llvm/Analysis/MemorySSA.h +++ llvm/include/llvm/Analysis/MemorySSA.h @@ -106,9 +106,6 @@ namespace llvm { -/// Enables memory ssa as a dependency for loop passes. -extern cl::opt EnableMSSALoopDependency; - class AllocaInst; class Function; class Instruction; Index: llvm/lib/Analysis/MemorySSA.cpp =================================================================== --- llvm/lib/Analysis/MemorySSA.cpp +++ llvm/lib/Analysis/MemorySSA.cpp @@ -90,10 +90,6 @@ #else bool llvm::VerifyMemorySSA = false; #endif -/// Enables memory ssa as a dependency for loop passes in legacy pass manager. -cl::opt llvm::EnableMSSALoopDependency( - "enable-mssa-loop-dependency", cl::Hidden, cl::init(true), - cl::desc("Enable MemorySSA dependency for loop pass manager")); static cl::opt VerifyMemorySSAX("verify-memoryssa", cl::location(VerifyMemorySSA), Index: llvm/lib/Passes/PassBuilder.cpp =================================================================== --- llvm/lib/Passes/PassBuilder.cpp +++ llvm/lib/Passes/PassBuilder.cpp @@ -617,7 +617,7 @@ FPM.addPass( RequireAnalysisPass()); FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1), - EnableMSSALoopDependency, + /*UseMemorySSA=*/true, /*UseBlockFrequencyInfo=*/true)); FPM.addPass(SimplifyCFGPass()); FPM.addPass(InstCombinePass()); @@ -791,7 +791,7 @@ FPM.addPass( RequireAnalysisPass()); FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1), - EnableMSSALoopDependency, + /*UseMemorySSA=*/true, /*UseBlockFrequencyInfo=*/true)); FPM.addPass(SimplifyCFGPass()); FPM.addPass(InstCombinePass()); @@ -848,7 +848,7 @@ FPM.addPass(DSEPass()); FPM.addPass(createFunctionToLoopPassAdaptor( LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap), - EnableMSSALoopDependency, /*UseBlockFrequencyInfo=*/true)); + /*UseMemorySSA=*/true, /*UseBlockFrequencyInfo=*/true)); FPM.addPass(CoroElidePass()); @@ -1247,7 +1247,7 @@ FPM.addPass( RequireAnalysisPass()); FPM.addPass(createFunctionToLoopPassAdaptor( - std::move(LPM), EnableMSSALoopDependency, + std::move(LPM), /*UseMemorySSA=*/true, /*UseBlockFrequencyInfo=*/true)); FPM.addPass(SimplifyCFGPass()); FPM.addPass(InstCombinePass()); @@ -1307,7 +1307,7 @@ RequireAnalysisPass()); FPM.addPass(createFunctionToLoopPassAdaptor( LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap), - EnableMSSALoopDependency, /*UseBlockFrequencyInfo=*/true)); + /*UseMemorySSA=*/true, /*UseBlockFrequencyInfo=*/true)); } // Now that we've vectorized and unrolled loops, we may have more refined @@ -1828,7 +1828,7 @@ FunctionPassManager MainFPM; MainFPM.addPass(createFunctionToLoopPassAdaptor( LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap), - EnableMSSALoopDependency, /*UseBlockFrequencyInfo=*/true)); + /*USeMemorySSA=*/true, /*UseBlockFrequencyInfo=*/true)); if (RunNewGVN) MainFPM.addPass(NewGVNPass()); Index: llvm/lib/Transforms/Scalar/LICM.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LICM.cpp +++ llvm/lib/Transforms/Scalar/LICM.cpp @@ -229,9 +229,7 @@ << L->getHeader()->getNameOrAsOperand() << "\n"); auto *SE = getAnalysisIfAvailable(); - MemorySSA *MSSA = EnableMSSALoopDependency - ? (&getAnalysis().getMSSA()) - : nullptr; + MemorySSA *MSSA = &getAnalysis().getMSSA(); bool hasProfileData = L->getHeader()->getParent()->hasProfileData(); BlockFrequencyInfo *BFI = hasProfileData ? &getAnalysis().getBFI() @@ -258,10 +256,8 @@ AU.addPreserved(); AU.addPreserved(); AU.addRequired(); - if (EnableMSSALoopDependency) { - AU.addRequired(); - AU.addPreserved(); - } + AU.addRequired(); + AU.addPreserved(); AU.addRequired(); getLoopAnalysisUsage(AU); LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(AU); Index: llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp +++ llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp @@ -195,15 +195,10 @@ const TargetLibraryInfo &TLI = getAnalysis().getTLI( *L->getHeader()->getParent()); - MemorySSA *MSSA = nullptr; - Optional MSSAU; - if (EnableMSSALoopDependency) { - MSSA = &getAnalysis().getMSSA(); - MSSAU = MemorySSAUpdater(MSSA); - } + MemorySSA *MSSA = &getAnalysis().getMSSA(); + MemorySSAUpdater MSSAU(MSSA); - return simplifyLoopInst(*L, DT, LI, AC, TLI, - MSSAU.hasValue() ? MSSAU.getPointer() : nullptr); + return simplifyLoopInst(*L, DT, LI, AC, TLI, &MSSAU); } void getAnalysisUsage(AnalysisUsage &AU) const override { @@ -211,10 +206,8 @@ AU.addRequired(); AU.addRequired(); AU.setPreservesCFG(); - if (EnableMSSALoopDependency) { - AU.addRequired(); - AU.addPreserved(); - } + AU.addRequired(); + AU.addPreserved(); getLoopAnalysisUsage(AU); } }; Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -99,8 +99,7 @@ void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired(); AU.addRequired(); - if (EnableMSSALoopDependency) - AU.addPreserved(); + AU.addPreserved(); getLoopAnalysisUsage(AU); // Lazy BFI and BPI are marked as preserved here so LoopRotate @@ -121,13 +120,11 @@ auto &SE = getAnalysis().getSE(); const SimplifyQuery SQ = getBestSimplifyQuery(*this, F); Optional MSSAU; - if (EnableMSSALoopDependency) { - // Not requiring MemorySSA and getting it only if available will split - // the loop pass pipeline when LoopRotate is being run first. - auto *MSSAA = getAnalysisIfAvailable(); - if (MSSAA) - MSSAU = MemorySSAUpdater(&MSSAA->getMSSA()); - } + // Not requiring MemorySSA and getting it only if available will split + // the loop pass pipeline when LoopRotate is being run first. + auto *MSSAA = getAnalysisIfAvailable(); + if (MSSAA) + MSSAU = MemorySSAUpdater(&MSSAA->getMSSA()); // Vectorization requires loop-rotation. Use default threshold for loops the // user explicitly marked for vectorization, even when header duplication is // disabled. Index: llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp +++ llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp @@ -733,27 +733,20 @@ DominatorTree &DT = getAnalysis().getDomTree(); LoopInfo &LI = getAnalysis().getLoopInfo(); ScalarEvolution &SE = getAnalysis().getSE(); - Optional MSSAU; - if (EnableMSSALoopDependency) { - MemorySSA *MSSA = &getAnalysis().getMSSA(); - MSSAU = MemorySSAUpdater(MSSA); - if (VerifyMemorySSA) - MSSA->verifyMemorySSA(); - } + MemorySSA *MSSA = &getAnalysis().getMSSA(); + MemorySSAUpdater MSSAU(MSSA); + if (VerifyMemorySSA) + MSSA->verifyMemorySSA(); bool DeleteCurrentLoop = false; - bool Changed = simplifyLoopCFG( - *L, DT, LI, SE, MSSAU.hasValue() ? MSSAU.getPointer() : nullptr, - DeleteCurrentLoop); + bool Changed = simplifyLoopCFG(*L, DT, LI, SE, &MSSAU, DeleteCurrentLoop); if (DeleteCurrentLoop) LPM.markLoopAsDeleted(*L); return Changed; } void getAnalysisUsage(AnalysisUsage &AU) const override { - if (EnableMSSALoopDependency) { - AU.addRequired(); - AU.addPreserved(); - } + AU.addRequired(); + AU.addPreserved(); AU.addPreserved(); getLoopAnalysisUsage(AU); } Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -232,10 +232,8 @@ AU.addPreserved(); AU.addRequired(); AU.addRequired(); - if (EnableMSSALoopDependency) { - AU.addRequired(); - AU.addPreserved(); - } + AU.addRequired(); + AU.addPreserved(); if (HasBranchDivergence) AU.addRequired(); getLoopAnalysisUsage(AU); @@ -539,11 +537,8 @@ LPM = &LPMRef; DT = &getAnalysis().getDomTree(); AA = &getAnalysis().getAAResults(); - if (EnableMSSALoopDependency) { - MSSA = &getAnalysis().getMSSA(); - MSSAU = std::make_unique(MSSA); - assert(DT && "Cannot update MemorySSA without a valid DomTree."); - } + MSSA = &getAnalysis().getMSSA(); + MSSAU = std::make_unique(MSSA); CurrentLoop = L; Function *F = CurrentLoop->getHeader()->getParent(); @@ -551,19 +546,19 @@ if (SanitizeMemory) SafetyInfo.computeLoopSafetyInfo(L); - if (MSSA && VerifyMemorySSA) + if (VerifyMemorySSA) MSSA->verifyMemorySSA(); bool Changed = false; do { assert(CurrentLoop->isLCSSAForm(*DT)); - if (MSSA && VerifyMemorySSA) + if (VerifyMemorySSA) MSSA->verifyMemorySSA(); RedoLoop = false; Changed |= processCurrentLoop(); } while (RedoLoop); - if (MSSA && VerifyMemorySSA) + if (VerifyMemorySSA) MSSA->verifyMemorySSA(); return Changed; Index: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -3126,10 +3126,8 @@ void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired(); AU.addRequired(); - if (EnableMSSALoopDependency) { - AU.addRequired(); - AU.addPreserved(); - } + AU.addRequired(); + AU.addPreserved(); getLoopAnalysisUsage(AU); } }; @@ -3150,12 +3148,8 @@ auto &AC = getAnalysis().getAssumptionCache(F); auto &AA = getAnalysis().getAAResults(); auto &TTI = getAnalysis().getTTI(F); - MemorySSA *MSSA = nullptr; - Optional MSSAU; - if (EnableMSSALoopDependency) { - MSSA = &getAnalysis().getMSSA(); - MSSAU = MemorySSAUpdater(MSSA); - } + MemorySSA *MSSA = &getAnalysis().getMSSA(); + MemorySSAUpdater MSSAU(MSSA); auto *SEWP = getAnalysisIfAvailable(); auto *SE = SEWP ? &SEWP->getSE() : nullptr; @@ -3179,14 +3173,14 @@ LPM.markLoopAsDeleted(*L); }; - if (MSSA && VerifyMemorySSA) + if (VerifyMemorySSA) MSSA->verifyMemorySSA(); bool Changed = unswitchLoop(*L, DT, LI, AC, AA, TTI, true, NonTrivial, UnswitchCB, SE, - MSSAU.hasValue() ? MSSAU.getPointer() : nullptr); + &MSSAU); - if (MSSA && VerifyMemorySSA) + if (VerifyMemorySSA) MSSA->verifyMemorySSA(); // Historically this pass has had issues with the dominator tree so verify it Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp =================================================================== --- llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -779,8 +779,7 @@ AU.addPreserved(); AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added. AU.addPreserved(); - if (EnableMSSALoopDependency) - AU.addPreserved(); + AU.addPreserved(); } /// verifyAnalysis() - Verify LoopSimplifyForm's guarantees. @@ -814,12 +813,10 @@ &getAnalysis().getAssumptionCache(F); MemorySSA *MSSA = nullptr; std::unique_ptr MSSAU; - if (EnableMSSALoopDependency) { - auto *MSSAAnalysis = getAnalysisIfAvailable(); - if (MSSAAnalysis) { - MSSA = &MSSAAnalysis->getMSSA(); - MSSAU = std::make_unique(MSSA); - } + auto *MSSAAnalysis = getAnalysisIfAvailable(); + if (MSSAAnalysis) { + MSSA = &MSSAAnalysis->getMSSA(); + MSSAU = std::make_unique(MSSA); } bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID); Index: llvm/test/Analysis/BasicAA/store-promote.ll =================================================================== --- llvm/test/Analysis/BasicAA/store-promote.ll +++ llvm/test/Analysis/BasicAA/store-promote.ll @@ -2,7 +2,6 @@ ; disambiguating some obvious cases. If LICM is able to disambiguate the ; two pointers, then the load should be hoisted, and the store sunk. -; RUN: opt < %s -basic-aa -licm -enable-mssa-loop-dependency=false -enable-new-pm=0 -S | FileCheck %s -check-prefixes=CHECK,AST ; RUN: opt < %s -basic-aa -licm -enable-new-pm=0 -S | FileCheck %s -check-prefixes=CHECK,MSSA ; RUN: opt < %s -aa-pipeline=basic-aa -passes='loop(licm)' -S | FileCheck %s -check-prefixes=CHECK,AST ; RUN: opt < %s -aa-pipeline=basic-aa -passes='loop-mssa(licm)' -S | FileCheck %s -check-prefixes=CHECK,MSSA Index: llvm/test/Analysis/MemorySSA/pr42294.ll =================================================================== --- llvm/test/Analysis/MemorySSA/pr42294.ll +++ llvm/test/Analysis/MemorySSA/pr42294.ll @@ -1,8 +1,6 @@ ; REQUIRES: asserts ; RUN: opt -loop-rotate -licm %s -disable-output -debug-only=licm 2>&1 | FileCheck %s -check-prefix=LICM -; RUN: opt -loop-rotate -licm %s -disable-output -enable-mssa-loop-dependency=false -debug-only=licm 2>&1 | FileCheck %s -check-prefix=LICM ; RUN: opt -loop-rotate -licm %s -S | FileCheck %s -; RUN: opt -loop-rotate -licm %s -S -enable-mssa-loop-dependency=false | FileCheck %s ; LICM: Using ; LICM-NOT: LICM sinking instruction: %.pre = load i8, i8* %arrayidx.phi.trans.insert Index: llvm/test/CodeGen/PowerPC/pr35688.ll =================================================================== --- llvm/test/CodeGen/PowerPC/pr35688.ll +++ llvm/test/CodeGen/PowerPC/pr35688.ll @@ -1,45 +1,26 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc -enable-mssa-loop-dependency=false -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown < %s | \ -; RUN: FileCheck %s ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown < %s | \ -; RUN: FileCheck %s --check-prefix=MSSA -; Function Attrs: nounwind +; RUN: FileCheck %s + +; With MemorySSA, everything is taken out of the loop by licm. +; Loads and stores to undef are treated as non-aliasing. define void @ec_GFp_nistp256_points_mul() { ; CHECK-LABEL: ec_GFp_nistp256_points_mul: ; CHECK: # %bb.0: # %entry -; CHECK-NEXT: ld 5, 0(3) -; CHECK-NEXT: li 3, 127 +; CHECK-NEXT: ld 3, 0(3) ; CHECK-NEXT: li 4, 0 -; CHECK-NEXT: .p2align 5 +; CHECK-NEXT: subfic 5, 3, 0 +; CHECK-NEXT: subfze 5, 4 +; CHECK-NEXT: sradi 5, 5, 63 +; CHECK-NEXT: subc 3, 5, 3 +; CHECK-NEXT: subfe 3, 4, 5 +; CHECK-NEXT: sradi 3, 3, 63 +; CHECK-NEXT: std 3, 0(3) +; CHECK-NEXT: .p2align 4 ; CHECK-NEXT: .LBB0_1: # %fe_cmovznz.exit.i534.i.15 ; CHECK-NEXT: # -; CHECK-NEXT: subfic 6, 5, 0 -; CHECK-NEXT: subfze 6, 4 -; CHECK-NEXT: sradi 7, 6, 63 -; CHECK-NEXT: srad 6, 6, 3 -; CHECK-NEXT: subc 5, 7, 5 -; CHECK-NEXT: subfe 5, 4, 6 -; CHECK-NEXT: sradi 5, 5, 63 ; CHECK-NEXT: b .LBB0_1 -; -; MSSA-LABEL: ec_GFp_nistp256_points_mul: -; MSSA: # %bb.0: # %entry -; MSSA-NEXT: ld 3, 0(3) -; MSSA-NEXT: li 4, 0 -; MSSA-NEXT: subfic 5, 3, 0 -; MSSA-NEXT: subfze 5, 4 -; MSSA-NEXT: sradi 5, 5, 63 -; MSSA-NEXT: subc 3, 5, 3 -; MSSA-NEXT: subfe 3, 4, 5 -; MSSA-NEXT: sradi 3, 3, 63 -; MSSA-NEXT: std 3, 0(3) -; MSSA-NEXT: .p2align 4 -; MSSA-NEXT: .LBB0_1: # %fe_cmovznz.exit.i534.i.15 -; MSSA-NEXT: # -; MSSA-NEXT: b .LBB0_1 -; With MemorySSA, everything is taken out of the loop by licm. -; Loads and stores to undef are treated as non-aliasing. entry: br label %fe_cmovznz.exit.i534.i.15 Index: llvm/test/Transforms/LICM/argmemonly-call.ll =================================================================== --- llvm/test/Transforms/LICM/argmemonly-call.ll +++ llvm/test/Transforms/LICM/argmemonly-call.ll @@ -1,4 +1,3 @@ -; RUN: opt -S -basic-aa -licm -licm-n2-threshold=0 -enable-mssa-loop-dependency=false %s -enable-new-pm=0 | FileCheck %s ; RUN: opt -S -basic-aa -licm -licm-n2-threshold=0 -verify-memoryssa %s -enable-new-pm=0 | FileCheck %s --check-prefix=ALIAS-N2 ; RUN: opt -licm -basic-aa -licm-n2-threshold=200 < %s -S -enable-new-pm=0 | FileCheck %s --check-prefix=ALIAS-N2 Index: llvm/test/Transforms/LICM/atomics.ll =================================================================== --- llvm/test/Transforms/LICM/atomics.ll +++ llvm/test/Transforms/LICM/atomics.ll @@ -1,4 +1,3 @@ -; RUN: opt < %s -S -basic-aa -licm -enable-mssa-loop-dependency=false -enable-new-pm=0 | FileCheck -check-prefixes=CHECK,AST %s ; RUN: opt < %s -S -basic-aa -licm -enable-new-pm=0 | FileCheck -check-prefixes=CHECK,MSSA %s ; RUN: opt -aa-pipeline=basic-aa -passes='require,loop(licm)' < %s -S | FileCheck -check-prefixes=CHECK,AST %s ; RUN: opt -aa-pipeline=basic-aa -passes='require,loop-mssa(licm)' < %s -S | FileCheck -check-prefixes=CHECK,MSSA %s Index: llvm/test/Transforms/LICM/guards.ll =================================================================== --- llvm/test/Transforms/LICM/guards.ll +++ llvm/test/Transforms/LICM/guards.ll @@ -1,6 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; REQUIRES: asserts -; RUN: opt -licm -basic-aa -enable-mssa-loop-dependency=false -ipt-expensive-asserts=true < %s -S | FileCheck %s ; RUN: opt -licm -basic-aa -ipt-expensive-asserts=true < %s -S | FileCheck %s --check-prefixes=CHECK,MSSA ; RUN: opt -aa-pipeline=basic-aa -passes='require,require,require,require,loop(licm)' -ipt-expensive-asserts=true < %s -S | FileCheck %s ; RUN: opt -aa-pipeline=basic-aa -passes='require,require,require,require,loop-mssa(licm)' -ipt-expensive-asserts=true < %s -S | FileCheck %s --check-prefixes=CHECK,MSSA Index: llvm/test/Transforms/LICM/pr38513.ll =================================================================== --- llvm/test/Transforms/LICM/pr38513.ll +++ llvm/test/Transforms/LICM/pr38513.ll @@ -1,4 +1,4 @@ -; RUN: opt -enable-mssa-loop-dependency=false -disable-basic-aa -alias-set-saturation-threshold=2 -licm -S < %s | FileCheck %s +; RUN: opt -disable-basic-aa -alias-set-saturation-threshold=2 -passes='loop(licm)' -S < %s | FileCheck %s ; REQUIRES: asserts ; CHECK-LABEL: @f1() Index: llvm/test/Transforms/LICM/promote-order.ll =================================================================== --- llvm/test/Transforms/LICM/promote-order.ll +++ llvm/test/Transforms/LICM/promote-order.ll @@ -1,4 +1,3 @@ -; RUN: opt -tbaa -basic-aa -licm -enable-mssa-loop-dependency=false -enable-new-pm=0 -S < %s | FileCheck %s --check-prefixes=CHECK,AST ; RUN: opt -tbaa -basic-aa -licm -enable-new-pm=0 -S < %s | FileCheck %s --check-prefixes=CHECK,MSSA ; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require,require,require,require,loop(licm)' -S %s | FileCheck %s --check-prefixes=CHECK,AST ; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='require,require,require,require,loop-mssa(licm)' -S %s | FileCheck %s --check-prefixes=CHECK,MSSA Index: llvm/test/Transforms/LICM/read-only-calls.ll =================================================================== --- llvm/test/Transforms/LICM/read-only-calls.ll +++ llvm/test/Transforms/LICM/read-only-calls.ll @@ -1,4 +1,3 @@ -; RUN: opt -S -basic-aa -licm -licm-n2-threshold=0 -enable-mssa-loop-dependency=false %s -enable-new-pm=0 | FileCheck %s ; RUN: opt -S -basic-aa -licm -licm-n2-threshold=0 %s -enable-new-pm=0 | FileCheck %s --check-prefix=ALIAS-N2 ; RUN: opt -licm -basic-aa -licm-n2-threshold=200 < %s -S -enable-new-pm=0 | FileCheck %s --check-prefix=ALIAS-N2 Index: llvm/test/Transforms/LICM/store-hoisting.ll =================================================================== --- llvm/test/Transforms/LICM/store-hoisting.ll +++ llvm/test/Transforms/LICM/store-hoisting.ll @@ -1,4 +1,3 @@ -; RUN: opt -S -basic-aa -licm -enable-mssa-loop-dependency=false %s -enable-new-pm=0 | FileCheck -check-prefixes=CHECK,AST %s ; RUN: opt -S -basic-aa -licm %s -enable-new-pm=0 | FileCheck -check-prefixes=CHECK,MSSA %s ; RUN: opt -aa-pipeline=basic-aa -passes='require,require,require,require,loop(licm)' < %s -S | FileCheck -check-prefixes=CHECK,AST %s ; RUN: opt -aa-pipeline=basic-aa -passes='require,require,require,require,loop-mssa(licm)' < %s -S | FileCheck -check-prefixes=CHECK,MSSA %s Index: llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp =================================================================== --- llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp +++ llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp @@ -415,8 +415,7 @@ RequireAnalysisLoopPass())); // For 'f', preserve most things but not the specific loop analyses. auto PA = getLoopPassPreservedAnalyses(); - if (EnableMSSALoopDependency) - PA.preserve(); + PA.preserve(); EXPECT_CALL(MFPHandle, run(HasName("f"), _)) .InSequence(FSequence) .WillOnce(Return(PA)); @@ -494,8 +493,7 @@ EXPECT_CALL(MMPHandle, run(_, _)).WillOnce(InvokeWithoutArgs([] { auto PA = getLoopPassPreservedAnalyses(); PA.preserve(); - if (EnableMSSALoopDependency) - PA.preserve(); + PA.preserve(); return PA; })); // All the loop analyses from both functions get invalidated before we @@ -822,8 +820,7 @@ // the fact that they were preserved. EXPECT_CALL(MFPHandle, run(HasName("f"), _)).WillOnce(InvokeWithoutArgs([] { auto PA = getLoopPassPreservedAnalyses(); - if (EnableMSSALoopDependency) - PA.preserve(); + PA.preserve(); PA.preserveSet>(); return PA; })); @@ -845,8 +842,7 @@ // Which means that no extra invalidation occurs and cached values are used. EXPECT_CALL(MFPHandle, run(HasName("g"), _)).WillOnce(InvokeWithoutArgs([] { auto PA = getLoopPassPreservedAnalyses(); - if (EnableMSSALoopDependency) - PA.preserve(); + PA.preserve(); PA.preserveSet>(); return PA; }));