Optimize the memory usage of MC bundling, by creating a new type of fragment
authorEli Bendersky <eliben@google.com>
Tue, 15 Jan 2013 23:22:09 +0000 (23:22 +0000)
committerEli Bendersky <eliben@google.com>
Tue, 15 Jan 2013 23:22:09 +0000 (23:22 +0000)
commit9ccb76998f741a7d3f0f217392a783dfb99c6e87
tree4f87f004af99d84cd1e61b3fbb2b5814441feba0
parent1c99a7f4892a24eb227802e042917d05d8cd415f
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172572 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCAssembler.h
lib/MC/MCAssembler.cpp
lib/MC/MCELFStreamer.cpp