OSDN Git Service

[IRCE][NFC] Add another assert that AddRecExpr's step is not zero
authorMax Kazantsev <max.kazantsev@azul.com>
Tue, 1 Aug 2017 06:49:29 +0000 (06:49 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Tue, 1 Aug 2017 06:49:29 +0000 (06:49 +0000)
One more assertion of this kind. It is a preparation step for generalizing
to the case of stride not equal to +1/-1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309663 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp

index 0c6a9f2..fe502bf 100644 (file)
@@ -1500,6 +1500,7 @@ InductiveRangeCheck::computeSafeIterationSpace(
   const SCEVConstant *B = dyn_cast<SCEVConstant>(IndVar->getStepRecurrence(SE));
   if (!B)
     return None;
+  assert(!B->isZero() && "Recurrence with zero step?");
 
   const SCEV *C = getOffset();
   const SCEVConstant *D = dyn_cast<SCEVConstant>(getScale());