Simplify.
authorDan Gohman <gohman@apple.com>
Wed, 30 Jun 2010 06:09:46 +0000 (06:09 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 30 Jun 2010 06:09:46 +0000 (06:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107248 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolutionExpander.cpp

index 2f7f73ed501bd5aab232882df7a0c18ab75a049c..99b4a406dac44aa67c72b9ff453b08f3e56d1dec 100644 (file)
@@ -1101,8 +1101,7 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) {
   }
 
   // {0,+,1} --> Insert a canonical induction variable into the loop!
-  if (S->isAffine() &&
-      S->getOperand(1) == SE.getConstant(Ty, 1)) {
+  if (S->isAffine() && S->getOperand(1)->isOne()) {
     // If there's a canonical IV, just use it.
     if (CanonicalIV) {
       assert(Ty == SE.getEffectiveSCEVType(CanonicalIV->getType()) &&