[llvm-commits] [llvm] r89639 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/compare-signs.ll
Nick Lewycky
nicholas at mxc.ca
Mon Nov 23 21:49:22 PST 2009
Chris Lattner wrote:
>
> On Nov 23, 2009, at 12:33 AM, Duncan Sands wrote:
>
>>>>> + if (KnownZeroLHS.countLeadingOnes() == BitWidth-1&&
>>>>> + KnownZeroRHS.countLeadingOnes() == BitWidth-1) {
>>>>
>>>> == -> >= :)
>>>
>>> Nope, look again!
>>>
>>> + APInt TypeMask(APInt::getHighBitsSet(BitWidth, BitWidth-1));
>>>
>>> Thus, it will never return a knownzero with all bits set. :)
>>
>> Ha ha, you got me there!
>
> Please add a comment. Obviously it isn't clear what is going on here.
Sorry Chris, but I don't think a comment would do anything but confuse
people further. A reader who wasn't thinking of the earlier version of
the patch that behaved differently wouldn't be asking this question.
Also, the issue Duncan raised is one of possible missed optimization,
not correctness. It addressed handling the case where the comparison is
with a constant, but those should be getting optimized away elsewhere
anyways.
Nick
PS. Of course, if you were to tell me to stop arguing and just add a
damned comment, I will.
More information about the llvm-commits
mailing list