[llvm] r259400 - [SCEV] Rename isKnownPredicateWithRanges; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 12:48:10 PST 2016


Author: sanjoy
Date: Mon Feb  1 14:48:10 2016
New Revision: 259400

URL: http://llvm.org/viewvc/llvm-project?rev=259400&view=rev
Log:
[SCEV] Rename isKnownPredicateWithRanges; NFC

Make it obvious that it uses constant ranges, and use `Via` instead of
`With`, like other similar functions in SCEV.

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=259400&r1=259399&r2=259400&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Feb  1 14:48:10 2016
@@ -733,8 +733,8 @@ namespace llvm {
     /// Test if the given expression is known to satisfy the condition described
     /// by Pred and the known constant ranges of LHS and RHS.
     ///
-    bool isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
-                                    const SCEV *LHS, const SCEV *RHS);
+    bool isKnownPredicateViaConstantRanges(ICmpInst::Predicate Pred,
+                                           const SCEV *LHS, const SCEV *RHS);
 
     /// Try to prove the condition described by "LHS Pred RHS" by ruling out
     /// integer overflow.

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=259400&r1=259399&r2=259400&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Feb  1 14:48:10 2016
@@ -7131,7 +7131,7 @@ bool ScalarEvolution::isKnownPredicate(I
     return true;
 
   // Otherwise see what can be done with known constant ranges.
-  return isKnownPredicateWithRanges(Pred, LHS, RHS);
+  return isKnownPredicateViaConstantRanges(Pred, LHS, RHS);
 }
 
 bool ScalarEvolution::isMonotonicPredicate(const SCEVAddRecExpr *LHS,
@@ -7261,9 +7261,8 @@ bool ScalarEvolution::isLoopInvariantPre
   return true;
 }
 
-bool
-ScalarEvolution::isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
-                                            const SCEV *LHS, const SCEV *RHS) {
+bool ScalarEvolution::isKnownPredicateViaConstantRanges(
+    ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS) {
   if (HasSameValue(LHS, RHS))
     return ICmpInst::isTrueWhenEqual(Pred);
 
@@ -7424,7 +7423,8 @@ ScalarEvolution::isLoopBackedgeGuardedBy
   // (interprocedural conditions notwithstanding).
   if (!L) return true;
 
-  if (isKnownPredicateWithRanges(Pred, LHS, RHS)) return true;
+  if (isKnownPredicateViaConstantRanges(Pred, LHS, RHS))
+    return true;
 
   BasicBlock *Latch = L->getLoopLatch();
   if (!Latch)
@@ -7526,7 +7526,8 @@ ScalarEvolution::isLoopEntryGuardedByCon
   // (interprocedural conditions notwithstanding).
   if (!L) return false;
 
-  if (isKnownPredicateWithRanges(Pred, LHS, RHS)) return true;
+  if (isKnownPredicateViaConstantRanges(Pred, LHS, RHS))
+    return true;
 
   // Starting at the loop predecessor, climb up the predecessor chain, as long
   // as there are predecessors that can be found that have unique successors
@@ -8044,7 +8045,7 @@ ScalarEvolution::isImpliedCondOperandsHe
                                              const SCEV *FoundRHS) {
   auto IsKnownPredicateFull =
       [this](ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS) {
-    return isKnownPredicateWithRanges(Pred, LHS, RHS) ||
+    return isKnownPredicateViaConstantRanges(Pred, LHS, RHS) ||
            IsKnownPredicateViaMinOrMax(*this, Pred, LHS, RHS) ||
            IsKnownPredicateViaAddRecStart(*this, Pred, LHS, RHS) ||
            isKnownPredicateViaNoOverflow(Pred, LHS, RHS);




More information about the llvm-commits mailing list