Use the SCEVAddRecExpr::getPostIncExpr utility function instead
authorDan Gohman <gohman@apple.com>
Tue, 4 May 2010 01:12:27 +0000 (01:12 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 4 May 2010 01:12:27 +0000 (01:12 +0000)
of doing the same thing manually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102997 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index 758ad070e7c8bec5fb663cbf156ddaac0522e7d9..6870268e838b7044030b314fc7568f7e2d1706ef 100644 (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.