mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Process the step before the start, because it's usually the simpler
of the two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111495 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
efbdc8e236
commit
694a15eabe
@ -441,12 +441,12 @@ static const SCEV *getExactSDiv(const SCEV *LHS, const SCEV *RHS,
|
|||||||
// Distribute the sdiv over addrec operands, if the addrec doesn't overflow.
|
// Distribute the sdiv over addrec operands, if the addrec doesn't overflow.
|
||||||
if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(LHS)) {
|
if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(LHS)) {
|
||||||
if (IgnoreSignificantBits || isAddRecSExtable(AR, SE)) {
|
if (IgnoreSignificantBits || isAddRecSExtable(AR, SE)) {
|
||||||
const SCEV *Start = getExactSDiv(AR->getStart(), RHS, SE,
|
|
||||||
IgnoreSignificantBits);
|
|
||||||
if (!Start) return 0;
|
|
||||||
const SCEV *Step = getExactSDiv(AR->getStepRecurrence(SE), RHS, SE,
|
const SCEV *Step = getExactSDiv(AR->getStepRecurrence(SE), RHS, SE,
|
||||||
IgnoreSignificantBits);
|
IgnoreSignificantBits);
|
||||||
if (!Step) return 0;
|
if (!Step) return 0;
|
||||||
|
const SCEV *Start = getExactSDiv(AR->getStart(), RHS, SE,
|
||||||
|
IgnoreSignificantBits);
|
||||||
|
if (!Start) return 0;
|
||||||
return SE.getAddRecExpr(Start, Step, AR->getLoop());
|
return SE.getAddRecExpr(Start, Step, AR->getLoop());
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user