mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 21:34:23 +00:00
Use SCEVAddRecExpr::isAffine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52614 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
09d3fdc254
commit
17f1972c77
@ -407,7 +407,7 @@ namespace llvm {
|
|||||||
/// indicating how much this expression steps by. If this is a polynomial
|
/// indicating how much this expression steps by. If this is a polynomial
|
||||||
/// of degree N, it returns a chrec of degree N-1.
|
/// of degree N, it returns a chrec of degree N-1.
|
||||||
SCEVHandle getStepRecurrence(ScalarEvolution &SE) const {
|
SCEVHandle getStepRecurrence(ScalarEvolution &SE) const {
|
||||||
if (getNumOperands() == 2) return getOperand(1);
|
if (isAffine()) return getOperand(1);
|
||||||
return SE.getAddRecExpr(std::vector<SCEVHandle>(op_begin()+1,op_end()),
|
return SE.getAddRecExpr(std::vector<SCEVHandle>(op_begin()+1,op_end()),
|
||||||
getLoop());
|
getLoop());
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// {0,+,1} --> Insert a canonical induction variable into the loop!
|
// {0,+,1} --> Insert a canonical induction variable into the loop!
|
||||||
if (S->getNumOperands() == 2 &&
|
if (S->isAffine() &&
|
||||||
S->getOperand(1) == SE.getIntegerSCEV(1, Ty)) {
|
S->getOperand(1) == SE.getIntegerSCEV(1, Ty)) {
|
||||||
// Create and insert the PHI node for the induction variable in the
|
// Create and insert the PHI node for the induction variable in the
|
||||||
// specified loop.
|
// specified loop.
|
||||||
@ -178,7 +178,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
|
|||||||
Value *I = getOrInsertCanonicalInductionVariable(L, Ty);
|
Value *I = getOrInsertCanonicalInductionVariable(L, Ty);
|
||||||
|
|
||||||
// If this is a simple linear addrec, emit it now as a special case.
|
// If this is a simple linear addrec, emit it now as a special case.
|
||||||
if (S->getNumOperands() == 2) { // {0,+,F} --> i*F
|
if (S->isAffine()) { // {0,+,F} --> i*F
|
||||||
Value *F = expand(S->getOperand(1));
|
Value *F = expand(S->getOperand(1));
|
||||||
|
|
||||||
// IF the step is by one, just return the inserted IV.
|
// IF the step is by one, just return the inserted IV.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user