[llvm] r315920 - [SCEV] Rename getMaxBECount and update comments. NFC

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 10:47:17 PDT 2017


Author: annat
Date: Mon Oct 16 10:47:17 2017
New Revision: 315920

URL: http://llvm.org/viewvc/llvm-project?rev=315920&view=rev
Log:
[SCEV] Rename getMaxBECount and update comments. NFC

Post commit review comments at D38825.

Modified:
    llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=315920&r1=315919&r2=315920&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Oct 16 10:47:17 2017
@@ -1746,9 +1746,10 @@ private:
   const SCEV *computeBECount(const SCEV *Delta, const SCEV *Stride,
                              bool Equality);
 
-  // Compute the maximum backedge count based on the range of values
-  // permitted by Start, End, and Stride.
-  const SCEV *computeMaxBECount(const SCEV *Start, const SCEV *Stride,
+  /// Compute the maximum backedge count based on the range of values
+  /// permitted by Start, End, and Stride. This is for loops of the form
+  /// {Start, +, Stride} LT End.
+  const SCEV *computeMaxBECountForLT(const SCEV *Start, const SCEV *Stride,
                                 const SCEV *End, unsigned BitWidth,
                                 bool IsSigned);
 

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=315920&r1=315919&r2=315920&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Oct 16 10:47:17 2017
@@ -9725,11 +9725,11 @@ const SCEV *ScalarEvolution::computeBECo
   return getUDivExpr(Delta, Step);
 }
 
-const SCEV *ScalarEvolution::computeMaxBECount(const SCEV *Start,
-                                               const SCEV *Stride,
-                                               const SCEV *End,
-                                               unsigned BitWidth,
-                                               bool IsSigned) {
+const SCEV *ScalarEvolution::computeMaxBECountForLT(const SCEV *Start,
+                                                    const SCEV *Stride,
+                                                    const SCEV *End,
+                                                    unsigned BitWidth,
+                                                    bool IsSigned) {
 
   assert(!isKnownNonPositive(Stride) &&
          "Stride is expected strictly positive!");
@@ -9861,7 +9861,7 @@ ScalarEvolution::howManyLessThans(const
   // bound of the loop (RHS), and the fact that IV does not overflow (which is
   // checked above).
   if (!isLoopInvariant(RHS, L)) {
-    const SCEV *MaxBECount = computeMaxBECount(
+    const SCEV *MaxBECount = computeMaxBECountForLT(
         Start, Stride, RHS, getTypeSizeInBits(LHS->getType()), IsSigned);
     return ExitLimit(getCouldNotCompute() /* ExactNotTaken */, MaxBECount,
                      false /*MaxOrZero*/, Predicates);
@@ -9898,8 +9898,8 @@ ScalarEvolution::howManyLessThans(const
     MaxBECount = BECountIfBackedgeTaken;
     MaxOrZero = true;
   } else {
-    MaxBECount = computeMaxBECount(Start, Stride, RHS,
-                                   getTypeSizeInBits(LHS->getType()), IsSigned);
+    MaxBECount = computeMaxBECountForLT(
+        Start, Stride, RHS, getTypeSizeInBits(LHS->getType()), IsSigned);
   }
 
   if (isa<SCEVCouldNotCompute>(MaxBECount) &&




More information about the llvm-commits mailing list