Skip to content

Commit 4bf9e8a

Browse files
committed
Use !ICmpInst::isSigned
1 parent 9fee32d commit 4bf9e8a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3274,9 +3274,7 @@ static Value *simplifyICmpWithBinOpOnLHS(CmpPredicate Pred, BinaryOperator *LBO,
32743274
static bool trySimplifyICmpWithAdds(CmpPredicate Pred, Value *LHS, Value *RHS,
32753275
const InstrInfoQuery &IIQ) {
32763276
// TODO: support other predicates.
3277-
if ((Pred != CmpInst::ICMP_SLT && Pred != CmpInst::ICMP_SGT &&
3278-
Pred != CmpInst::ICMP_SLE && Pred != CmpInst::ICMP_SGE) ||
3279-
!IIQ.UseInstrInfo)
3277+
if (!ICmpInst::isSigned(Pred) || !IIQ.UseInstrInfo)
32803278
return false;
32813279

32823280
// Canonicalize nsw add as RHS.

0 commit comments

Comments
 (0)