about summary refs log tree commit diff
path: root/src/test/codegen-units/partitioning
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-792/+0
2021-09-23Support incremental in compiletest for non-incremental modes.Eric Huss-27/+41
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-10/+10
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-03-09Deprecate items that accidentally weren't deprecatedbstrie-8/+8
Fixes #82080
2020-08-30ty: remove obsolete printerDavid Wood-96/+93
This commit removes the obsolete printer and replaces all uses of it with `FmtPrinter`. Of the replaced uses, all but one use was in `debug!` logging, two cases were notable: - `MonoItem::to_string` is used in `-Z print-mono-items` and therefore affects the output of all codegen-units tests. - `DefPathBasedNames` was used in `librustc_codegen_llvm/type_of.rs` with `LLVMStructCreateNamed` and that'll now get different values, but this should result in no functional change. Signed-off-by: David Wood <david@davidtw.co>
2020-06-15Change how compiler-builtins gets many CGUsAlex Crichton-40/+0
This commit intends to fix an accidental regression from #70846. The goal of #70846 was to build compiler-builtins with a maximal number of CGUs to ensure that each module in the source corresponds to an object file. This high degree of control for compiler-builtins is desirable to ensure that there's at most one exported symbol per CGU, ideally enabling compiler-builtins to not conflict with the system libgcc as often. In #70846, however, only part of the compiler understands that compiler-builtins is built with many CGUs. The rest of the compiler thinks it's building with `sess.codegen_units()`. Notably the calculation of `sess.lto()` consults `sess.codegen_units()`, which when there's only one CGU it disables ThinLTO. This means that compiler-builtins is built without ThinLTO, which is quite harmful to performance! This is the root of the cause from #73135 where intrinsics were found to not be inlining trivial functions. The fix applied in this commit is to remove the special-casing of compiler-builtins in the compiler. Instead the build system is now responsible for special-casing compiler-builtins. It doesn't know exactly how many CGUs will be needed but it passes a large number that is assumed to be much greater than the number of source-level modules needed. After reading the various locations in the compiler source, this seemed like the best solution rather than adding more and more special casing in the compiler for compiler-builtins. Closes #73135
2020-04-06Keep codegen units unmerged when building compiler builtinsTomasz Miąsko-0/+40
2020-03-31Add a test case for incremental + codegen-units interaction.Michael Woerister-0/+42
2020-03-24Remove `-Z incremental`.Nicholas Nethercote-25/+25
`-C incremental` was introduced over two years ago. `-Z incremental` was kept for transitioning, but it's been long enough now that it should be ok to remove it.
2020-02-26Update codegen-units testsMatthew Jasper-33/+23
2020-01-23Make drop-glue take advantage of -Zshare-generics.Michael Woerister-4/+24
2020-01-19adjust codegen-units testsRalf Jung-8/+8
2019-09-23rustc: Fix mixing crates with different `share_generics`Alex Crichton-0/+2
This commit addresses #64319 by removing the `dylib` crate type from the list of crate type that exports generic symbols. The bug in #64319 arises because a `dylib` crate type was trying to export a symbol in an uptream crate but it miscalculated the symbol name of the uptream symbol. This isn't really necessary, though, since `dylib` crates aren't that heavily used, so we can just conservatively say that the `dylib` crate type never exports generic symbols, forcibly removing them from the exported symbol lists if were to otherwise find them. The fix here happens in two places: * First is in the `local_crate_exports_generics` method, indicating that it's now `false` for the `Dylib` crate type. Only rlibs actually export generics at this point. * Next is when we load exported symbols from upstream crate. If, for our compilation session, the crate may be included from a dynamic library, then its generic symbols are removed. When the crate was linked into a dynamic library its symbols weren't exported, so we can't consider them a candidate to link against. Overally this should avoid situations where we incorrectly calculate the upstream symbol names in the face of differnet `share_generics` options, ultimately... Closes #64319
2019-04-23Remove unnecessary ignore-tidy-linelengthvarkor-1/+0
2019-04-22Remove double trailing newlinesvarkor-1/+0
2018-12-25Remove licensesMark Rousskov-170/+0
2018-11-22fix codegen-units testsRalf Jung-8/+8
2018-10-25More mono items are generated nowOliver Schneider-0/+5
2018-09-12Really make CGU names unique across crates.Michael Woerister-3/+3
2018-05-17Rename trans to codegen everywhere.Irina Popa-113/+113
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-25/+14
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-0/+19
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/+60
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-07-13Adapt cgu-partitioning tests to pre-trans symbol internalization.Michael Woerister-53/+53
2017-03-18translate drop glue using MIRAriel Ben-Yehuda-16/+8
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-01-09trans: Treat generics like regular functions, not like #[inline] functions ↵Michael Woerister-12/+12
during CGU partitioning.
2016-09-21Auto merge of #36551 - eddyb:meta-games, r=nikomatsakisbors-0/+1
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/+1
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-2/+0
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-06-04fix fallout in testsAriel Ben-Yehuda-2/+0
2016-05-11trans: Don't try to place declarations during codegen unit partitioning.Michael Woerister-11/+11
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/+74
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.
2016-05-01Fix a race condition caused by concurrently executed codegen unit tests.Michael Woerister-10/+31
2016-04-28Make the codegen unit partitioner also emit item declarations.Michael Woerister-21/+21
2016-04-28Add FixedUnitCount codegen unit partitioning strategy.Michael Woerister-10/+10
2016-04-28Let the translation item collector make a distinction between drop-glue kindsMichael Woerister-1/+2
2016-04-28Fix codegen-units testsJames Miller-6/+0
I'm not sure what the signficance of `drop-glue i8` is, nor why one of the tests had it appear while the others had it disappear. Either way it doesn't seem like the presence or absense of it is the focus of the tests.
2016-04-15Add initial version of codegen unit partitioning for incremental compilation.Michael Woerister-0/+601