[llvm] fdc845b - [NFC] Factor away lambda's redundant parameter

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 22:57:10 PDT 2020


Author: Max Kazantsev
Date: 2020-10-27T12:56:52+07:00
New Revision: fdc845b36130d162e5a66e427bf69b2c37b6c6bb

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

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

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 00976d44b665..729173df6355 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2429,15 +2429,14 @@ 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, const SCEV *MaxIter) {
-        if (isTrivialCond(L, BI, SE, Inverted, MaxIter)) {
+      auto OptimizeCond = [&](bool Inverted) {
+        if (isTrivialCond(L, BI, SE, Inverted, MaxExitCount)) {
           FoldExit(ExitingBB, Inverted);
           return true;
         }
         return false;
       };
-      if (OptimizeCond(false, MaxExitCount) ||
-          OptimizeCond(true, MaxExitCount))
+      if (OptimizeCond(false) || OptimizeCond(true))
         Changed = true;
       continue;
     }


        


More information about the llvm-commits mailing list