[llvm] c019099 - [IndVars] Use contextual knowledge when proving trivial conds

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 25 23:48:58 PDT 2020


Author: Max Kazantsev
Date: 2020-10-26T13:48:32+07:00
New Revision: c019099053c147c6fb924a88e30c0993144ce22e

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

LOG: [IndVars] Use contextual knowledge when proving trivial conds

No exact example where it would help, but it's a generally a more
powerful way to prove predicates.

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 5a7b4e976b50..30f8f11f81a7 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2332,7 +2332,7 @@ static bool isTrivialCond(const Loop *L, BranchInst *BI, ScalarEvolution *SE,
   const SCEV *LHSS = SE->getSCEVAtScope(LHS, L);
   const SCEV *RHSS = SE->getSCEVAtScope(RHS, L);
   // Can we prove it to be trivially true?
-  if (SE->isKnownPredicate(Pred, LHSS, RHSS))
+  if (SE->isKnownPredicateAt(Pred, LHSS, RHSS, BI))
     return true;
 
   return false;


        


More information about the llvm-commits mailing list