Indeed, i've marked it as commutable:
let isCommutable = 1,
isTwoAddress = 1 in
def XORRdRr : FRdRr<0b0010,
0b01,
(outs GPR8:$dst),
(ins GPR8:$src1, GPR8:$src2),
"xor\t$dst, $src2",
[(set GPR8:$dst, (xor GPR8:$src1, GPR8:$src2))]>;
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100904/60166a0b/attachment.html>
On Sep 4, 2010, at 11:21 AM, Borja Ferrer wrote:> I've noticed this pattern happening with other operators aswell, but used xor in this example. As i said before, i tried with different register allocation orders, but it will produce always the same result. GCC is emitting longer code, but since LLVM is so nearer to the optimal code sequence i wanted to reach it.In LLVM, copies are coalesced away as much as possible before registers are allocated, so the allocation order wouldn't affect it. Try looking at the output of -debug-only=regcoalescing to see what is going wrong. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1929 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100904/f9ef1c08/attachment.bin>