[PATCH] InstCombineCompare with constant return false if we know it is never going to be equal

suyog sarda sardask01 at gmail.com
Fri May 30 12:53:25 PDT 2014


Thanks Duncan for your valuable suggestion.

I got your point, i will update the patch and add test cases for the same.

Thanks a lot.


On Fri, May 30, 2014 at 7:13 PM, Duncan Sands <duncan.sands at gmail.com>
wrote:

> Hi Suyog,
>
>
> On 30/05/14 15:01, suyog wrote:
>
>> Gentle Ping !!
>>
>> http://reviews.llvm.org/D3868
>>
>
> I only glanced at this but it seems much less general than it could be.
>
> Suppose you are analysing icmp eq A, B
>
> Let A_Known_Zero and A_Known_One give the bits of A that are known to be
> zero/one.  Likewise B_Known_Zero and B_Known_One for B.
>
> If a bit is known to be zero for A and known to be one for B then A and B
> cannot be equal.  Likewise, if a bit if known to be one for A and known to
> be zero for B then A != B.
>
> Thus, if A_Known_Zero & B_Known_One != 0 then A != B.  Same if A_Known_One
> & B_Known_Zero != 0.
>
> I think this covers your case and many more.
>
> Ciao, Duncan.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
With regards,
Suyog Sarda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140531/263e47ef/attachment.html>


More information about the llvm-commits mailing list