forked from OSchip/llvm-project
Follow-up to D105207, only salvage affine SCEVs to avoid a crash
SCEVToIterCountExpr only expects to be fed affine expressions, but DbgRewriteSalvageableDVIs is feeding it non-affine induction variables. Following this up with an obvious fix, will add test coverage too if this avoids D105207 being reverted.
This commit is contained in:
parent
0d68cfc996
commit
2537120c87
|
@ -6162,6 +6162,9 @@ DbgRewriteSalvageableDVIs(llvm::Loop *L, ScalarEvolution &SE,
|
|||
bool Changed = false;
|
||||
if (const SCEVAddRecExpr *IVAddRec =
|
||||
dyn_cast<SCEVAddRecExpr>(SCEVInductionVar)) {
|
||||
if (!IVAddRec->isAffine())
|
||||
return false;
|
||||
|
||||
SCEVDbgValueBuilder IterCountExpr;
|
||||
IterCountExpr.pushValue(LSRInductionVar);
|
||||
if (!IterCountExpr.SCEVToIterCountExpr(*IVAddRec, SE))
|
||||
|
|
Loading…
Reference in New Issue