[PATCH] D87832: [IndVars] Remove monotonic checks with unknown exit count

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 25 22:24:50 PDT 2020


apilipenko added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2452-2465
+      auto *BI = cast<BranchInst>(ExitingBB->getTerminator());
+      auto OptimizeCond = [&](bool Inverted, const SCEV *MaxIter) {
+        if (isTrivialCond(L, BI, SE, Inverted, MaxIter)) {
+          FoldExit(ExitingBB, Inverted);
+          return true;
+        }
+        return false;
----------------
mkazantsev wrote:
> apilipenko wrote:
> > Separable refactoring?
> No. The old version does not use the max iter. The only difference of the new code is that it does.
You can still extract the lambda and add a new parameter in the functional patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87832/new/

https://reviews.llvm.org/D87832



More information about the llvm-commits mailing list