Skip to content

Commit

Permalink
[InstSimplify] Avoid use of ConstantExpr::getICmp. NFC (#67873)
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Sep 30, 2023
1 parent 8580010 commit a5686c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3916,12 +3916,14 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
// is non-negative then LHS <s RHS.
case ICmpInst::ICMP_SGT:
case ICmpInst::ICMP_SGE:
return ConstantExpr::getICmp(ICmpInst::ICMP_SLT, C,
Constant::getNullValue(C->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);
}
}
}
Expand Down

0 comments on commit a5686c2

Please sign in to comment.