forked from OSchip/llvm-project
In SCEVAddExpr::get, skip over any cast operands before looking for nested
add operands after constant operands. The recent change to recognize sign-extend expressions caused this to be exposed more often. llvm-svn: 37628
This commit is contained in:
parent
02b0997b28
commit
eed125f315
|
@ -685,8 +685,11 @@ SCEVHandle SCEVAddExpr::get(std::vector<SCEVHandle> &Ops) {
|
||||||
return SCEVAddExpr::get(Ops);
|
return SCEVAddExpr::get(Ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Okay, now we know the first non-constant operand. If there are add
|
// Now we know the first non-constant operand. Skip past any cast SCEVs.
|
||||||
// operands they would be next.
|
while (Idx < Ops.size() && Ops[Idx]->getSCEVType() < scAddExpr)
|
||||||
|
++Idx;
|
||||||
|
|
||||||
|
// If there are add operands they would be next.
|
||||||
if (Idx < Ops.size()) {
|
if (Idx < Ops.size()) {
|
||||||
bool DeletedAdd = false;
|
bool DeletedAdd = false;
|
||||||
while (SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Ops[Idx])) {
|
while (SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Ops[Idx])) {
|
||||||
|
|
Loading…
Reference in New Issue