1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00

Throttle back indvar substitution from creating multiplies in loops. This is bad bad bad.

llvm-svn: 15227
This commit is contained in:
Chris Lattner 2004-07-26 02:47:12 +00:00
parent 4fcb3b1e7d
commit c2e9c56906

View File

@ -607,9 +607,9 @@ void IndVarSimplify::runOnLoop(Loop *L) {
// variable. Doing so will put expensive multiply instructions inside
// of the loop. For now just disable indvar subst on anything more
// complex than a linear addrec.
if (!isa<SCEVAddRecExpr>(SCEV) ||
cast<SCEVAddRecExpr>(SCEV)->getNumOperands() < 3)
IndVars.push_back(std::make_pair(PN, SCEV));
if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV))
if (AR->getNumOperands() == 2 && isa<SCEVConstant>(AR->getOperand(1)))
IndVars.push_back(std::make_pair(PN, SCEV));
}
// If there are no induction variables in the loop, there is nothing more to