[llvm-commits] [llvm] r64702 - /llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
Dan Gohman
gohman at apple.com
Mon Feb 16 16:10:53 PST 2009
Author: djg
Date: Mon Feb 16 18:10:53 2009
New Revision: 64702
URL: http://llvm.org/viewvc/llvm-project?rev=64702&view=rev
Log:
Simplify; fix some 80-column violations.
Modified:
llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=64702&r1=64701&r2=64702&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Feb 16 18:10:53 2009
@@ -705,8 +705,9 @@
// variable.
while (!IndVars.empty()) {
PHINode *PN = IndVars.back().first;
- Value *NewVal = Rewriter.expandCodeFor(IndVars.back().second, InsertPt);
- DOUT << "INDVARS: Rewrote IV '" << *IndVars.back().second << "' " << *PN
+ SCEVAddRecExpr *AR = cast<SCEVAddRecExpr>(IndVars.back().second);
+ Value *NewVal = Rewriter.expandCodeFor(AR, InsertPt);
+ DOUT << "INDVARS: Rewrote IV '" << *AR << "' " << *PN
<< " into = " << *NewVal << "\n";
NewVal->takeName(PN);
@@ -718,9 +719,9 @@
UI != UE; ++UI) {
if (isa<SExtInst>(UI) && NoSignedWrap) {
SCEVHandle ExtendedStart =
- SE->getSignExtendExpr(cast<SCEVAddRecExpr>(IndVars.back().second)->getStart(), LargestType);
+ SE->getSignExtendExpr(AR->getStart(), LargestType);
SCEVHandle ExtendedStep =
- SE->getSignExtendExpr(cast<SCEVAddRecExpr>(IndVars.back().second)->getStepRecurrence(*SE), LargestType);
+ SE->getSignExtendExpr(AR->getStepRecurrence(*SE), LargestType);
SCEVHandle ExtendedAddRec =
SE->getAddRecExpr(ExtendedStart, ExtendedStep, L);
if (LargestType != UI->getType())
@@ -732,9 +733,9 @@
}
if (isa<ZExtInst>(UI) && NoUnsignedWrap) {
SCEVHandle ExtendedStart =
- SE->getZeroExtendExpr(cast<SCEVAddRecExpr>(IndVars.back().second)->getStart(), LargestType);
+ SE->getZeroExtendExpr(AR->getStart(), LargestType);
SCEVHandle ExtendedStep =
- SE->getZeroExtendExpr(cast<SCEVAddRecExpr>(IndVars.back().second)->getStepRecurrence(*SE), LargestType);
+ SE->getZeroExtendExpr(AR->getStepRecurrence(*SE), LargestType);
SCEVHandle ExtendedAddRec =
SE->getAddRecExpr(ExtendedStart, ExtendedStep, L);
if (LargestType != UI->getType())
More information about the llvm-commits
mailing list