about summary refs log tree commit diff
path: root/compiler/rustc_monomorphize/src/partitioning.rs
AgeCommit message (Collapse)AuthorLines
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-1/+1
2025-05-26Limit the size of cgu names when using the `-Zhuman-readable-cgu-names` optionDiggory Blake-5/+5
Prior to this change, cgu names could be generated which would result in filenames longer than the limit imposed by the OS.
2025-05-19Rollup merge of #140874 - mejrs:rads, r=WaffleLapkinStuart Cook-4/+3
make `rustc_attr_parsing` less dominant in the rustc crate graph It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly. Previous graph: ![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd) Graph with this PR: ![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a) The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*. The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
2025-05-09don't depend on rustc_attr_parsing if rustc_data_structures will domejrs-4/+3
2025-05-09Remove mono item collection strategy override from -Zprint-mono-itemsTomasz Miąsko-23/+6
Previously `-Zprint-mono-items` would override the mono item collection strategy. When debugging one doesn't want to change the behaviour, so this was counter productive. Additionally, the produced behaviour was artificial and might never arise without using the option in the first place (`-Zprint-mono-items=eager` without `-Clink-dead-code`). Finally, the option was incorrectly marked as `UNTRACKED`. Resolve those issues, by turning `-Zprint-mono-items` into a boolean flag that prints results of mono item collection without changing the behaviour of mono item collection. For codegen-units test incorporate `-Zprint-mono-items` flag directly into compiletest tool. Test changes are mechanical. `-Zprint-mono-items=lazy` was removed without additional changes, and `-Zprint-mono-items=eager` was turned into `-Clink-dead-code`. Linking dead code disables internalization, so tests have been updated accordingly.
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-2/+5
async_drop_in_place::{closure}, scoped async drop added.
2025-04-22Use `is_lang_item` and `as_lang_item` instead of handrolling their logicOli Scherer-1/+1
2025-04-19Only consider MonoItem::Fn when preventing inlining for autodiff source ↵Manuel Drehwald-1/+2
functions
2025-02-22Fix binding mode problemsMichael Goulet-1/+1
2025-02-08Rustfmtbjorn3-6/+2
2025-02-07Remove Linkage::Appendingbjorn3-1/+0
It can only be used for certain LLVM internal variables like llvm.global_ctors which users are not allowed to define.
2025-02-07Remove Linkage::Privatebjorn3-1/+0
This is the same as Linkage::Internal except that it doesn't emit any symbol. Some backends may not support it and it isn't all that useful anyway.
2025-02-02run less code if cfg(llvm_enzyme) isn't usedManuel Drehwald-0/+4
2025-02-01test compile time fixesManuel Drehwald-9/+5
2025-01-29upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiffManuel Drehwald-2/+30
2025-01-27Change `collect_and_partition_mono_items` tuple return type to a structOli Scherer-9/+8
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-2/+3
2024-12-06Remove polymorphizationBen Kimock-13/+8
2024-11-28Share inline(never) generics across cratesMark Rousskov-8/+24
This reduces code sizes and better respects programmer intent when marking inline(never). Previously such a marking was essentially ignored for generic functions, as we'd still inline them in remote crates.
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-1/+1
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-12Querify MonoItem collectionBen Kimock-0/+15
2024-10-26Effects cleanupDeadbeef-2/+2
- removed extra bits from predicates queries that are no longer needed in the new system - removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers
2024-10-14Add fast-path when computing the default visibilityUrgau-0/+7
2024-10-01Replace -Z default-hidden-visibility with -Z default-visibilityDavid Lattimore-19/+15
MCP: https://github.com/rust-lang/compiler-team/issues/782 Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2024-09-24Dogfood `feature(file_buffered)`Josh Stone-3/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+8
2024-09-11Simplify some nested if statementsMichael Goulet-4/+2
2024-08-29Add `warn(unreachable_pub)` to `rustc_monomorphize`.Nicholas Nethercote-1/+1
2024-08-26Stop using a special inner body for the coroutine by-move body for async ↵Michael Goulet-2/+0
closures
2024-08-15Rollup merge of #129067 - cuviper:append, r=wesleywiserMatthias Krüger-2/+2
Use `append` instead of `extend(drain(..))` The first commit adds `IndexVec::append` that forwards to `Vec::append`, and uses it in a couple places. The second commit updates `indexmap` for its new `IndexMap::append`, and also uses that in a couple places. These changes are similar to what [`clippy::extend_with_drain`](https://rust-lang.github.io/rust-clippy/master/index.html#/extend_with_drain) would suggest, just for other collection types.
2024-08-13Update `indexmap` and use `IndexMap::append`Josh Stone-2/+2
2024-08-13Use is_lang_item moreMichael Goulet-1/+3
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-15Introduce and provide a hook for `should_codegen_locally`Mohammad Omidvar-1/+3
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-32/+32
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-1/+2
2024-06-03Stabilize order of MonoItems in CGUs and disallow query_instability lint for ↵Michael Woerister-32/+36
rustc_monomorphize
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_monomorphize`.Nicholas Nethercote-0/+1
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2024-04-17Use non-exhaustive matches for TyKindDaria Sukhonina-1/+2
Also no longer export noop async_drop_in_place_raw
2024-04-16Add simple async drop glue generationzetanumbers-2/+5
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-03-20collector: recursively traverse 'mentioned' items to evaluate their constantsRalf Jung-7/+7
2024-03-14Rollup merge of #122287 - RalfJung:simd-static-assert, r=pnkfelixMatthias Krüger-0/+3
add test ensuring simd codegen checks don't run when a static assertion failed stdarch relies on this to ensure that SIMD indices are in bounds. I would love to know why this works, but I can't figure out where codegen decides to not codegen a function if a required-const does not evaluate. `@oli-obk` `@bjorn3` do you have any idea?
2024-03-13coverage: Remove all unstable values of `-Cinstrument-coverage`Zalathar-3/+1
2024-03-10add comments explaining where post-mono const eval errors abort compilationRalf Jung-0/+3
2024-02-14clean up potential_query_instability with FxIndexMap and UnordMapyukang-2/+2
2024-02-06Rollup merge of #120602 - klensy:mono-comment, r=nnethercoteMatthias Krüger-1/+1
rustc_monomorphize: fix outdated comment in partition `max_cgu_count` was removed in https://github.com/rust-lang/rust/commit/51821515b3ccd7dd8f42ffd6a2eee536dcf7ddb0, but not comment (usage in `merge_codegen_units` was removed earlier). r? `@nnethercote`
2024-02-06Fix drop shim for AsyncFnOnce closure, AsyncFnMut shim for AsyncFn closureMichael Goulet-2/+2
2024-02-06Construct body for by-move coroutine closure outputMichael Goulet-1/+3