rust/src
Alex Crichton 43e8ac27d9 rustc: Persist LLVM's Linker in Fat LTO
This commit updates our Fat LTO logic to tweak our custom wrapper around LLVM's
"link modules" functionality. Previously whenever the
`LLVMRustLinkInExternalBitcode` function was called it would call LLVM's
`Linker::linkModules` wrapper. Internally this would crate an instance of a
`Linker` which internally creates an instance of an `IRMover`. Unfortunately for
us the creation of `IRMover` is somewhat O(n) with the input module. This means
that every time we linked a module it was O(n) with respect to the entire module
we had built up!

Now the modules we build up during LTO are quite large, so this quickly started
creating an O(n^2) problem for us! Discovered in #48025 it turns out this has
always been a problem and we just haven't noticed it. It became particularly
worse recently though due to most libraries having 16x more object files than
they previously did (1 -> 16).

This commit fixes this performance issue by preserving the `Linker` instance
across all links into the main LLVM module. This means we only create one
`IRMover` and allows LTO to progress much speedier.

From the `cargo-cache` project in #48025 a **full build** locally when from
5m15s to 2m24s. Looking at the timing logs each object file was linked in in
single-digit millisecond rather than hundreds, clearly being a nice improvement!

Closes #48025
2018-02-12 09:11:06 -08:00
..
binaryen@17841e155e
bootstrap Rollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichton 2018-02-11 00:53:05 +08:00
build_helper
ci Rollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichton 2018-02-11 00:53:05 +08:00
dlmalloc@9b2dcac06c Update the dlmalloc submodule 2018-02-10 07:01:27 -08:00
doc Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis 2018-02-11 18:11:01 +00:00
etc fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
grammar
jemalloc@1f5a28755e
liballoc
liballoc_jemalloc
liballoc_system
libarena
libbacktrace fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
libcompiler_builtins@345447948f rustc: Upgrade to LLVM 6 2018-02-09 17:13:14 -08:00
libcore Rollup merge of #47547 - varkor:infinite-iterators-warning-doc, r=frewsxcv 2018-02-11 03:39:53 +08:00
libfmt_macros fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
libgetopts
libgraphviz
liblibc@56444a4545
libpanic_abort
libpanic_unwind
libproc_macro
libprofiler_builtins
librustc Auto merge of #47843 - estebank:teach, r=nikomatsakis 2018-02-12 09:38:40 +00:00
librustc_allocator
librustc_apfloat
librustc_asan
librustc_back
librustc_binaryen
librustc_borrowck
librustc_const_eval
librustc_const_math
librustc_cratesio_shim
librustc_data_structures Rollup merge of #47835 - Mark-Simulacrum:remove-data-structs, r=nikomatsakis 2018-02-10 14:23:54 +08:00
librustc_driver Rollup merge of #47854 - varkor:create-out-dir, r=pnkfelix 2018-02-10 14:23:56 +08:00
librustc_errors
librustc_incremental
librustc_lint
librustc_llvm rustc: Persist LLVM's Linker in Fat LTO 2018-02-12 09:11:06 -08:00
librustc_lsan
librustc_metadata
librustc_mir Auto merge of #47843 - estebank:teach, r=nikomatsakis 2018-02-12 09:38:40 +00:00
librustc_msan
librustc_passes Auto merge of #47843 - estebank:teach, r=nikomatsakis 2018-02-12 09:38:40 +00:00
librustc_platform_intrinsics
librustc_plugin
librustc_privacy
librustc_resolve Explain unusual debugging code in librustc 2018-02-10 07:03:35 -08:00
librustc_save_analysis Emit data::Impl in save-analysis 2018-02-10 03:04:44 +01:00
librustc_trans rustc: Persist LLVM's Linker in Fat LTO 2018-02-12 09:11:06 -08:00
librustc_trans_utils
librustc_tsan
librustc_typeck Auto merge of #47843 - estebank:teach, r=nikomatsakis 2018-02-12 09:38:40 +00:00
librustdoc Rollup merge of #48080 - GuillaumeGomez:mobile-docs-fixes, r=QuietMisdreavus 2018-02-10 14:24:05 +08:00
libserialize
libstd
libstd_unicode
libsyntax Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis 2018-02-11 18:11:01 +00:00
libsyntax_ext
libsyntax_pos
libterm
libtest
libunwind
llvm@9f81beaf32 rustc: Upgrade to LLVM 6 2018-02-09 17:13:14 -08:00
llvm-emscripten@2717444753
rt
rtstartup
rustc
rustllvm rustc: Persist LLVM's Linker in Fat LTO 2018-02-12 09:11:06 -08:00
test Auto merge of #47843 - estebank:teach, r=nikomatsakis 2018-02-12 09:38:40 +00:00
tools Delete executables if the test ran successfully. 2018-02-11 16:27:33 -07:00
Cargo.lock Emit data::Impl in save-analysis 2018-02-10 03:04:44 +01:00
Cargo.toml
stage0.txt