llvm-project/lld/ELF
Rafael Espindola 156f4ee1c0 Use a single context for lto.
Using multiple context used to be a really big memory saving because we
could free memory from each file while the linker proceeded with the
symbol resolution. We are getting lazier about reading data from the
bitcode, so I was curious if this was still a good tradeoff.

One thing that is a bit annoying is that we still have to copy the
symbol names. The problem is that the names are stored in the Module and
get freed when we move the module bits during linking.

Long term I think the solution is to add a symbol table to the bitcode.
That way IRObject file will not need to use a Module or a Context and we
can drop it while still keeping a StringRef to the names.

This patch is still be an interesting medium term improvement.

When linking llvm-as without debug info this patch is a small speedup:

master: 29.861877513 seconds
patch: 29.814533787 seconds

With debug info the numbers are

master: 34.765181469 seconds
patch: 34.563351584 seconds

The peak memory usage when linking llvm-as with debug info was

master: 599.10MB
patch: 600.13MB
llvm-svn: 267921
2016-04-28 19:30:41 +00:00
..
CMakeLists.txt ELF: Implement basic support for --version-script. 2016-04-22 20:21:26 +00:00
Config.h Do not call hasArg and getLastArg for the same option. 2016-04-28 02:08:54 +00:00
Driver.cpp Use a single context for lto. 2016-04-28 19:30:41 +00:00
Driver.h Use a single context for lto. 2016-04-28 19:30:41 +00:00
DriverUtils.cpp Move utility functions to DriverUtils.cpp. 2016-04-26 20:41:32 +00:00
Error.cpp Remove dead code. 2016-03-13 04:25:43 +00:00
Error.h Needed change to lld for the change to libObject’s getName() for symbols now returning Expected<...> 2016-04-20 21:24:51 +00:00
ICF.cpp ELF: Move code to where it is used, and related cleanups. NFC. 2016-04-26 23:52:44 +00:00
ICF.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00
InputFiles.cpp Use a single context for lto. 2016-04-28 19:30:41 +00:00
InputFiles.h Use a single context for lto. 2016-04-28 19:30:41 +00:00
InputSection.cpp Skip scanRelocs for non-alloc sections. 2016-04-28 18:42:04 +00:00
InputSection.h Skip scanRelocs for non-alloc sections. 2016-04-28 18:42:04 +00:00
LTO.cpp Use a single context for lto. 2016-04-28 19:30:41 +00:00
LTO.h Use a single context for lto. 2016-04-28 19:30:41 +00:00
LinkerScript.cpp [ELF] - Implemented comparsion operators for linkerscript. 2016-04-25 08:14:41 +00:00
LinkerScript.h [ELF] - Removed dead declarations. NFC. 2016-04-25 08:08:54 +00:00
MarkLive.cpp ELF: Move code to where it is used, and related cleanups. NFC. 2016-04-26 23:52:44 +00:00
Options.td [ELF] -R is an alias for -rpath. 2016-04-27 21:56:53 +00:00
OutputSections.cpp ELF: Create .gnu.version and .gnu.version_r sections when linking against versioned DSOs. 2016-04-27 20:22:31 +00:00
OutputSections.h ELF: Create .gnu.version and .gnu.version_r sections when linking against versioned DSOs. 2016-04-27 20:22:31 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
ScriptParser.cpp [ELF] - Implemented comparsion operators for linkerscript. 2016-04-25 08:14:41 +00:00
ScriptParser.h Use ScriptParserBase features to parse linker script expressions. 2016-04-23 00:04:03 +00:00
SymbolListFile.cpp Devirtualize ScriptParserBase. NFC. 2016-04-22 22:59:24 +00:00
SymbolListFile.h ELF: Implement basic support for --version-script. 2016-04-22 20:21:26 +00:00
SymbolTable.cpp Remove Size from Undefined symbol. 2016-04-28 00:26:54 +00:00
SymbolTable.h Removed dead code. NFC. 2016-04-27 09:24:03 +00:00
Symbols.cpp Remove Size from Undefined symbol. 2016-04-28 00:26:54 +00:00
Symbols.h Remove Size from Undefined symbol. 2016-04-28 00:26:54 +00:00
Target.cpp Rename isRelRelative 2016-04-28 14:34:39 +00:00
Target.h Rename isRelRelative 2016-04-28 14:34:39 +00:00
Writer.cpp Skip scanRelocs for non-alloc sections. 2016-04-28 18:42:04 +00:00
Writer.h Rename elf2 to elf. 2016-02-28 00:25:54 +00:00

README.md

See docs/NewLLD.rst