[PATCH] D35539: [IRCE] Handle loops with step different from 1/-1

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 23:50:45 PDT 2017


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:821
+      StepCI = StepExpr->getValue();
+      assert(!StepCI->isZero() && "Zero step?");
+      IsIncreasing = !StepCI->isNegative();
----------------
anna wrote:
> could you pls check this assert in as NFC.
Done as https://reviews.llvm.org/rL309661


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1594
   ConstantInt *ConstD = D->getValue();
-  if (!(ConstD->isMinusOne() || ConstD->isOne()))
-    return None;
+  assert(!ConstD->isZero() && "Recurrence with zero step?");
 
----------------
anna wrote:
> NFC assert here can be checked in separately (with the above NFC assert).
Done as https://reviews.llvm.org/rL309663


https://reviews.llvm.org/D35539





More information about the llvm-commits mailing list