[llvm-commits] [PATCH] Shrink MachineOperand from 40 to 32 bytes
Bob Wilson
bob.wilson at apple.com
Tue Oct 19 10:42:22 PDT 2010
You could make it marginally less icky by making UnsignedContents into a separate union with RegNo and OffsetLo members.
Besides the speedup you measured, this should also help memory usage, so I agree that it's worth putting up with some ickiness.
On Oct 19, 2010, at 10:20 AM, Jakob Stoklund Olesen wrote:
> 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.
>
> <MachineOperand.patch>_______________________________________________
> 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