aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index c1c38c6..5393be0 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -7913,6 +7913,10 @@ static bool isTruePredicate(CmpInst::Predicate Pred, const Value *LHS,
if (match(RHS, m_NUWAdd(m_Specific(LHS), m_APInt(C))))
return true;
+ // RHS >> V u<= RHS for any V
+ if (match(LHS, m_LShr(m_Specific(RHS), m_Value())))
+ return true;
+
// Match A to (X +_{nuw} CA) and B to (X +_{nuw} CB)
auto MatchNUWAddsToSameValue = [&](const Value *A, const Value *B,
const Value *&X,