llvm/test/tools/gold/X86
Teresa Johnson 08d0e94685 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298638 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 19:47:39 +00:00
..
Inputs [ThinLTO] Drop non-prevailing non-ODR weak to declarations 2017-01-20 21:54:58 +00:00
v1.12 [gold] Add datalayout to test where it was missing 2016-12-15 21:42:56 +00:00
alias2.ll
alias.ll
asm_undefined2.ll
asm_undefined.ll
available-externally.ll
bad-alias.ll
bcsection.ll
cache.ll LTO: When creating a local cache, create the cache directory if it does not already exist. 2017-03-02 02:02:38 +00:00
coff.ll
comdat2.ll
comdat.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
common_thinlto.ll
common.ll
ctors2.ll
ctors.ll
disable-verify.ll
drop-debug.ll
drop-linkage.ll
emit-llvm.ll
error-unopenable.ll gold-plugin: Add the file path to the file open error diagnostic. 2017-01-25 03:35:28 +00:00
invalid.ll
irmover-error.ll
linker-script.ll
linkonce-weak.ll
lit.local.cfg
mixed_lto.ll
module_asm.ll
no-map-whole-file.ll
opt-level.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
parallel.ll gold-plugin: Simplify naming of object files created with save-temps or obj-path. 2017-01-26 02:07:05 +00:00
pr19901_thinlto.ll
pr19901.ll
pr25907.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
pr25915.ll
relax-relocs.ll
remarks.ll
resolve-to-alias.ll
slp-vectorize.ll
start-lib-common.ll
stats.ll [ThinLTO] PrintStatistics when we exit early for thinlto-index-only 2017-02-02 17:33:53 +00:00
strip_names.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
thinlto_afdo.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
thinlto_alias.ll
thinlto_archive.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
thinlto_emit_imports.ll
thinlto_emit_linked_objects.ll
thinlto_funcimport.ll
thinlto_internalize.ll
thinlto_linkonceresolution.ll
thinlto_object_suffix_replace.ll [ThinLTO] Add support for emitting minimized bitcode for thin link 2017-03-23 19:47:39 +00:00
thinlto_prefix_replace.ll
thinlto_weak_library.ll [ThinLTO] Drop non-prevailing non-ODR weak to declarations 2017-01-20 21:54:58 +00:00
thinlto_weak_resolution.ll [ThinLTO] Drop non-prevailing non-ODR weak to declarations 2017-01-20 21:54:58 +00:00
thinlto.ll gold-plugin: Fix test case. 2017-01-26 02:15:08 +00:00
type-merge2.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
type-merge.ll
unnamed-addr.ll
vectorize.ll
visibility.ll Fix x86 gold tests on non-x86 targets. 2017-01-04 14:43:51 +00:00
weak.ll