[llvm-commits] [llvm] r93007 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
Chris Lattner
sabre at nondot.org
Fri Jan 8 09:48:19 PST 2010
Author: lattner
Date: Fri Jan 8 11:48:19 2010
New Revision: 93007
URL: http://llvm.org/viewvc/llvm-project?rev=93007&view=rev
Log:
tidy up some stuff duncan pointed out.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=93007&r1=93006&r2=93007&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Fri Jan 8 11:48:19 2010
@@ -705,7 +705,7 @@
// so the values can never be equal. Similiarly for all other "or equals"
// operators.
- // (X+1) <u X --> X >u (MAXUINT-1) --> X != 255
+ // (X+1) <u X --> X >u (MAXUINT-1) --> X == 255
// (X+2) <u X --> X >u (MAXUINT-2) --> X > 253
// (X+MAXUINT) <u X --> X >u (MAXUINT-MAXUINT) --> X != 0
if (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_ULE) {
@@ -713,7 +713,8 @@
if (isNUW)
return ReplaceInstUsesWith(ICI, ConstantInt::getFalse(X->getContext()));
- Value *R = ConstantExpr::getSub(ConstantInt::get(CI->getType(), -1ULL), CI);
+ Value *R =
+ ConstantExpr::getSub(ConstantInt::getAllOnesValue(CI->getType()), CI);
return new ICmpInst(ICmpInst::ICMP_UGT, X, R);
}
More information about the llvm-commits
mailing list