diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-12 07:56:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-12 07:56:56 +0000 |
commit | 07f6563e813dc65c0c48e5b185ada52f93a66b8c (patch) | |
tree | 387616749912df7996fd720c934e31afc92168dc /llvm/lib/Transforms | |
parent | 7531ca96f7d6c3e77099ea9105db3ad76035a78f (diff) | |
download | bcm5719-llvm-07f6563e813dc65c0c48e5b185ada52f93a66b8c.tar.gz bcm5719-llvm-07f6563e813dc65c0c48e5b185ada52f93a66b8c.zip |
Move the EliminateIVUsers call back out to its original location. Now that
a ScalarEvolution bug with overflow handling is fixed, the normal analysis
code will automatically decline to operate on the icmp instructions which
are responsible for the loop exit.
llvm-svn: 101032
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index e6e0129fa44..4f779050d91 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -406,6 +406,9 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { if (!isa<SCEVCouldNotCompute>(BackedgeTakenCount)) RewriteLoopExitValues(L, Rewriter); + // Simplify ICmp IV users. + EliminateIVComparisons(); + // Compute the type of the largest recurrence expression, and decide whether // a canonical induction variable should be inserted. const Type *LargestType = 0; @@ -471,19 +474,10 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { ExitingBlock) { assert(NeedCannIV && "LinearFunctionTestReplace requires a canonical induction variable"); - // Can't rewrite non-branch yet. - if (BranchInst *BI = dyn_cast<BranchInst>(ExitingBlock->getTerminator())) { - // Eliminate comparisons which are always true or always false, due to - // the known backedge-taken count. This may include comparisons which - // are currently controlling (part of) the loop exit, so we can only do - // it when we know we're going to insert our own loop exit code. - EliminateIVComparisons(); - - // Insert new loop exit code. + if (BranchInst *BI = dyn_cast<BranchInst>(ExitingBlock->getTerminator())) NewICmp = LinearFunctionTestReplace(L, BackedgeTakenCount, IndVar, ExitingBlock, BI, Rewriter); - } } // Rewrite IV-derived expressions. Clears the rewriter cache. |