[llvm] r178409 - Implement XOR reassociation. It is based on following rules:
Duncan Sands
baldrick at free.fr
Sat Mar 30 02:29:41 PDT 2013
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.
More information about the llvm-commits
mailing list