diff options
| author | Dan Gohman <gohman@apple.com> | 2008-08-05 22:34:21 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-08-05 22:34:21 +0000 |
| commit | 1fcc804cfdf9be81a985e89b05f78c0194784213 (patch) | |
| tree | 526277485056a7a2f48d37a99649eecdfe2e728d /llvm/lib/Transforms | |
| parent | 6e03f9a40b0cb823e8b85f85152f74bd268255d1 (diff) | |
| download | bcm5719-llvm-1fcc804cfdf9be81a985e89b05f78c0194784213.tar.gz bcm5719-llvm-1fcc804cfdf9be81a985e89b05f78c0194784213.zip | |
Pass the computed iteration count value to RewriteLoopExitValues
instead of having it call getIterationCount again.
llvm-svn: 54380
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index cde16e74736..5d709e50fbb 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -90,7 +90,7 @@ namespace { std::set<Instruction*> &DeadInsts); Instruction *LinearFunctionTestReplace(Loop *L, SCEV *IterationCount, SCEVExpander &RW); - void RewriteLoopExitValues(Loop *L); + void RewriteLoopExitValues(Loop *L, SCEV *IterationCount); void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts); }; @@ -303,7 +303,7 @@ Instruction *IndVarSimplify::LinearFunctionTestReplace(Loop *L, /// final value of any expressions that are recurrent in the loop, and /// substitute the exit values from the loop into any instructions outside of /// the loop that use the final values of the current expressions. -void IndVarSimplify::RewriteLoopExitValues(Loop *L) { +void IndVarSimplify::RewriteLoopExitValues(Loop *L, SCEV *IterationCount) { BasicBlock *Preheader = L->getLoopPreheader(); // Scan all of the instructions in the loop, looking at those that have @@ -321,7 +321,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L) { BlockToInsertInto = Preheader; BasicBlock::iterator InsertPt = BlockToInsertInto->getFirstNonPHI(); - bool HasConstantItCount = isa<SCEVConstant>(SE->getIterationCount(L)); + bool HasConstantItCount = isa<SCEVConstant>(IterationCount); std::set<Instruction*> InstructionsToDelete; std::map<Instruction*, Value*> ExitValues; @@ -458,7 +458,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { // SCEVHandle IterationCount = SE->getIterationCount(L); if (!isa<SCEVCouldNotCompute>(IterationCount)) - RewriteLoopExitValues(L); + RewriteLoopExitValues(L, IterationCount); // Next, analyze all of the induction variables in the loop, canonicalizing // auxillary induction variables. |

