forked from OSchip/llvm-project
When extending the operands of an addrec, iterate through all
the operands, rather than trying to partition them into a start and a step. This handles non-affine add recurrences correctly. llvm-svn: 83011
This commit is contained in:
parent
565371b4c9
commit
f230656a02
|
@ -620,11 +620,11 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) {
|
|||
if (CanonicalIV &&
|
||||
SE.getTypeSizeInBits(CanonicalIV->getType()) >
|
||||
SE.getTypeSizeInBits(Ty)) {
|
||||
const SCEV *Start = SE.getAnyExtendExpr(S->getStart(),
|
||||
CanonicalIV->getType());
|
||||
const SCEV *Step = SE.getAnyExtendExpr(S->getStepRecurrence(SE),
|
||||
CanonicalIV->getType());
|
||||
Value *V = expand(SE.getAddRecExpr(Start, Step, S->getLoop()));
|
||||
const SmallVectorImpl<const SCEV *> &Ops = S->getOperands();
|
||||
SmallVector<const SCEV *, 4> NewOps(Ops.size());
|
||||
for (unsigned i = 0, e = Ops.size(); i != e; ++i)
|
||||
NewOps[i] = SE.getAnyExtendExpr(Ops[i], CanonicalIV->getType());
|
||||
Value *V = expand(SE.getAddRecExpr(NewOps, S->getLoop()));
|
||||
BasicBlock *SaveInsertBB = Builder.GetInsertBlock();
|
||||
BasicBlock::iterator SaveInsertPt = Builder.GetInsertPoint();
|
||||
BasicBlock::iterator NewInsertPt =
|
||||
|
|
Loading…
Reference in New Issue