[llvm-commits] [PATCH] Shrink MachineOperand from 40 to 32 bytes

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Oct 19 10:20:50 PDT 2010


Hi,

The attached patch shrinks MachineOperand from 40 to 32 bytes on 64-bit hosts.

The Contents union contains pointers, so it becomes 8-byte aligned. That creates padding because the largest member has two pointers and an unsigned.

The patch moves the unsigned outside the union in a way that makes it pack optimally on both 32-bit and 64-bit hosts.

It is a bit icky, so I wanted your opinions before committing.

I measured a (statistically significant) 0.8% speedup of code generation on 64-bit Darwin with the patch applied.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MachineOperand.patch
Type: application/octet-stream
Size: 3810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101019/977d276f/attachment.obj>


More information about the llvm-commits mailing list