diff options
author | Owen Anderson <resistor@mac.com> | 2010-09-09 19:08:59 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-09-09 19:08:59 +0000 |
commit | b61b1647e215fd165d36c27fa9be8409f21995b0 (patch) | |
tree | 3a3674af8d41b473453cab67826145137759ba79 /llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | |
parent | 62ea1b718c3a3ad3c0f7fe0734622768d2cc0d2c (diff) | |
download | bcm5719-llvm-b61b1647e215fd165d36c27fa9be8409f21995b0.tar.gz bcm5719-llvm-b61b1647e215fd165d36c27fa9be8409f21995b0.zip |
Fix typo in code to cap the loop code size reduction calculation.
llvm-svn: 113526
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 967ce93a242..9c5c5912239 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -27,7 +27,7 @@ using namespace llvm; static cl::opt<unsigned> -UnrollThreshold("unroll-threshold", cl::init(200), cl::Hidden, +UnrollThreshold("unroll-threshold", cl::init(0), cl::Hidden, cl::desc("The cut-off point for automatic loop unrolling")); static cl::opt<unsigned> @@ -105,7 +105,7 @@ static unsigned ApproximateLoopSize(const Loop *L, unsigned &NumCalls) { unsigned SizeDecrease = Metrics.CountCodeReductionForConstant(IndVar); // NOTE: Because SizeDecrease is a fuzzy estimate, we don't want to allow // it to totally negate the cost of unrolling a loop. - SizeDecrease = SizeDecrease > LoopSize / 2 ? LoopSize : SizeDecrease; + SizeDecrease = SizeDecrease > LoopSize / 2 ? LoopSize / 2 : SizeDecrease; } // Don't allow an estimate of size zero. This would allows unrolling of loops |