InstCombine: Use isAllOnesValue() instead of explicit -1.

llvm-svn: 188563
This commit is contained in:
Jim Grosbach 2013-08-16 17:03:36 +00:00
parent 65d5ad5728
commit 933ecf8022

View File

@ -851,7 +851,7 @@ Value *InstCombiner::FoldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
case ICmpInst::ICMP_NE:
// Special case to get the ordering right when the values wrap around
// zero.
if (LHSCst->getValue() == 0 && RHSCst->getValue() == -1)
if (LHSCst->getValue() == 0 && RHSCst->getValue().isAllOnesValue())
std::swap(LHSCst, RHSCst);
if (LHSCst == SubOne(RHSCst)){// (X != 13 & X != 14) -> X-13 >u 1
Constant *AddCST = ConstantExpr::getNeg(LHSCst);