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/Scalar/LoopUnrollPass.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/Scalar/LoopUnrollPass.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp index 583fdd41330..4420dc2d4ad 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -125,6 +125,10 @@ Pass *llvm::createLoopUnrollPass(int Threshold, int Count, int AllowPartial, return new LoopUnroll(Threshold, Count, AllowPartial, Runtime); } +Pass *llvm::createSimpleLoopUnrollPass() { + return llvm::createLoopUnrollPass(-1, -1, 0, 0); +} + /// ApproximateLoopSize - Approximate the size of the loop. static unsigned ApproximateLoopSize(const Loop *L, unsigned &NumCalls, bool &NotDuplicatable, |