diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 3dc9f3a1037..f4824aebe52 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4109,12 +4109,12 @@ static bool isTruePredicate(CmpInst::Predicate Pred, Value *LHS, Value *RHS) { case CmpInst::ICMP_ULE: { ConstantInt *CI; - // LHS u< LHS +_{nuw} C if C > 0 - // LHS u<= LHS +_{nuw} C if C >= 0 + // LHS u< LHS +_{nuw} C if C != 0 + // LHS u<= LHS +_{nuw} C if (match(RHS, m_NUWAdd(m_Specific(LHS), m_ConstantInt(CI)))) { if (Pred == CmpInst::ICMP_ULT) - return CI->getValue().isStrictlyPositive(); - return !CI->isNegative(); + return !CI->isZero(); + return true; } return false; } |