[llvm] r257767 - [LTO] Add a run of LoopUnroll
James Molloy via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 14 07:00:10 PST 2016
Author: jamesm
Date: Thu Jan 14 09:00:09 2016
New Revision: 257767
URL: http://llvm.org/viewvc/llvm-project?rev=257767&view=rev
Log:
[LTO] Add a run of LoopUnroll
Loop trip counts can often be resolved during LTO. We should obviously be unrolling small loops once those trip counts have been resolved, but we weren't.
Modified:
llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=257767&r1=257766&r2=257767&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Thu Jan 14 09:00:09 2016
@@ -573,7 +573,12 @@ void PassManagerBuilder::addLTOOptimizat
if (EnableLoopInterchange)
PM.add(createLoopInterchangePass());
+ if (!DisableUnrollLoops)
+ PM.add(createSimpleLoopUnrollPass()); // Unroll small loops
PM.add(createLoopVectorizePass(true, LoopVectorize));
+ // The vectorizer may have significantly shortened a loop body; unroll again.
+ if (!DisableUnrollLoops)
+ PM.add(createLoopUnrollPass());
// Now that we've optimized loops (in particular loop induction variables),
// we may have exposed more scalar opportunities. Run parts of the scalar
More information about the llvm-commits
mailing list