diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -1821,12 +1821,19 @@ MPM.addPass( createModuleToPostOrderCGSCCPassAdaptor(PostOrderFunctionAttrsPass())); - // FIXME: here we run IP alias analysis in the legacy PM. - FunctionPassManager MainFPM; + // Require the GlobalsAA analysis for the module so we can query it within + // MainFPM. + MPM.addPass(RequireAnalysisPass()); + // Invalidate AAManager so it can be recreated and pick up the newly available + // GlobalsAA. + MPM.addPass( + createModuleToFunctionPassAdaptor(InvalidateAnalysisPass())); + FunctionPassManager MainFPM; MainFPM.addPass(createFunctionToLoopPassAdaptor( - LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap))); + LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap), + EnableMSSALoopDependency, /*UseBlockFrequencyInfo=*/true)); if (RunNewGVN) MainFPM.addPass(NewGVNPass()); diff --git a/llvm/test/Other/new-pm-lto-defaults.ll b/llvm/test/Other/new-pm-lto-defaults.ll --- a/llvm/test/Other/new-pm-lto-defaults.ll +++ b/llvm/test/Other/new-pm-lto-defaults.ll @@ -79,9 +79,15 @@ ; CHECK-O23SZ-NEXT: Running pass: SROA on foo ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass on foo ; CHECK-O23SZ-NEXT: Running pass: PostOrderFunctionAttrsPass on (foo) +; CHECK-O23SZ-NEXT: Running pass: RequireAnalysisPass on [module] +; CHECK-O23SZ-NEXT: Running analysis: GlobalsAA on [module] +; CHECK-O23SZ-NEXT: Running pass: InvalidateAnalysisPass on foo +; CHECK-O23SZ-NEXT: Invalidating analysis: AAManager on foo ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass on foo ; CHECK-O23SZ-NEXT: Running analysis: LoopAnalysis on foo ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass on foo +; CHECK-O23SZ-NEXT: Running analysis: MemorySSAAnalysis on foo +; CHECK-O23SZ-NEXT: Running analysis: AAManager on foo ; CHECK-O23SZ-NEXT: Running analysis: ScalarEvolutionAnalysis on foo ; CHECK-O23SZ-NEXT: Running analysis: InnerAnalysisManagerProxy ; CHECK-O23SZ-NEXT: Running pass: LICMPass on Loop @@ -89,7 +95,6 @@ ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis on foo ; CHECK-O23SZ-NEXT: Running analysis: PhiValuesAnalysis on foo ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass on foo -; CHECK-O23SZ-NEXT: Running analysis: MemorySSAAnalysis on foo ; CHECK-O23SZ-NEXT: Running pass: DSEPass on foo ; CHECK-O23SZ-NEXT: Running analysis: PostDominatorTreeAnalysis on foo ; CHECK-O23SZ-NEXT: Running pass: MergedLoadStoreMotionPass on foo diff --git a/llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll b/llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll --- a/llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll +++ b/llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll @@ -1,5 +1,5 @@ ; RUN: opt -passes='lto' -S %s | FileCheck %s -; RUN: opt -std-link-opts -enable-new-pm=false -S %s | FileCheck --check-prefix=LEGACY %s +; RUN: opt -std-link-opts -enable-new-pm=false -S %s | FileCheck %s target triple = "arm64e-apple-darwin" @@ -9,10 +9,7 @@ @D = external unnamed_addr global i32, align 4 ; CHECK-LABEL: @fn -; CHECK-NOT: vector.body: -; -; LEGACY-LABEL: @fn -; LEGACY: vector.body: +; CHECK: vector.body: ; define void @fn() { entry: