1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/lib/Object
Teresa Johnson 7703ef4532 [ThinLTO] Add support for emitting minimized bitcode for thin link
Summary:
The cumulative size of the bitcode files for a very large application
can be huge, particularly with -g. In a distributed build environment,
all of these files must be sent to the remote build node that performs
the thin link step, and this can exceed size limits.

The thin link actually only needs the summary along with a bitcode
symbol table. Until we have a proper bitcode symbol table, simply
stripping the debug metadata results in significant size reduction.

Add support for an option to additionally emit minimized bitcode
modules, just for use in the thin link step, which for now just strips
all debug metadata. I plan to add a cc1 option so this can be invoked
easily during the compile step.

However, care must be taken to ensure that these minimized thin link
bitcode files produce the same index as with the original bitcode files,
as these original bitcode files will be used in the backends.

Specifically:
1) The module hash used for caching is typically produced by hashing the
written bitcode, and we want to include the hash that would correspond
to the original bitcode file. This is because we want to ensure that
changes in the stripped portions affect caching. Added plumbing to emit
the same module hash in the minimized thin link bitcode file.
2) The module paths in the index are constructed from the module ID of
each thin linked bitcode, and typically is automatically generated from
the input file path. This is the path used for finding the modules to
import from, and obviously we need this to point to the original bitcode
files. Added gold-plugin support to take a suffix replacement during the
thin link that is used to override the identifier on the MemoryBufferRef
constructed from the loaded thin link bitcode file. The assumption is
that the build system can specify that the minimized bitcode file has a
name that is similar but uses a different suffix (e.g. out.thinlink.bc
instead of out.o).

Added various tests to ensure that we get identical index files out of
the thin link step.

Reviewers: mehdi_amini, pcc

Subscribers: Prazek, llvm-commits

Differential Revision: https://reviews.llvm.org/D31027

llvm-svn: 298638
2017-03-23 19:47:39 +00:00
..
Archive.cpp
ArchiveWriter.cpp ArchiveWriter: Remove unused variables. NFC. 2017-03-16 20:35:07 +00:00
Binary.cpp [WebAssembly] Add llvm-objdump support for wasm file format 2016-11-30 16:49:11 +00:00
CMakeLists.txt [lib/Object] - Introduce Decompressor class. 2017-01-11 15:26:41 +00:00
COFFObjectFile.cpp
Decompressor.cpp Recommit r292214 "[Support/Compression] - Change zlib API to return Error instead of custom status" 2017-01-17 15:45:07 +00:00
ELF.cpp
ELFObjectFile.cpp [ARM] Create SubtargetFeatures from build attrs 2017-01-18 15:52:11 +00:00
Error.cpp
IRObjectFile.cpp [ThinLTO] Import composite types as declarations 2016-12-16 21:25:01 +00:00
LLVMBuild.txt
MachOObjectFile.cpp Add the rest of the error checking for Mach-O dyld compact bind entry errors 2017-03-20 19:46:55 +00:00
MachOUniversal.cpp Fix a bugs with using some Mach-O command line flags like "-arch armv7m". 2016-12-16 22:54:02 +00:00
ModuleSummaryIndexObjectFile.cpp [ThinLTO] Add support for emitting minimized bitcode for thin link 2017-03-23 19:47:39 +00:00
ModuleSymbolTable.cpp Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
Object.cpp
ObjectFile.cpp [WebAssembly] Add llvm-objdump support for wasm file format 2016-11-30 16:49:11 +00:00
RecordStreamer.cpp Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
RecordStreamer.h Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
SymbolicFile.cpp [WebAssembly] Add llvm-objdump support for wasm file format 2016-11-30 16:49:11 +00:00
SymbolSize.cpp
WasmObjectFile.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings in SubtargetFeature; other minor fixes (NFC). 2017-02-09 01:09:54 +00:00