[llvm] 6e80318 - Add loop distribution to the LTO pipeline
Sanne Wouda via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 3 10:54:35 PST 2020
Author: Sanne Wouda
Date: 2020-11-03T18:54:24Z
New Revision: 6e80318eecde2639faa1e72be045c78b8b8aedad
URL: https://github.com/llvm/llvm-project/commit/6e80318eecde2639faa1e72be045c78b8b8aedad
DIFF: https://github.com/llvm/llvm-project/commit/6e80318eecde2639faa1e72be045c78b8b8aedad.diff
LOG: Add loop distribution to the LTO pipeline
The LoopDistribute pass is missing from the LTO pipeline, so
-enable-loop-distribute has no effect during post-link. The pre-link
loop distribution doesn't seem to survive the LTO pipeline either.
With this patch (and -flto -mllvm -enable-loop-distribute) we see a 43%
uplift on SPEC 2006 hmmer for AArch64. The rest of SPECINT 2006 is
unaffected.
Differential Revision: https://reviews.llvm.org/D89896
Added:
Modified:
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/Other/opt-LTO-pipeline.ll
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 93c548a526f0..b38d51a8d94b 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -1055,6 +1055,7 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
// Unroll small loops
PM.add(createSimpleLoopUnrollPass(OptLevel, DisableUnrollLoops,
ForgetAllSCEVInLoopUnroll));
+ PM.add(createLoopDistributePass());
PM.add(createLoopVectorizePass(true, !LoopVectorize));
// The vectorizer may have significantly shortened a loop body; unroll again.
PM.add(createLoopUnrollPass(OptLevel, DisableUnrollLoops,
diff --git a/llvm/test/Other/opt-LTO-pipeline.ll b/llvm/test/Other/opt-LTO-pipeline.ll
index bcd9cfe15794..fc35e6d4148a 100644
--- a/llvm/test/Other/opt-LTO-pipeline.ll
+++ b/llvm/test/Other/opt-LTO-pipeline.ll
@@ -128,9 +128,17 @@
; CHECK-NEXT: Induction Variable Simplification
; CHECK-NEXT: Delete dead loops
; CHECK-NEXT: Unroll loops
+; CHECK-NEXT: Loop Access Analysis
+; CHECK-NEXT: Lazy Branch Probability Analysis
+; CHECK-NEXT: Lazy Block Frequency Analysis
+; CHECK-NEXT: Optimization Remark Emitter
+; CHECK-NEXT: Loop Distribution
; CHECK-NEXT: Post-Dominator Tree Construction
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
+; CHECK-NEXT: Scalar Evolution Analysis
+; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
+; CHECK-NEXT: Function Alias Analysis Results
; CHECK-NEXT: Loop Access Analysis
; CHECK-NEXT: Demanded bits analysis
; CHECK-NEXT: Lazy Branch Probability Analysis
More information about the llvm-commits
mailing list