summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopUnrollPass.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-01-17 22:39:54 +0000
committerOwen Anderson <resistor@mac.com>2011-01-17 22:39:54 +0000
commit390b9f00eb87e850a619b34ee36bc7b6860a7165 (patch)
treebfb4ec704cc2cd4944a9508c6948e0d09e2f02a3 /lib/Transforms/Scalar/LoopUnrollPass.cpp
parente73588222491b324b4f30a67706478d1f5806986 (diff)
downloadllvm-390b9f00eb87e850a619b34ee36bc7b6860a7165.tar.gz
llvm-390b9f00eb87e850a619b34ee36bc7b6860a7165.tar.bz2
llvm-390b9f00eb87e850a619b34ee36bc7b6860a7165.tar.xz
Remove dead code, that I apparently wrote a while back. We seem to be doing well enough
without whatever this was trying to do. When/if someone has the time to do some empirical evaluations, it might be worth it to figure out what this code was trying to do and see if it's worth resurrecting/fixing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnrollPass.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopUnrollPass.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 90eb857c85..80b263a30c 100644
--- a/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -99,21 +99,6 @@ static unsigned ApproximateLoopSize(const Loop *L, unsigned &NumCalls) {
unsigned LoopSize = Metrics.NumInsts;
- // If we can identify the induction variable, we know that it will become
- // constant when we unroll the loop, so factor that into our loop size
- // estimate.
- // FIXME: We have to divide by InlineConstants::InstrCost because the
- // measure returned by CountCodeReductionForConstant is not an instruction
- // count, but rather a weight as defined by InlineConstants. It would
- // probably be a good idea to standardize on a single weighting scheme by
- // pushing more of the logic for weighting into CodeMetrics.
- if (PHINode *IndVar = L->getCanonicalInductionVariable()) {
- 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 / 2 : SizeDecrease;
- }
-
// Don't allow an estimate of size zero. This would allows unrolling of loops
// with huge iteration counts, which is a compile time problem even if it's
// not a problem for code quality.