[PATCH] Remove copies of MCSubtargetInfo from MCRelaxableFragment

Duncan P. N. Exon Smith dexonsmith at apple.com
Wed Jul 8 17:30:08 PDT 2015


Last I checked my `-g -flto` workload, `MCRelaxableFragment` was taking
up 4.7% of the heap during LTO.  Since these aren't debug info related,
the relative cost is even higher without `-g` (I figure 10% or so?).
The struct layout contained a shock: over half of
`sizeof(MCRelaxableFragment)` comes from a local copy (!?) of
`MCSubtargetInfo`.

It was more roundabout than I expected to fix, but this patch series
does it.  0001 removes the copy of `MCSchedModel` from
`MCSubtargetInfo`, 0002-0004 change the `MCSubtargetInfo` API to prove
that only the feature bits get mutated, and 0005 moves the copies of
`MCSubtargetInfo` to a cache in `MCContext`.

I'd love a pre-commit sanity check from someone for two of these:
  - 0001 (the object for `MCSchedModel::GetDefaultMCSubtarget()` doesn't
    need to be defined in the header for some reason, does it?) and
  - 0003 (I'm touching *all* the targets...)

and I've provided the rest of the series (and a combined all.patch) for
context.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-MC-Remove-the-copy-of-MCSchedModel-in-MCSubtargetInf.patch
Type: application/octet-stream
Size: 6698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/46d55b20/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-MC-Remove-MCSubtargetInfo-InitCPUSched.patch
Type: application/octet-stream
Size: 3231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/46d55b20/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-MC-Remove-MCSubtargetInfo-default-constructor.patch
Type: application/octet-stream
Size: 17874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/46d55b20/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-MC-Only-allow-changing-feature-bits-in-MCSubtargetIn.patch
Type: application/octet-stream
Size: 4475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/46d55b20/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-MC-Remove-the-copy-of-STI-in-MCRelaxableFragment.patch
Type: application/octet-stream
Size: 8990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/46d55b20/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: all.patch
Type: application/octet-stream
Size: 32016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150708/46d55b20/attachment-0005.obj>


More information about the llvm-commits mailing list