in findGCD of multiply expr return the gcd

we used to return 1 instead of the gcd

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sebastian Pop
2014-04-08 21:21:05 +00:00
parent 2300669d41
commit d541e6e6ea
2 changed files with 157 additions and 2 deletions
+4 -2
View File
@@ -6962,10 +6962,12 @@ public:
if (PartialGCD != One)
return PartialGCD;
// Failed to find a PartialGCD: set the Remainder to the full expression,
// and return the GCD.
Remainder = Expr;
const SCEVMulExpr *Mul = dyn_cast<SCEVMulExpr>(GCD);
if (!Mul)
return PartialGCD;
return GCD;
// When the GCD is a multiply expression, try to decompose it:
// this occurs when Step does not divide the Start expression
@@ -6979,7 +6981,7 @@ public:
}
}
return PartialGCD;
return GCD;
}
const SCEV *visitUDivExpr(const SCEVUDivExpr *Expr) {