Use the SCEVAddRecExpr::getPostIncExpr utility function instead

of doing the same thing manually.

llvm-svn: 102997
This commit is contained in:
Dan Gohman 2010-05-04 01:12:27 +00:00
parent 5f18c547da
commit 70a3b12193
1 changed files with 2 additions and 4 deletions

View File

@ -5049,15 +5049,13 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
if (isLoopEntryGuardedByCond(
AR->getLoop(), Pred, AR->getStart(), RHS) &&
isLoopBackedgeGuardedByCond(
AR->getLoop(), Pred,
getAddExpr(AR, AR->getStepRecurrence(*this)), RHS))
AR->getLoop(), Pred, AR->getPostIncExpr(*this), RHS))
return true;
if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(RHS))
if (isLoopEntryGuardedByCond(
AR->getLoop(), Pred, LHS, AR->getStart()) &&
isLoopBackedgeGuardedByCond(
AR->getLoop(), Pred,
LHS, getAddExpr(AR, AR->getStepRecurrence(*this))))
AR->getLoop(), Pred, LHS, AR->getPostIncExpr(*this)))
return true;
// Otherwise see what can be done with known constant ranges.