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 | fcef4312c9d79d694094e71d9d4b381067ef1ede (patch) | |
| tree | c0121c02f87ee8cdc892a46421574c1d7c31e61f | |
| parent | c77056a1ee87dc4b63f83c6e8381322403251e61 (diff) | |
| download | external_llvm-fcef4312c9d79d694094e71d9d4b381067ef1ede.zip external_llvm-fcef4312c9d79d694094e71d9d4b381067ef1ede.tar.gz external_llvm-fcef4312c9d79d694094e71d9d4b381067ef1ede.tar.bz2 | |
Fix typo in code to cap the loop code size reduction calculation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113526 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index 967ce93..9c5c591 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/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 |
