about summary refs log tree commit diff
path: root/src/test/codegen-units
AgeCommit message (Collapse)AuthorLines
2019-04-23Remove unnecessary ignore-tidy-linelengthvarkor-20/+0
2019-04-22Remove double trailing newlinesvarkor-2/+0
2018-12-25Remove licensesMark Rousskov-460/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-01Auto merge of #56165 - RalfJung:drop-glue-type, r=eddyb,nikomatsakisbors-37/+38
drop glue takes in mutable references, it should reflect that in its type When drop glue begins, it should retag, like all functions taking references do. But to do that, it needs to take the reference at a proper type: `&mut T`, not `*mut T`. Failing to retag can mean that the memory the reference points to remains frozen, and `EscapeToRaw` on a frozen location is a NOP, meaning later mutations cause a Stacked Borrows violation. Cc @nikomatsakis @Gankro because Stacked Borrows Cc @eddyb for the changes to miri argument passing (the intention is to allow passing `*mut [u8]` when `&mut [u8]` is expected and vice versa)
2018-11-22fix codegen-units testsRalf Jung-37/+38
2018-11-17Don't auto-inline `const fn`Oliver Scherer-2/+1
2018-10-25More mono items are generated nowOliver Schneider-0/+5
2018-10-05Stabilize `min_const_fn`Oliver Schneider-1/+0
2018-09-12Really make CGU names unique across crates.Michael Woerister-3/+3
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-15Adapt codegen-unit tests to new CGU naming scheme.Michael Woerister-30/+30
2018-07-16Revert "Adapt codegen-unit tests to new CGU naming scheme."Michael Woerister-30/+30
This reverts commit 94b32adb71a75a3f5b53a39c52c62c2ce1a7cc56.
2018-07-12Adapt codegen-unit tests to new CGU naming scheme.Michael Woerister-30/+30
2018-05-17Rename trans to codegen everywhere.Irina Popa-351/+349
2018-04-06Add codegen-units test for shared-generics.Michael Woerister-0/+51
2018-04-06Adapt codegen-unit test to shared-generics.Michael Woerister-2/+2
2017-12-26Convert codegen-unit tests to use `start` instead of `main`Bastian Köcher-454/+148
The new Termination traits brings in the unwinding machinery and that blows up the required `TRANS_ITEM`s.
2017-12-26Fixes codegen-units testsBastian Köcher-1/+400
2017-11-07Add regression tests for non-instantiation of inline and const fns.Michael Woerister-0/+45
2017-11-07Update codegen-unit tests.Michael Woerister-47/+47
2017-10-11rustc: Handle #[inline(always)] at -O0Alex Crichton-1/+1
This commit updates the handling of `#[inline(always)]` functions at -O0 to ensure that it's always inlined regardless of the number of codegen units used. Closes #45201
2017-10-07rustc: Don't inline in CGUs at -O0Alex Crichton-0/+67
This commit tweaks the behavior of inlining functions into multiple codegen units when rustc is compiling in debug mode. Today rustc will unconditionally treat `#[inline]` functions by translating them into all codegen units that they're needed within, marking the linkage as `internal`. This commit changes the behavior so that in debug mode (compiling at `-O0`) rustc will instead only translate `#[inline]` functions into *one* codegen unit, forcing all other codegen units to reference this one copy. The goal here is to improve debug compile times by reducing the amount of translation that happens on behalf of multiple codegen units. It was discovered in #44941 that increasing the number of codegen units had the adverse side effect of increasing the overal work done by the compiler, and the suspicion here was that the compiler was inlining, translating, and codegen'ing more functions with more codegen units (for example `String` would be basically inlined into all codegen units if used). The strategy in this commit should reduce the cost of `#[inline]` functions to being equivalent to one codegen unit, which is only translating and codegen'ing inline functions once. Collected [data] shows that this does indeed improve the situation from [before] as the overall cpu-clock time increases at a much slower rate and when pinned to one core rustc does not consume significantly more wall clock time than with one codegen unit. One caveat of this commit is that the symbol names for inlined functions that are only translated once needed some slight tweaking. These inline functions could be translated into multiple crates and we need to make sure the symbols don't collideA so the crate name/disambiguator is mixed in to the symbol name hash in these situations. [data]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334880911 [before]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334583384
2017-10-07rustc: Implement ThinLTOAlex Crichton-30/+30
This commit is an implementation of LLVM's ThinLTO for consumption in rustc itself. Currently today LTO works by merging all relevant LLVM modules into one and then running optimization passes. "Thin" LTO operates differently by having more sharded work and allowing parallelism opportunities between optimizing codegen units. Further down the road Thin LTO also allows *incremental* LTO which should enable even faster release builds without compromising on the performance we have today. This commit uses a `-Z thinlto` flag to gate whether ThinLTO is enabled. It then also implements two forms of ThinLTO: * In one mode we'll *only* perform ThinLTO over the codegen units produced in a single compilation. That is, we won't load upstream rlibs, but we'll instead just perform ThinLTO amongst all codegen units produced by the compiler for the local crate. This is intended to emulate a desired end point where we have codegen units turned on by default for all crates and ThinLTO allows us to do this without performance loss. * In anther mode, like full LTO today, we'll optimize all upstream dependencies in "thin" mode. Unlike today, however, this LTO step is fully parallelized so should finish much more quickly. There's a good bit of comments about what the implementation is doing and where it came from, but the tl;dr; is that currently most of the support here is copied from upstream LLVM. This code duplication is done for a number of reasons: * Controlling parallelism means we can use the existing jobserver support to avoid overloading machines. * We will likely want a slightly different form of incremental caching which integrates with our own incremental strategy, but this is yet to be determined. * This buys us some flexibility about when/where we run ThinLTO, as well as having it tailored to fit our needs for the time being. * Finally this allows us to reuse some artifacts such as our `TargetMachine` creation, where all our options we used today aren't necessarily supported by upstream LLVM yet. My hope is that we can get some experience with this copy/paste in tree and then eventually upstream some work to LLVM itself to avoid the duplication while still ensuring our needs are met. Otherwise I fear that maintaining these bindings may be quite costly over the years with LLVM updates!
2017-07-13Adapt cgu-partitioning tests to pre-trans symbol internalization.Michael Woerister-53/+53
2017-06-09Move Fn to module.Clar Charr-8/+8
2017-03-18translate drop glue using MIRAriel Ben-Yehuda-79/+40
Drop of arrays is now translated in trans::block in an ugly way that I should clean up in a later PR, and does not handle panics in the middle of an array drop, but this commit & PR are growing too big.
2017-03-18translate function shims using MIRAriel Ben-Yehuda-0/+8
2017-01-09trans: Treat generics like regular functions, not like #[inline] functions ↵Michael Woerister-12/+12
during CGU partitioning.
2016-09-27Fix fallout in tests.Jeffrey Seyfried-4/+4
2016-09-21Auto merge of #36551 - eddyb:meta-games, r=nikomatsakisbors-0/+3
Refactor away RBML from rustc_metadata. RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes: * Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML). * Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information * Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits. * Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata * `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ). cc @rust-lang/compiler
2016-09-21Auto merge of #36524 - michaelwoerister:trans-inline-only-on-demand, ↵bors-3/+3
r=nikomatsakis trans: Only instantiate #[inline] functions in codegen units referencing them This PR changes how `#[inline]` functions are translated. Before, there was one "master instance" of the function with `external` linkage and a number of on-demand instances with `available_externally` linkage in each codegen unit that referenced the function. This had two downsides: * Public functions marked with `#[inline]` would be present in machine code of libraries unnecessarily (see #36280 for an example) * LLVM would crash on `i686-pc-windows-msvc` due to what I suspect to be a bug in LLVM's Win32 exception handling code, because it doesn't like `available_externally` there (#36309). This PR changes the behavior, so that there is no master instance and only on-demand instances with `internal` linkage. The downside of this is potential code-bloat if LLVM does not completely inline away the `internal` instances because then there'd be N instances of the function instead of 1. However, this can only become a problem when using more than one codegen unit per crate. cc @rust-lang/compiler
2016-09-20rustc_trans: don't do on-demand drop glue instantiation.Eduard Burtescu-0/+3
2016-09-15Adapt codegen-unit test cases to new behaviourMichael Woerister-3/+3
2016-09-13trans: Let the collector find drop-glue for all vtables, not just VTableImpl.Michael Woerister-6/+0
2016-08-17rustc: move the SelfSpace before TypeSpace in Substs.Eduard Burtescu-5/+5
2016-08-12Make the translation item collector handle *uses* of 'const' items instead ↵Michael Woerister-0/+93
of declarations.
2016-07-08trans: Adjust linkage assignment so that we don't need weak linkage.Michael Woerister-20/+22
2016-07-08Improve linkage assignment in trans::partitioning.Michael Woerister-45/+45
2016-07-08Ignore closure-related translation item collection tests.Michael Woerister-0/+10
2016-06-16fix codegen-units falloutAriel Ben-Yehuda-2/+0
2016-06-04fix fallout in testsAriel Ben-Yehuda-6/+0
2016-05-23trans::collector: Remove some redundant calls to erase_regions().Michael Woerister-0/+4
2016-05-11trans: Make collector handle the drop_in_place() intrinsic.Michael Woerister-0/+41
2016-05-11Add test for collecting items in staticsJames Miller-0/+23
2016-05-11trans: Don't try to place declarations during codegen unit partitioning.Michael Woerister-11/+11
2016-05-07Rollup merge of #33438 - birkenfeld:dup-words, r=steveklabnikSteve Klabnik-1/+1
Fix some some duplicate words.
2016-05-06s/aux/auxiliary, because windowsNiko Matsakis-0/+0
For legacy reasons (presumably), Windows does not permit files name aux.
2016-05-06move auxiliary builds to a test-relative `aux`Niko Matsakis-0/+178
Instead of finding aux-build files in `auxiliary`, we now search for an `aux` directory relative to the test. So if your test is `compile-fail/foo.rs`, we would look in `compile-fail/aux`. Similarly, we ignore the `aux` directory when searching for tets.