[llvm] 0c7910e - [NFC] Rename variable MaxBECount -> ConstantMaxBECount

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 02:49:07 PST 2022


Author: Max Kazantsev
Date: 2022-12-05T17:48:36+07:00
New Revision: 0c7910eab9e695eae9f242fd3fcb2e9cc97839e9

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

LOG: [NFC] Rename variable MaxBECount -> ConstantMaxBECount

Just to distinguish it from symbolic max which we plan to compute
here as well.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 54542fabea00..751fad444a7d 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8944,7 +8944,7 @@ ScalarEvolution::computeExitLimitFromCondFromBinOp(
     return Op0 == NeutralElement ? EL1 : EL0;
 
   const SCEV *BECount = getCouldNotCompute();
-  const SCEV *MaxBECount = getCouldNotCompute();
+  const SCEV *ConstantMaxBECount = getCouldNotCompute();
   if (EitherMayExit) {
     // Both conditions must be same for the loop to continue executing.
     // Choose the less conservative count.
@@ -8955,12 +8955,12 @@ ScalarEvolution::computeExitLimitFromCondFromBinOp(
           /*Sequential=*/!isa<BinaryOperator>(ExitCond));
     }
     if (EL0.ConstantMaxNotTaken == getCouldNotCompute())
-      MaxBECount = EL1.ConstantMaxNotTaken;
+      ConstantMaxBECount = EL1.ConstantMaxNotTaken;
     else if (EL1.ConstantMaxNotTaken == getCouldNotCompute())
-      MaxBECount = EL0.ConstantMaxNotTaken;
+      ConstantMaxBECount = EL0.ConstantMaxNotTaken;
     else
-      MaxBECount = getUMinFromMismatchedTypes(EL0.ConstantMaxNotTaken,
-                                              EL1.ConstantMaxNotTaken);
+      ConstantMaxBECount = getUMinFromMismatchedTypes(EL0.ConstantMaxNotTaken,
+                                                      EL1.ConstantMaxNotTaken);
   } else {
     // Both conditions must be same at the same time for the loop to exit.
     // For now, be conservative.
@@ -8970,14 +8970,15 @@ ScalarEvolution::computeExitLimitFromCondFromBinOp(
 
   // There are cases (e.g. PR26207) where computeExitLimitFromCond is able
   // to be more aggressive when computing BECount than when computing
-  // MaxBECount.  In these cases it is possible for EL0.ExactNotTaken and
+  // ConstantMaxBECount.  In these cases it is possible for EL0.ExactNotTaken
+  // and
   // EL1.ExactNotTaken to match, but for EL0.ConstantMaxNotTaken and
   // EL1.ConstantMaxNotTaken to not.
-  if (isa<SCEVCouldNotCompute>(MaxBECount) &&
+  if (isa<SCEVCouldNotCompute>(ConstantMaxBECount) &&
       !isa<SCEVCouldNotCompute>(BECount))
-    MaxBECount = getConstant(getUnsignedRangeMax(BECount));
+    ConstantMaxBECount = getConstant(getUnsignedRangeMax(BECount));
 
-  return ExitLimit(BECount, MaxBECount, false,
+  return ExitLimit(BECount, ConstantMaxBECount, false,
                    { &EL0.Predicates, &EL1.Predicates });
 }
 


        


More information about the llvm-commits mailing list