[llvm-commits] [llvm] r122183 - in /llvm/trunk/lib/Transforms/InstCombine: InstCombineCalls.cpp InstructionCombining.cpp
Chris Lattner
sabre at nondot.org
Sun Dec 19 15:26:57 PST 2010
On Dec 19, 2010, at 3:20 PM, Frits van Bommel wrote:
>>
>> +
>> + // If the normal result of the add is dead, and the RHS is a constant,
>> + // we can transform this into a range comparison.
>> + // overflow = uadd a, -4 --> overflow = icmp ugt a, 3
>> + if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getArgOperand(1)))
>> + return new ICmpInst(ICmpInst::ICMP_UGT, II->getArgOperand(0),
>> + ConstantExpr::getNot(CI));
>
> this also runs on sadd.with.overflow(). This seems fishy to me.
> Shouldn't you at least use a different predicate for that one?
You're absolutely right, that was an oversight on my part. Fixed in r122204, thanks a lot for catching this!
-Chris
More information about the llvm-commits
mailing list