mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Process the step before the start, because it's usually the simpler
of the two. llvm-svn: 111495
This commit is contained in:
parent
b3abfa861f
commit
ba5736d2fe
@ -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.
|
||||
if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(LHS)) {
|
||||
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,
|
||||
IgnoreSignificantBits);
|
||||
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 0;
|
||||
|
Loading…
Reference in New Issue
Block a user