[llvm] a0d84d8 - Revert "[NFC] Factor away lambda's redundant parameter"

Raphael Isemann via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 07:32:51 PDT 2020


Author: Raphael Isemann
Date: 2020-10-27T15:30:52+01:00
New Revision: a0d84d80315d0c725b5efcd889928bad1171ba56

URL: https://github.com/llvm/llvm-project/commit/a0d84d80315d0c725b5efcd889928bad1171ba56
DIFF: https://github.com/llvm/llvm-project/commit/a0d84d80315d0c725b5efcd889928bad1171ba56.diff

LOG: Revert "[NFC] Factor away lambda's redundant parameter"

This reverts commit fdc845b36130d162e5a66e427bf69b2c37b6c6bb.
It seems to be a follow-up to c6372b3fb495 which will be reverted.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 729173df6355..00976d44b665 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2429,14 +2429,15 @@ bool IndVarSimplify::optimizeLoopExits(Loop *L, SCEVExpander &Rewriter) {
       // Okay, we do not know the exit count here. Can we at least prove that it
       // will remain the same within iteration space?
       auto *BI = cast<BranchInst>(ExitingBB->getTerminator());
-      auto OptimizeCond = [&](bool Inverted) {
-        if (isTrivialCond(L, BI, SE, Inverted, MaxExitCount)) {
+      auto OptimizeCond = [&](bool Inverted, const SCEV *MaxIter) {
+        if (isTrivialCond(L, BI, SE, Inverted, MaxIter)) {
           FoldExit(ExitingBB, Inverted);
           return true;
         }
         return false;
       };
-      if (OptimizeCond(false) || OptimizeCond(true))
+      if (OptimizeCond(false, MaxExitCount) ||
+          OptimizeCond(true, MaxExitCount))
         Changed = true;
       continue;
     }


        


More information about the llvm-commits mailing list