divide by the result of the gcd
authorSebastian Pop <spop@codeaurora.org>
Tue, 8 Apr 2014 21:21:13 +0000 (21:21 +0000)
committerSebastian Pop <spop@codeaurora.org>
Tue, 8 Apr 2014 21:21:13 +0000 (21:21 +0000)
used to fail with 'Step should divide Start with no remainder.'

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

lib/Analysis/ScalarEvolution.cpp

index 6ccf8aac3b893c4ba3b8ec344cf980ee7eb1bad0..fdb15629f431ce906400dbe8d70283106eff6169 100644 (file)
@@ -7138,7 +7138,7 @@ public:
         const SCEV *Res = SCEVGCD::findGCD(SE, Expr->getOperand(i), GCD, &Rem);
         if (Rem == Zero) {
           PartialGCD = SE.getMulExpr(PartialGCD, Res);
-          Operands.push_back(divide(SE, Expr->getOperand(i), GCD));
+          Operands.push_back(divide(SE, Expr->getOperand(i), Res));
         } else {
           Operands.push_back(Expr->getOperand(i));
         }