mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
handle special cases when findGCD returns 1
used to fail with 'Step should divide Start with no remainder.' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d541e6e6ea
commit
89e11b110a
@ -7001,12 +7001,17 @@ public:
|
||||
|
||||
const SCEV *Rem = Zero;
|
||||
const SCEV *Res = findGCD(SE, Expr->getOperand(0), GCD, &Rem);
|
||||
if (Res == One || Res->isAllOnesValue()) {
|
||||
Remainder = Expr;
|
||||
return GCD;
|
||||
}
|
||||
|
||||
if (Rem != Zero)
|
||||
Remainder = SE.getAddExpr(Remainder, Rem);
|
||||
|
||||
Rem = Zero;
|
||||
Res = findGCD(SE, Expr->getOperand(1), Res, &Rem);
|
||||
if (Rem != Zero) {
|
||||
if (Rem != Zero || Res == One || Res->isAllOnesValue()) {
|
||||
Remainder = Expr;
|
||||
return GCD;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user