[PATCH] Move transforms from InstCombine to InstSimplify
David Majnemer
david.majnemer at gmail.com
Fri Jul 26 13:05:03 PDT 2013
Ping
On Fri, Jul 12, 2013 at 2:56 PM, David Majnemer <david.majnemer at gmail.com>wrote:
> On Thu, Jul 11, 2013 at 10:42 PM, Duncan Sands <duncan.sands at gmail.com>wrote:
>
>> Hi David,
>>
>>
>> + } else {
>>> + // 'shl CI2, x' produces [CI2, CI2 << (Width-1)]
>>> + Lower = CI2Value;
>>> + Upper = CI2Value.shl(Width - 1) + 1;
>>>
>>>
>>> this one seems wrong to me. Consider for example CI2 (in binary)
>>> equal to
>>> 10001000
>>> Then Lower=10001000, Upper=00000001, but a left-shift by 1 of CI2 is
>>> 00010000 which is not in the range Lower .. Upper.
>>>
>>>
>>> Thanks, I've updated the patch so that we will set Lower to zero and
>>> Upper to
>>> CI2 << CLZ(CI2) which is conservative but, AFAIK, correct.
>>>
>>
>> are you sure?
>>
>> 10110000
>>
>> Lower = 0, Upper = 10110000, but shifting left by two gives 11000000
>> which is
>> out of the range.
>>
>
> Right again. I'm giving up on the general case, at least for now.
>
>
>>
>> Ciao, Duncan.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130726/3cf93a4e/attachment.html>
More information about the llvm-commits
mailing list