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 | 6bbb01bbf8d546afb2810f382d47b1db5213ff42 (patch) | |
tree | 91e417f2b46036fad0851768f66f1fe0e604d106 /lib/Transforms/Scalar | |
parent | 302173470093455c002d5109dae4710f2de70574 (diff) | |
download | llvm-6bbb01bbf8d546afb2810f382d47b1db5213ff42.tar.gz llvm-6bbb01bbf8d546afb2810f382d47b1db5213ff42.tar.bz2 llvm-6bbb01bbf8d546afb2810f382d47b1db5213ff42.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index 583fdd4133..4420dc2d4a 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/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, |