[PATCH] D39500: [LoopPredication] Enable predication when latchCheckIV is wider than rangeCheck

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 07:49:30 PDT 2017


apilipenko accepted this revision.
apilipenko added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:380
   auto *Step = RangeCheckIV->getStepRecurrence(*SE);
-  if (Step != LatchCheck.IV->getStepRecurrence(*SE)) {
+  if (!Step->isOne()) {
     DEBUG(dbgs() << "Range check and latch have IVs different steps!\n");
----------------
Can you please add a comment why we can't compare with LatchCheck.IV->getStepRecurrence(*SE) anymore?


================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:393
 
+  LoopICmp CurrLatchCheck = *CurrLatchCheckOpt;
+  // At this point the range check step and latch step should have the same
----------------
Maybe `TyLatchCheck` and `TyLatchCheckOpt`?


https://reviews.llvm.org/D39500





More information about the llvm-commits mailing list