[llvm] r188563 - InstCombine: Use isAllOnesValue() instead of explicit -1.
Jim Grosbach
grosbach at apple.com
Fri Aug 16 10:03:36 PDT 2013
Author: grosbach
Date: Fri Aug 16 12:03:36 2013
New Revision: 188563
URL: http://llvm.org/viewvc/llvm-project?rev=188563&view=rev
Log:
InstCombine: Use isAllOnesValue() instead of explicit -1.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=188563&r1=188562&r2=188563&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Fri Aug 16 12:03:36 2013
@@ -851,7 +851,7 @@ Value *InstCombiner::FoldAndOfICmps(ICmp
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);
More information about the llvm-commits
mailing list