Skip to content

Commit 041218b

Browse files
committed
[ValueTracking] Use the isSignBitCheck helper.
1 parent 57ec61d commit 041218b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4285,11 +4285,7 @@ static void computeKnownFPClassFromCond(const Value *V, Value *Cond,
42854285
} else if (match(Cond, m_ICmp(Pred, m_ElementWiseBitCast(m_Value(LHS)),
42864286
m_APInt(RHS)))) {
42874287
bool TrueIfSigned;
4288-
if (Pred == ICmpInst::ICMP_SLT && RHS->isZero())
4289-
TrueIfSigned = true;
4290-
else if (Pred == ICmpInst::ICMP_SGT && RHS->isAllOnes())
4291-
TrueIfSigned = false;
4292-
else
4288+
if (!isSignBitCheck(Pred, *RHS, TrueIfSigned))
42934289
return;
42944290
if (TrueIfSigned == CondIsTrue)
42954291
KnownFromContext.signBitMustBeOne();

0 commit comments

Comments
 (0)