[llvm-commits] [PATCH] Optimize memory usage of MC bundling

Eli Bendersky eliben at google.com
Wed Jan 9 11:18:09 PST 2013


Hi grosbach, dschuff,

Optimize the memory usage of MC bundling, by creating a new type of fragment into which we can emit single instructions without fixups (which is most instructions). This is an optimization required because MCDataFragment is prety large (240 bytes on x64), with no change in functionality.

For large programs, this reduces memory usage overhead required for bundling by 40%.

To make the code as palatable as possible, the MCEncodedFragment interface was further fragmented (no pun intended) and MCEncodedFragmentWithFixups is used as the interface to work against when the user expects fixups. MCDataFragment and MCRelaxableFragment implement this interface,  while the new MCCompactEncodedInstFragment implements MCEncodeFragment. Here's a UML-ish diagram describing the new inheritance tree:

http://yuml.me/2d5bb867

Note: the name MCCompactEncodedInstFragment is not perfect, but the best I could come up with. It errs on the side of explicitness, but I hope it conveys its goal clearly. Suggestions for better names are most welcome.


http://llvm-reviews.chandlerc.com/D270

Files:
  include/llvm/MC/MCAssembler.h
  lib/MC/MCAssembler.cpp
  lib/MC/MCELFStreamer.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D270.1.patch
Type: text/x-patch
Size: 10254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130109/d26842c9/attachment.bin>


More information about the llvm-commits mailing list