[llvm] r178409 - Implement XOR reassociation. It is based on following rules:
Shuxin Yang
shuxin.llvm at gmail.com
Sat Mar 30 09:32:03 PDT 2013
No, Instcombine can only handle rule 1 (when c1 = c2). I will fire a
enhancement ticket for instcombine
when I return back to office.
On 3/30/13 2:29 AM, Duncan Sands wrote:
> Hi Shuxin,
>
>> 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
>
> does instcombine know these rules too? The disadvantage of
> instcombine is that
> it only works locally, however it is run more often than reassociate,
> so maybe
> implementing them in instcombine too is a win.
>
> Ciao, Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list