llvm-project/lld/COFF
Reid Kleckner 01b5f52140 [COFF] Add a fastpath for /INCLUDE: in .drective sections
This speeds up linking chrome.dll with PGO instrumentation by 13%
(154271ms -> 134033ms).

LLVM's Option library is very slow. In particular, it allocates at least
one large-ish heap object (Arg) for every argument. When PGO
instrumentation is enabled, all the __profd_* symbols are added to the
@llvm.used list, which compiles down to these /INCLUDE: directives. This
means we have O(#symbols) directives to parse in the section, so we end
up allocating an Arg for every function symbol in the object file. This
is unnecessary.

To address the issue and speed up the link, extend the fast path that we
already have for /EXPORT:, which has similar scaling issues.

I promise that I took a hard look at optimizing the Option library, but
its data structures are very general and would need a lot of cleanup. We
have accumulated lots of optional features (option groups, aliases,
multiple values) over the years, and these are now properties of every
parsed argument, when the vast majority of arguments do not use these
features.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D78845
2020-04-28 10:35:57 -07:00
..
CMakeLists.txt [lld-link] Support /map option, matching link.exe 's /map output format 2020-03-24 09:48:00 -04:00
Chunks.cpp [COFF] Rename variale references in comments after VariableName -> variableName change 2019-07-16 08:26:38 +00:00
Chunks.h [LLD] [COFF] Fix alignment of thunks for ARM/ARM64 2020-04-13 23:27:15 +03:00
Config.h [ms] Add new /PDBSTREAM option to lld-link allowing injection of streams into PDB files. 2020-04-07 16:19:38 -04:00
DLL.cpp [LLD] [COFF] Fix alignment of thunks for ARM/ARM64 2020-04-13 23:27:15 +03:00
DLL.h [COFF] Share the tail in delayimport symbol thunks 2019-07-11 21:19:11 +00:00
DebugTypes.cpp Remove namespace lld { namespace coff { from COFF LLD cpp files 2020-02-25 17:30:53 -08:00
DebugTypes.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
Driver.cpp [COFF] Add a fastpath for /INCLUDE: in .drective sections 2020-04-28 10:35:57 -07:00
Driver.h [COFF] Add a fastpath for /INCLUDE: in .drective sections 2020-04-28 10:35:57 -07:00
DriverUtils.cpp [COFF] Add a fastpath for /INCLUDE: in .drective sections 2020-04-28 10:35:57 -07:00
ICF.cpp dummy comment typo fix commit to cycle the bots 2019-10-10 02:04:56 +00:00
ICF.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
InputFiles.cpp Make helpers static. NFC. 2020-04-03 12:48:25 +02:00
InputFiles.h [COFF] Avoid CodeView include in header 2019-11-14 14:27:48 -08:00
LLDMapFile.cpp [lld-link] Support /map option, matching link.exe 's /map output format 2020-03-24 09:48:00 -04:00
LLDMapFile.h [lld-link] Support /map option, matching link.exe 's /map output format 2020-03-24 09:48:00 -04:00
LTO.cpp [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
LTO.h [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
MapFile.cpp [lld-link] Support /map option, matching link.exe 's /map output format 2020-03-24 09:48:00 -04:00
MapFile.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
MarkLive.cpp [COFF] Don't treat DWARF sections as GC roots 2020-03-27 12:37:43 -07:00
MarkLive.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
MinGW.cpp Remove namespace lld { namespace coff { from COFF LLD cpp files 2020-02-25 17:30:53 -08:00
MinGW.h [COFF] Don't include llvm/LTO/LTO.h in a header 2019-11-14 13:47:18 -08:00
Options.td [ms] Add new /PDBSTREAM option to lld-link allowing injection of streams into PDB files. 2020-04-07 16:19:38 -04:00
PDB.cpp [ms] Add new /PDBSTREAM option to lld-link allowing injection of streams into PDB files. 2020-04-07 16:19:38 -04:00
PDB.h [LLD] [COFF] Wrap file location pair<StringRef,int> in Optional<>. NFC. 2019-10-15 09:18:18 +00:00
README.md
SymbolTable.cpp [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
SymbolTable.h [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
Symbols.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Symbols.h [LLD] [COFF] Fix post-commit suggestions for absolute symbol equality 2020-01-08 22:10:05 +02:00
TypeMerger.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
Writer.cpp [lld-link] Support /map option, matching link.exe 's /map output format 2020-03-24 09:48:00 -04:00
Writer.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00

README.md

See docs/NewLLD.rst