llvm-project/lld/ELF
Wei Mi 538208f6c0 [lld] Add a new output section ".text.unknown" for funtions with unknown hotness
For sampleFDO, because the optimized build uses profile generated from previous
release, often we couldn't tell a function without profile was truely cold or
just newly created so we had to treat them conservatively and put them in .text
section instead of .text.unlikely. The result was when we persue the best
performance by locking .text.hot and .text in memory, we wasted a lot of memory
to keep cold functions inside. This problem has been largely solved for regular
sampleFDO using profile-symbol-list (https://reviews.llvm.org/D66374), but for
the case when we use partial profile, we still waste a lot of memory because
of it.

In https://reviews.llvm.org/D62540, we propose to save functions with unknown
hotness information in a special section called ".text.unknown", so that
compiler will treat those functions as luck-warm, but runtime can choose not
to mlock the special section in memory or use other strategy to save memory.
That will solve most of the memory problem even if we use a partial profile.

The patch adds the support in lld for the special section.For sampleFDO,
because the optimized build uses profile generated from previous release,
often we couldn't tell a function without profile was truely cold or just
newly created so we had to treat them conservatively and put them in .text
section instead of .text.unlikely. The result was when we persue the best
performance by locking .text.hot and .text in memory, we wasted a lot of
memory to keep cold functions inside. This problem has been largely solved
for regular sampleFDO using profile-symbol-list
(https://reviews.llvm.org/D66374), but for the case when we use partial
profile, we still waste a lot of memory because of it.

In https://reviews.llvm.org/D62540, we propose to save functions with unknown
hotness information in a special section called ".text.unknown", so that
compiler will treat those functions as luck-warm, but runtime can choose not
to mlock the special section in memory or use other strategy to save memory.
That will solve most of the memory problem even if we use a partial profile.

The patch adds the support in lld for the special section.

Differential Revision: https://reviews.llvm.org/D79590
2020-05-08 11:14:48 -07:00
..
Arch [Hexagon] Add R_HEX_GD_PLT_B22/32_PCREL relocations 2020-05-05 11:47:51 -05:00
AArch64ErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CMakeLists.txt [ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP 2020-01-09 21:13:11 -08:00
CallGraphSort.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
CallGraphSort.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Config.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
DWARF.cpp [ELF] --gdb-index: support .debug_loclists 2020-04-29 15:04:13 -07:00
DWARF.h [ELF] --gdb-index: support .debug_loclists 2020-04-29 15:04:13 -07:00
Driver.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
Driver.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
DriverUtils.cpp Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
EhFrame.cpp [ELF] Wrap things in `namespace lld { namespace elf {`, NFC 2019-10-07 08:31:18 +00:00
EhFrame.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ICF.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
ICF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InputFiles.cpp [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
InputFiles.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
InputSection.cpp [ELF][PPC64] Suppress toc-indirect to toc-relative relaxation if R_PPC64_TOC16_LO is seen 2020-04-30 09:16:51 -07:00
InputSection.h [ELF][PPC64] Suppress toc-indirect to toc-relative relaxation if R_PPC64_TOC16_LO is seen 2020-04-30 09:16:51 -07:00
LTO.cpp [LTO] Suppress emission of empty combined module by default 2020-05-04 18:31:09 -07:00
LTO.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
LinkerScript.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
LinkerScript.h [ELF] -M/-Map: fix VMA/LMA/Size columns of symbol assignments when address/size>=2**32 2020-04-07 10:15:15 -07:00
MapFile.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
MapFile.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
MarkLive.cpp [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [ELF] Add convenience TableGen classes to enforce two dashes for options not supported by GNU ld 2020-05-08 07:37:06 -07:00
OutputSections.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
OutputSections.h [ELF] Refactor uses of getInputSections to improve efficiency NFC 2020-01-21 12:27:52 +00:00
README.md
Relocations.cpp [Hexagon] Add R_HEX_GD_PLT_B22/32_PCREL relocations 2020-05-05 11:47:51 -05:00
Relocations.h LLD Support for Basic Block Sections 2020-04-07 06:55:57 -07:00
ScriptLexer.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
ScriptLexer.h [ELF] For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths 2020-04-22 12:34:20 -07:00
ScriptParser.cpp [ELF] For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths 2020-04-22 12:34:20 -07:00
ScriptParser.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
SymbolTable.cpp [ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls 2020-04-06 09:47:06 -07:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
Symbols.cpp [ELF] Add --warn-backrefs-exclude=<glob> 2020-04-20 07:52:15 -07:00
Symbols.h [LLD][ELF] Implement --discard-* for cases when -r or --emit-relocs are used. 2020-04-25 18:59:41 +07:00
SyntheticSections.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
SyntheticSections.h [LLD][ELF][ARM] recommit Fix ARM Exidx order for non monotonic section order 2020-04-24 13:47:28 +01:00
Target.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Target.h LLD Support for Basic Block Sections 2020-04-07 06:55:57 -07:00
Thunks.cpp [ELF][PPC64] Enable R_PPC64_REL14 trunks 2020-04-04 10:59:17 -07:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [lld] Add a new output section ".text.unknown" for funtions with unknown hotness 2020-05-08 11:14:48 -07:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst