diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2014-03-31 23:23:51 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2014-03-31 23:23:51 +0000 |
| commit | 86b3064f2bfb111121f740c71e2c569f0683ca96 (patch) | |
| tree | efc28a8e6f8f9b228bb128845a24e0932cd7e54d /llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | |
| parent | da91cbdfa8e3da11f63e0b3436e1593a60bdfb13 (diff) | |
| download | bcm5719-llvm-86b3064f2bfb111121f740c71e2c569f0683ca96.tar.gz bcm5719-llvm-86b3064f2bfb111121f740c71e2c569f0683ca96.zip | |
Move partial/runtime unrolling late in the pipeline
The generic (concatenation) loop unroller is currently placed early in the
standard optimization pipeline. This is a good place to perform full unrolling,
but not the right place to perform partial/runtime unrolling. However, most
targets don't enable partial/runtime unrolling, so this never mattered.
However, even some x86 cores benefit from partial/runtime unrolling of very
small loops, and follow-up commits will enable this. First, we need to move
partial/runtime unrolling late in the optimization pipeline (importantly, this
is after SLP and loop vectorization, as vectorization can drastically change
the size of a loop), while keeping the full unrolling where it is now. This
change does just that.
llvm-svn: 205264
Diffstat (limited to 'llvm/lib/Transforms/IPO/PassManagerBuilder.cpp')
| -rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 21d8e58db7c..4a28b34468b 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -195,7 +195,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) { MPM.add(createLoopDeletionPass()); // Delete dead loops if (!DisableUnrollLoops) - MPM.add(createLoopUnrollPass()); // Unroll small loops + MPM.add(createSimpleLoopUnrollPass()); // Unroll small loops addExtensionsToPM(EP_LoopOptimizerEnd, MPM); if (OptLevel > 1) @@ -247,6 +247,9 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) { MPM.add(createInstructionCombiningPass()); MPM.add(createCFGSimplificationPass()); + if (!DisableUnrollLoops) + MPM.add(createLoopUnrollPass()); // Unroll small loops + if (!DisableUnitAtATime) { // FIXME: We shouldn't bother with this anymore. MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes |

