Minor code simplification.
authorDan Gohman <gohman@apple.com>
Thu, 20 May 2010 16:23:28 +0000 (16:23 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 20 May 2010 16:23:28 +0000 (16:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104232 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index bca5e4f595b61e7625ae34e2d632126cf69f2f83..f648560e487442724959db81f4d065f1f26947f1 100644 (file)
@@ -467,14 +467,14 @@ static const SCEV *getExactSDiv(const SCEV *LHS, const SCEV *RHS,
       bool Found = false;
       for (SCEVMulExpr::op_iterator I = Mul->op_begin(), E = Mul->op_end();
            I != E; ++I) {
+        const SCEV *S = *I;
         if (!Found)
-          if (const SCEV *Q = getExactSDiv(*I, RHS, SE,
+          if (const SCEV *Q = getExactSDiv(S, RHS, SE,
                                            IgnoreSignificantBits)) {
-            Ops.push_back(Q);
+            S = Q;
             Found = true;
-            continue;
           }
-        Ops.push_back(*I);
+        Ops.push_back(S);
       }
       return Found ? SE.getMulExpr(Ops) : 0;
     }