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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2013-08-16 17:03:36 +00:00
parent b89f197713
commit bff3c587f6

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);