forked from OSchip/llvm-project
[IRCE][NFC] Add assert that AddRecExpr's step is not zero
We should never return zero steps, ensure this fact by adding a sanity check when we are analyzing the induction variable. llvm-svn: 309661
This commit is contained in:
parent
35fdbd56b7
commit
85da7543f9
|
@ -779,6 +779,7 @@ LoopStructure::parseLoopStructure(ScalarEvolution &SE, BranchProbabilityInfo &BP
|
|||
if (const SCEVConstant *StepExpr =
|
||||
dyn_cast<SCEVConstant>(AR->getStepRecurrence(SE))) {
|
||||
ConstantInt *StepCI = StepExpr->getValue();
|
||||
assert(!StepCI->isZero() && "Zero step?");
|
||||
if (StepCI->isOne() || StepCI->isMinusOne()) {
|
||||
IsIncreasing = StepCI->isOne();
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue