llvm-project/lld/MachO
Jez Ng f6b6e72143 [lld-macho] Factor out common InputSection members
We have been creating many ConcatInputSections with identical values due
to .subsections_via_symbols. This diff factors out the identical values
into a Shared struct, to reduce memory consumption and make copying
cheaper.

I also changed `callSiteCount` from a uint32_t to a 31-bit field to save an
extra word.

All in all, this takes InputSection from 120 to 72 bytes (and
ConcatInputSection from 160 to 112 bytes), i.e. 30% size reduction in
ConcatInputSection.

Numbers for linking chromium_framework on my 3.2 GHz 16-Core Intel Xeon W:

      N           Min           Max        Median           Avg        Stddev
  x  20          4.14          4.24          4.18         4.183   0.027548999
  +  20          4.04          4.11         4.075        4.0775   0.018027756
  Difference at 95.0% confidence
          -0.1055 +/- 0.0149005
          -2.52211% +/- 0.356215%
          (Student's t, pooled s = 0.0232803)

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D105305
2021-07-01 21:22:39 -04:00
..
Arch [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
CMakeLists.txt [lld-macho] Implement ICF 2021-06-17 10:07:44 -07:00
ConcatOutputSection.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
ConcatOutputSection.h [lld-macho] Move ICF earlier to avoid emitting redundant binds 2021-07-01 21:22:38 -04:00
Config.h [lld-macho] Add support for LTO optimization level 2021-07-01 15:01:59 -04:00
Driver.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
Driver.h Revert "[lld-macho] Have path-related functions return std::string, not StringRef" 2021-06-18 22:43:49 -04:00
DriverUtils.cpp [OptTable] Rename PrintHelp to printHelp 2021-06-24 14:47:03 -07:00
Dwarf.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
Dwarf.h [lld-macho] Emit STABS symbols for debugging, and drop debug sections 2020-12-01 15:05:20 -08:00
ExportTrie.cpp [lld-macho][NFC] add const to pointer/reference induction variables of range-based for loops 2021-03-10 12:07:31 -08:00
ExportTrie.h [lld-macho] Export trie addresses should be relative to the image base 2020-09-20 20:43:15 -07:00
ICF.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
ICF.h [lld-macho] Move ICF earlier to avoid emitting redundant binds 2021-07-01 21:22:38 -04:00
InputFiles.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
InputFiles.h [lld][MachO] Add support for LC_DATA_IN_CODE 2021-06-14 19:21:59 -07:00
InputSection.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
InputSection.h [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
LTO.cpp [lld-macho] Add support for LTO optimization level 2021-07-01 15:01:59 -04:00
LTO.h [lld-macho] Add very basic support for LTO 2020-11-10 12:19:28 -08:00
MachOStructs.h [lld-macho] Add support for arm64_32 2021-04-15 21:16:33 -04:00
MapFile.cpp [lld][MachO] Sort symbols in parallel in -map 2021-06-17 10:19:59 +08:00
MapFile.h [lld-macho] implement options -map 2021-03-18 10:39:19 -04:00
MarkLive.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
MarkLive.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
ObjC.cpp [lld-macho] De-templatize mach_header operations 2021-05-03 18:31:23 -04:00
ObjC.h [lld-macho] Implement -ObjC 2020-08-26 19:20:55 -07:00
Options.td [lld-macho] Add support for LTO optimization level 2021-07-01 15:01:59 -04:00
OutputSection.cpp [lld-macho] Refactor segment/section creation, sorting, and merging 2020-06-21 17:13:59 -07:00
OutputSection.h [lld-macho] Have inputOrder default to less than INT_MAX 2021-06-20 19:49:27 -04:00
OutputSegment.cpp [lld/mac] Fix nondeterminism in output section ordering 2021-06-28 18:41:33 -04:00
OutputSegment.h [lld-macho] Have inputOrder default to less than INT_MAX 2021-06-20 19:49:27 -04:00
Relocations.cpp [lld-macho][nfc] Remove DYSYM8 reloc attribute 2021-04-09 19:48:08 -04:00
Relocations.h [lld-macho] Add 32-bit compact unwind support 2021-04-15 21:16:33 -04:00
SymbolTable.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
SymbolTable.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
Symbols.cpp [lld-macho] Implement ICF 2021-06-17 10:07:44 -07:00
Symbols.h [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
SyntheticSections.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
SyntheticSections.h [lld-macho][nfc] Remove unnecessary vertical spacing 2021-07-01 21:22:38 -04:00
Target.cpp [lld-macho][nfc] Create Relocations.{h,cpp} for relocation-specific code 2021-03-11 13:28:09 -05:00
Target.h [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
UnwindInfoSection.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
UnwindInfoSection.h [lld-macho] Move ICF earlier to avoid emitting redundant binds 2021-07-01 21:22:38 -04:00
Writer.cpp [lld-macho] Factor out common InputSection members 2021-07-01 21:22:39 -04:00
Writer.h [lld-macho] -section_rename should work on synthetic sections too 2021-06-30 18:55:48 -04:00