[PATCH] D102345: [Passes] Run GlobalsAA before LICM during LTO in new PM, use MSSA.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 04:14:52 PDT 2021
fhahn updated this revision to Diff 345083.
fhahn added a comment.
Strip away memoryssa change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102345/new/
https://reviews.llvm.org/D102345
Files:
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/new-pm-lto-defaults.ll
llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll
Index: llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll
===================================================================
--- llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll
+++ llvm/test/Transforms/PhaseOrdering/AArch64/globals-aa-required-for-vectorization.ll
@@ -1,5 +1,5 @@
; RUN: opt -passes='lto<O3>' -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:
Index: llvm/test/Other/new-pm-lto-defaults.ll
===================================================================
--- llvm/test/Other/new-pm-lto-defaults.ll
+++ llvm/test/Other/new-pm-lto-defaults.ll
@@ -79,10 +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<llvm::GlobalsAA, llvm::Module> on [module]
+; CHECK-O23SZ-NEXT: Running analysis: GlobalsAA on [module]
+; CHECK-O23SZ-NEXT: Running pass: InvalidateAnalysisPass<llvm::AAManager> 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
Index: llvm/lib/Passes/PassBuilder.cpp
===================================================================
--- llvm/lib/Passes/PassBuilder.cpp
+++ llvm/lib/Passes/PassBuilder.cpp
@@ -1821,10 +1821,16 @@
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<GlobalsAA, Module>());
+ // Invalidate AAManager so it can be recreated and pick up the newly available
+ // GlobalsAA.
+ MPM.addPass(
+ createModuleToFunctionPassAdaptor(InvalidateAnalysisPass<AAManager>()));
+ FunctionPassManager MainFPM;
MainFPM.addPass(createFunctionToLoopPassAdaptor(
LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap),
EnableMSSALoopDependency, /*UseBlockFrequencyInfo=*/true));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102345.345083.patch
Type: text/x-patch
Size: 2963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210513/af41cfcd/attachment.bin>
More information about the llvm-commits
mailing list