diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 40a8f6a155b23..b3feb2470e58e 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -3916,12 +3916,14 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS, // is non-negative then LHS getType())); + return ConstantFoldCompareInstOperands( + ICmpInst::ICMP_SLT, C, Constant::getNullValue(C->getType()), + Q.DL); case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_SLE: - return ConstantExpr::getICmp(ICmpInst::ICMP_SGE, C, - Constant::getNullValue(C->getType())); + return ConstantFoldCompareInstOperands( + ICmpInst::ICMP_SGE, C, Constant::getNullValue(C->getType()), + Q.DL); } } }