hanchenye-llvm-project/lld/COFF
Reid Kleckner b7402edce3 [PDB] Defer public serialization until PDB writing
This reduces peak memory on my test case from 1960.14MB to 1700.63MB
(-260MB, -13.2%) with no measurable impact on CPU time. I'm currently
working with a publics stream that is about 277MB. Before this change,
we would allocate 277MB of heap memory, serialize publics into them,
hold onto that heap memory, open the PDB, and commit into it.  After
this change, we defer the serialization until commit time.

In the last change I made to public writing, I re-sorted the list of
publics multiple times in place to avoid allocating new temporary data
structures. Deferring serialization until later requires that we don't
reorder the publics. Instead of sorting the publics, I partially
construct the hash table data structures, store a publics index in them,
and then sort the hash table data structures. Later, I replace the index
with the symbol record offset.

This change also addresses a FIXME and moves the list of global and
public records from GSIHashStreamBuilder to GSIStreamBuilder. Now that
publics aren't being serialized, it makes even less sense to store them
as a list of CVSymbol records. The hash table used to deduplicate
globals is moved as well, since that is specific to globals, and not
publics.

Reviewed By: aganea, hans

Differential Revision: https://reviews.llvm.org/D81296
2020-06-30 11:28:04 -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] Migrate COFFObjectFile to Expected<T> 2020-05-08 14:01:39 -07:00
Chunks.h [COFF] Avoid allocating temporary vectors during ICF 2020-05-04 07:01:14 -07:00
Config.h [LLD] [COFF] Add options for disabling auto import and runtime pseudo relocs 2020-05-14 13:05:14 +03:00
DLL.cpp [LLD] [COFF] Fix alignment of thunks for ARM/ARM64 2020-04-13 23:27:15 +03:00
DLL.h
DebugTypes.cpp [COFF] Move type merging to TpiSource::mergeDebugT virtual method 2020-05-14 09:47:00 -07:00
DebugTypes.h [COFF] Move type merging to TpiSource::mergeDebugT virtual method 2020-05-14 09:47:00 -07:00
Driver.cpp [LLD] Make scoped timers thread safe 2020-05-20 16:16:08 -07:00
Driver.h [COFF] Move type merging to TpiSource::mergeDebugT virtual method 2020-05-14 09:47:00 -07:00
DriverUtils.cpp [COFF] Use a global option table to avoid reconstructing it 2020-05-02 15:04:19 -07:00
ICF.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
ICF.h
InputFiles.cpp [COFF] Free some memory used for chunks 2020-06-01 18:51:47 -07:00
InputFiles.h [COFF] Free some memory used for chunks 2020-06-01 18:51:47 -07:00
LLDMapFile.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07: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 [LTO] Suppress emission of empty combined module by default 2020-05-04 18:31:09 -07:00
LTO.h [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
MapFile.cpp [Support] Move LLD's parallel algorithm wrappers to support 2020-05-05 15:21:05 -07:00
MapFile.h
MarkLive.cpp [COFF] Don't treat DWARF sections as GC roots 2020-03-27 12:37:43 -07:00
MarkLive.h
MinGW.cpp
MinGW.h
Options.td [LLD] [COFF] Add options for disabling auto import and runtime pseudo relocs 2020-05-14 13:05:14 +03:00
PDB.cpp [PDB] Defer public serialization until PDB writing 2020-06-30 11:28:04 -07:00
PDB.h
README.md
SymbolTable.cpp [LLD] [COFF] Add options for disabling auto import and runtime pseudo relocs 2020-05-14 13:05:14 +03:00
SymbolTable.h [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
Symbols.cpp [COFF] Migrate COFFObjectFile to Expected<T> 2020-05-08 14:01:39 -07:00
Symbols.h [COFF] Paritally inline Symbol::getName, NFC 2020-05-03 07:58:05 -07:00
TypeMerger.h [COFF] Move type merging to TpiSource::mergeDebugT virtual method 2020-05-14 09:47:00 -07:00
Writer.cpp [LLD] [COFF] Add options for disabling auto import and runtime pseudo relocs 2020-05-14 13:05:14 +03:00
Writer.h

README.md

See docs/NewLLD.rst