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.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index ec05fa9..1a15ad4 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -8144,12 +8144,26 @@ isImpliedCondOperands(CmpInst::Predicate Pred, const Value *ALHS,
return true;
return std::nullopt;
+ case CmpInst::ICMP_SGT:
+ case CmpInst::ICMP_SGE:
+ if (isTruePredicate(CmpInst::ICMP_SLE, ALHS, BLHS, DL, Depth) &&
+ isTruePredicate(CmpInst::ICMP_SLE, BRHS, ARHS, DL, Depth))
+ return true;
+ return std::nullopt;
+
case CmpInst::ICMP_ULT:
case CmpInst::ICMP_ULE:
if (isTruePredicate(CmpInst::ICMP_ULE, BLHS, ALHS, DL, Depth) &&
isTruePredicate(CmpInst::ICMP_ULE, ARHS, BRHS, DL, Depth))
return true;
return std::nullopt;
+
+ case CmpInst::ICMP_UGT:
+ case CmpInst::ICMP_UGE:
+ if (isTruePredicate(CmpInst::ICMP_ULE, ALHS, BLHS, DL, Depth) &&
+ isTruePredicate(CmpInst::ICMP_ULE, BRHS, ARHS, DL, Depth))
+ return true;
+ return std::nullopt;
}
}