[llvm] r309663 - [IRCE][NFC] Add another assert that AddRecExpr's step is not zero

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 23:49:29 PDT 2017


Author: mkazantsev
Date: Mon Jul 31 23:49:29 2017
New Revision: 309663

URL: http://llvm.org/viewvc/llvm-project?rev=309663&view=rev
Log:
[IRCE][NFC] Add another assert that AddRecExpr's step is not zero

One more assertion of this kind. It is a preparation step for generalizing
to the case of stride not equal to +1/-1.

Modified:
    llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp?rev=309663&r1=309662&r2=309663&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp Mon Jul 31 23:49:29 2017
@@ -1500,6 +1500,7 @@ InductiveRangeCheck::computeSafeIteratio
   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());




More information about the llvm-commits mailing list