aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LoopUnrollPass.cpp
diff options
context:
space:
mode:
authorHongbin Zheng <etherzhhb@gmail.com>2012-04-04 11:44:08 +0000
committerHongbin Zheng <etherzhhb@gmail.com>2012-04-04 11:44:08 +0000
commit00b73a5e443d49d68f59a5fb517e940842423ae6 (patch)
treee4533680211bea0fc9d6f260672446eefa0f80da /lib/Transforms/Scalar/LoopUnrollPass.cpp
parenta95b4ebf3c17f0069b8cea3841d66395eaf6d4e1 (diff)
downloadexternal_llvm-00b73a5e443d49d68f59a5fb517e940842423ae6.zip
external_llvm-00b73a5e443d49d68f59a5fb517e940842423ae6.tar.gz
external_llvm-00b73a5e443d49d68f59a5fb517e940842423ae6.tar.bz2
LoopUnrollPass: Use variable "Threshold" instead of "CurrentThreshold" when
reducing unroll count, otherwise the reduced unroll count is not taking the "OptimizeForSize" attribute into account. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnrollPass.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopUnrollPass.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 22dbfe3..09a186f 100644
--- a/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/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;
}