Skip to content

Commit 98efe55

Browse files
committed
VT: use CmpPredicate::getMatching; address review
1 parent 589afe8 commit 98efe55

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9495,8 +9495,8 @@ isImpliedCondICmps(const ICmpInst *LHS, CmpPredicate RPred, const Value *R0,
94959495
// must be positive if X >= Y and no overflow".
94969496
// Take SGT as an example: L0:x > L1:y and C >= 0
94979497
// ==> R0:(x -nsw y) < R1:(-C) is false
9498-
if ((ICmpInst::isSigned(LPred) || LPred.hasSameSign()) &&
9499-
(ICmpInst::isGE(LPred) || ICmpInst::isGT(LPred)) &&
9498+
if ((CmpPredicate::getMatching(LPred, ICmpInst::ICMP_SGT) ||
9499+
CmpPredicate::getMatching(LPred, ICmpInst::ICMP_SGE)) &&
95009500
match(R0, m_NSWSub(m_Specific(L0), m_Specific(L1)))) {
95019501
if (match(R1, m_NonPositive()) &&
95029502
isImpliedCondMatchingOperands(LPred, RPred) == false)
@@ -9505,8 +9505,8 @@ isImpliedCondICmps(const ICmpInst *LHS, CmpPredicate RPred, const Value *R0,
95059505

95069506
// Take SLT as an example: L0:x < L1:y and C <= 0
95079507
// ==> R0:(x -nsw y) < R1:(-C) is true
9508-
if ((ICmpInst::isSigned(LPred) || LPred.hasSameSign()) &&
9509-
(ICmpInst::isLE(LPred) || ICmpInst::isLT(LPred)) &&
9508+
if ((CmpPredicate::getMatching(LPred, ICmpInst::ICMP_SLT) ||
9509+
CmpPredicate::getMatching(LPred, ICmpInst::ICMP_SLE)) &&
95109510
match(R0, m_NSWSub(m_Specific(L0), m_Specific(L1)))) {
95119511
if (match(R1, m_NonNegative()) &&
95129512
isImpliedCondMatchingOperands(LPred, RPred) == true)

0 commit comments

Comments
 (0)