[llvm] r178409 - Implement XOR reassociation. It is based on following rules:

Stephen Canon scanon at apple.com
Sat Mar 30 07:11:11 PDT 2013


On Mar 29, 2013, at 10:15 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:

> Author: shuxin_yang
> Date: Fri Mar 29 21:15:01 2013
> New Revision: 178409
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=178409&view=rev
> Log:
> Implement XOR reassociation. It is based on following rules:
> 
>  rule 1: (x | c1) ^ c2 => (x & ~c1) ^ (c1^c2),
>     only useful when c1=c2
>  rule 2: (x & c1) ^ (x & c2) = (x & (c1^c2))
>  rule 3: (x | c1) ^ (x | c2) = (x & c3) ^ c3 where c3 = c1 ^ c2
>  rule 4: (x | c1) ^ (x & c2) => (x & c3) ^ c1, where c3 = ~c1 ^ c2

We can do better for rule 3.  It simplifies to (~x & c3).

- Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130330/449a56d9/attachment.html>


More information about the llvm-commits mailing list