[llvm] dd03881 - Add loop distribution to the LTO pipeline

Sanne Wouda via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 04:04:42 PST 2020


Author: Sanne Wouda
Date: 2020-11-10T12:04:32Z
New Revision: dd03881bd504f3ad78400260ae572f9c47fa8e63

URL: https://github.com/llvm/llvm-project/commit/dd03881bd504f3ad78400260ae572f9c47fa8e63
DIFF: https://github.com/llvm/llvm-project/commit/dd03881bd504f3ad78400260ae572f9c47fa8e63.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 8749f24ad8b8..49aee1c84467 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