Skip to content

Commit a5686c2

Browse files
authored
[InstSimplify] Avoid use of ConstantExpr::getICmp. NFC (#67873)
1 parent 8580010 commit a5686c2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3916,12 +3916,14 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
39163916
// is non-negative then LHS <s RHS.
39173917
case ICmpInst::ICMP_SGT:
39183918
case ICmpInst::ICMP_SGE:
3919-
return ConstantExpr::getICmp(ICmpInst::ICMP_SLT, C,
3920-
Constant::getNullValue(C->getType()));
3919+
return ConstantFoldCompareInstOperands(
3920+
ICmpInst::ICMP_SLT, C, Constant::getNullValue(C->getType()),
3921+
Q.DL);
39213922
case ICmpInst::ICMP_SLT:
39223923
case ICmpInst::ICMP_SLE:
3923-
return ConstantExpr::getICmp(ICmpInst::ICMP_SGE, C,
3924-
Constant::getNullValue(C->getType()));
3924+
return ConstantFoldCompareInstOperands(
3925+
ICmpInst::ICMP_SGE, C, Constant::getNullValue(C->getType()),
3926+
Q.DL);
39253927
}
39263928
}
39273929
}

0 commit comments

Comments
 (0)