diff options
author | Hongbin Zheng <etherzhhb@gmail.com> | 2012-04-04 11:44:08 +0000 |
---|---|---|
committer | Hongbin Zheng <etherzhhb@gmail.com> | 2012-04-04 11:44:08 +0000 |
commit | b21b865fe8121cd187a5ee741b9bb28d1531467c (patch) | |
tree | d4e0debaa51e4a0672d187ebcbf96bcbc142dc42 /llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | |
parent | 61a331d5948742ec22bdebd02f3969eaf46d6b13 (diff) | |
download | bcm5719-llvm-b21b865fe8121cd187a5ee741b9bb28d1531467c.tar.gz bcm5719-llvm-b21b865fe8121cd187a5ee741b9bb28d1531467c.zip |
LoopUnrollPass: Use variable "Threshold" instead of "CurrentThreshold" when
reducing unroll count, otherwise the reduced unroll count is not taking
the "OptimizeForSize" attribute into account.
llvm-svn: 154007
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp index 22dbfe326c6..09a186f7f94 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -197,13 +197,13 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) { } if (TripCount) { // Reduce unroll count to be modulo of TripCount for partial unrolling - Count = CurrentThreshold / LoopSize; + Count = Threshold / LoopSize; while (Count != 0 && TripCount%Count != 0) Count--; } else if (UnrollRuntime) { // Reduce unroll count to be a lower power-of-two value - while (Count != 0 && Size > CurrentThreshold) { + while (Count != 0 && Size > Threshold) { Count >>= 1; Size = LoopSize*Count; } |