rust/src
bors f504d3f059 Auto merge of #56487 - nikic:discard-modules-earlier, r=alexcrichton
Discard LLVM modules earlier when performing ThinLTO

Currently ThinLTO is performed by first compiling all modules (and keeping them in memory), and then serializing them into ThinLTO buffers in a separate, synchronized step. Modules are later read back from ThinLTO buffers when running the ThinLTO optimization pipeline.

We can also find the following comment in `lto.rs`:

        // FIXME: right now, like with fat LTO, we serialize all in-memory
        //        modules before working with them and ThinLTO. We really
        //        shouldn't do this, however, and instead figure out how to
        //        extract a summary from an in-memory module and then merge that
        //        into the global index. It turns out that this loop is by far
        //        the most expensive portion of this small bit of global
        //        analysis!

I don't think that what is suggested here is the right approach: One of the primary benefits of using ThinLTO over ordinary LTO is that it's not necessary to keep all the modules (merged or not) in memory for the duration of the linking step.

However, we currently don't really make use of this (at least for crate-local ThinLTO), because we keep all modules in memory until the start of the LTO step. This PR changes the implementation to instead perform the serialization into ThinLTO buffers directly after the initial optimization step.

Most of the changes here are plumbing to separate out fat and thin lto handling in `write.rs`, as these now use different intermediate artifacts. For fat lto this will be in-memory modules, for thin lto it will be ThinLTO buffers.

r? @alexcrichton
2018-12-07 12:18:19 +00:00
..
bootstrap Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
build_helper
ci ci: Only run compare-mode tests on one builder 2018-11-30 14:31:04 -08:00
dlmalloc@de99f4b0c8 Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
doc build the edition guide 2018-12-04 17:06:16 -05:00
etc Rollup merge of #56144 - tromey:Bug-55771-btreemap, r=alexcrichton 2018-11-25 17:05:04 +01:00
grammar syntax: Rename some keywords 2018-12-04 00:30:27 +03:00
liballoc Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
libarena Auto merge of #56378 - ljedrz:arena_tweaks, r=nagisa 2018-12-02 11:14:14 +00:00
libbacktrace@f4d02bbdbf
libcompiler_builtins@10f4f35f96 Update compiler_builtins and remove wasm f32<->f64 math conversions 2018-12-06 20:37:15 +05:30
libcore Rollup merge of #56574 - cbarrick:master, r=varkor 2018-12-07 12:42:36 +08:00
libfmt_macros
libgraphviz
liblibc@5b403753da Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
libpanic_abort Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
libpanic_unwind Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
libproc_macro Statically link proc_macro into proc macros. 2018-11-30 06:15:20 +02:00
libprofiler_builtins
librustc Rollup merge of #56555 - Mark-Simulacrum:stderr-profile, r=wesleywiser 2018-12-07 12:42:34 +08:00
librustc_allocator
librustc_apfloat Replace usages of ..i + 1 ranges with ..=i. 2018-12-04 12:05:19 -08:00
librustc_asan std: Delete the alloc_system crate 2018-11-11 09:22:28 -08:00
librustc_borrowck Refer to the second borrow as the "second borrow". 2018-11-30 14:55:51 +01:00
librustc_codegen_llvm Serialize modules into ThinBuffer after initial optimization 2018-12-04 16:24:20 +01:00
librustc_codegen_ssa Auto merge of #56487 - nikic:discard-modules-earlier, r=alexcrichton 2018-12-07 12:18:19 +00:00
librustc_codegen_utils cleanup: remove static lifetimes from consts 2018-12-04 12:46:10 +01:00
librustc_cratesio_shim Statically link proc_macro into proc macros. 2018-11-30 06:15:20 +02:00
librustc_data_structures Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakis 2018-12-06 10:18:17 +00:00
librustc_driver Rollup merge of #56434 - Zoxc:par-tests, r=michaelwoerister 2018-12-07 12:42:31 +08:00
librustc_errors Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
librustc_fs_util Rename conversion util; remove duplicate util in librustc_codegen_llvm. 2018-11-29 08:09:28 -05:00
librustc_incremental Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
librustc_lint Rollup merge of #56528 - sinkuu:unused_dep, r=Mark-Simulacrum 2018-12-06 07:49:00 +01:00
librustc_llvm Revert "rustc: Fix (again) simd vectors by-val in ABI" 2018-10-23 00:59:14 -07:00
librustc_lsan std: Delete the alloc_system crate 2018-11-11 09:22:28 -08:00
librustc_metadata cleanup: remove static lifetimes from consts 2018-12-04 12:46:10 +01:00
librustc_mir Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
librustc_msan std: Delete the alloc_system crate 2018-11-11 09:22:28 -08:00
librustc_passes Auto merge of #55959 - matthewjasper:remove-end-region, r=nikomatsakis 2018-11-25 03:00:30 +00:00
librustc_platform_intrinsics
librustc_plugin Unsupport #[derive(Trait)] sugar for #[derive_Trait] legacy plugin attributes 2018-12-07 03:30:01 +03:00
librustc_privacy Fix panic with outlives in existential type 2018-11-30 02:04:10 +00:00
librustc_resolve Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
librustc_save_analysis save-analysis: fallback to using path id 2018-11-19 17:18:36 +13:00
librustc_target Rollup merge of #56000 - hug-dev:armv8m.main, r=alexcrichton 2018-12-07 12:42:29 +08:00
librustc_traits Implement AggregateOps 2018-11-29 21:57:40 +01:00
librustc_tsan std: Delete the alloc_system crate 2018-11-11 09:22:28 -08:00
librustc_typeck Auto merge of #56282 - qnighy:additional-sizedness-fix, r=nikomatsakis 2018-12-06 17:31:15 +00:00
librustdoc Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
libserialize serialize: preallocate VecDeque in Decodable::decode 2018-11-21 10:07:33 +01:00
libstd Auto merge of #56581 - kennytm:rollup, r=kennytm 2018-12-07 08:46:45 +00:00
libsyntax Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum 2018-12-07 12:42:32 +08:00
libsyntax_ext Unsupport #[derive(Trait)] sugar for #[derive_Trait] legacy plugin attributes 2018-12-07 03:30:01 +03:00
libsyntax_pos Fix printing of spans with no TyCtxt 2018-12-06 23:18:06 +01:00
libterm
libtest Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
libunwind Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
llvm@a784eca10d Update LLVM 2018-11-28 16:13:40 +01:00
llvm-emscripten@7f23313edf Pull in fix for dist-i686-linux build 2018-11-09 16:59:45 +01:00
rtstartup
rust-sgx@9656260888 Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
rustc Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
rustllvm Auto merge of #55010 - tromey:Bug-9224-generic-parameters, r=michaelwoerister 2018-12-03 11:59:11 +00:00
stdsimd@5e628c5120 Add x86_64-fortanix-unknown-sgx target to libstd and dependencies 2018-12-07 11:26:50 +05:30
test Auto merge of #54271 - petrochenkov:nolegder, r=eddyb,alexcrichton 2018-12-07 00:48:00 +00:00
tools Auto merge of #56066 - jethrogb:jb/sgx-target, r=alexcrichton 2018-12-07 06:34:16 +00:00
.gitignore
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
stage0.txt Bump nightly to 1.32.0 2018-10-31 11:53:50 -07:00

This directory contains the source code of the rust project, including:

  • rustc and its tests
  • libstd
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc guide.

There is also useful content in the following READMEs, which are gradually being moved over to the guide: