mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-11 13:37:07 +00:00
[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
855ab9f801
commit
3d9db69707
@ -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
Block a user