InstCombine: Use isAllOnesValue() instead of explicit -1.
authorJim Grosbach <grosbach@apple.com>
Fri, 16 Aug 2013 17:03:36 +0000 (17:03 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 16 Aug 2013 17:03:36 +0000 (17:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188563 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

index bc8506a53843d3797925c4797e83b52cdad7948c..d40385c08095a49f65de678e2b5691090a4d742f 100644 (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);