about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir
AgeCommit message (Collapse)AuthorLines
2023-07-21Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"David Tolnay-8/+23
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
2023-07-21CTFE: move `target_{i, u}size_{min, max)` to `rustc_abi::TargetDataLayout`Moulins-22/+8
2023-07-21support non-null pointer niches in CTFEMoulins-1/+0
2023-07-18Auto merge of #113777 - nnethercote:overlap-based-cgu-merging, r=pnkfelixbors-0/+8
Inline overlap based CGU merging Introduce a new CGU merging algorithm that aims to minimize the number of duplicated inlined items. r? `@wesleywiser`
2023-07-19Add a useful comment.Nicholas Nethercote-0/+2
2023-07-19Add `MonoItemData::inlined`.Nicholas Nethercote-0/+6
2023-07-17Auto merge of #113562 - saethlin:larger-incr-comp-offset, r=nnethercotebors-2/+2
Use u64 for incr comp allocation offsets Fixes https://github.com/rust-lang/rust/issues/76037 Fixes https://github.com/rust-lang/rust/issues/95780 Fixes https://github.com/rust-lang/rust/issues/111613 These issues are all reporting ICEs caused by using `u32` to store offsets to allocations in the incremental compilation cache. This PR aims to lift that limitation by changing the offset type in question to `u64`. There are two perf runs in this PR. The first reports a regression, and the second does not. The changes are the same in both. I rebased the PR then did the second perf run because I noticed that the primary regression in it was very commonly seen in spurious regression reports. I do not know what the perf run will report when this is merged. I would not be surprised to see regression or neutral, but the cachegrind diffs for the regression point at `try_mark_previous_green` which is a common source of inexplicable regressions and I don't think should be perturbed by this PR. I'm not opposed to adding a regression test such as ```rust fn main() { println!("{}", [37; 1 << 30].len()); } ``` But that program takes 1 minute to compile and consumes 4.6 GB of memory then writes that much to disk. Is that a concerning amount of resource use for a test? r? `@nnethercote`
2023-07-17Remove `instance_def_size_estimate` query.Nicholas Nethercote-5/+12
It doesn't seem worthwhile now that `MonoItem::size_estimate` is called much less often.
2023-07-17Store item size estimate in `MonoItemData`.Nicholas Nethercote-5/+6
This means we call `MonoItem::size_estimate` (which involves a query) less often: just once per mono item, and then once more per inline item placement. After that we can reuse the stored value as necessary. This means `CodegenUnit::compute_size_estimate` is cheaper.
2023-07-17Introduce `MonoItemData`.Nicholas Nethercote-5/+12
It replaces `(Linkage, Visibility)`, making the code nicer. Plus the next commit will add another field.
2023-07-14Use u64 for incr comp allocation offsetsBen Kimock-2/+2
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-83/+82
2023-07-11update Operand::Move docsRalf Jung-4/+10
2023-07-07Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`Nilstrieb-4/+4
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-07-06Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errorsbors-12/+14
Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Part of rust-lang/compiler-team#616 turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S r? `@oli-obk`
2023-07-06Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJungbors-31/+19
Specialize `try_destructure_mir_constant` for its sole user (pretty printing) We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval. r? `@RalfJung` for a first round. While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either.
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-12/+14
2023-07-05Name the destructure_mir_constant query appropriatelyOli Scherer-2/+2
2023-07-05Remove a function argument that is always passed with the same value.Oli Scherer-19/+7
2023-07-05Specialize `DestructuredConstant` to its one user (pretty printing)Oli Scherer-7/+12
2023-07-05Specialize `try_destructure_mir_constant` for its sole userOli Scherer-6/+1
2023-07-05Deal with falloutBoxy-2/+2
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-2/+4
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-1/+1
2023-07-02Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillotbors-19/+10
Make simd_shuffle_indices use valtrees This removes the second-to-last user of the `destructure_mir_constant` query. So in a follow-up we can remove the query and just move the query provider function directly into pretty printing (which is the last user). cc `@rust-lang/clippy` there's a small functional change, but I think it is correct?
2023-06-27Rollup merge of #112972 - nbdd0121:mir, r=davidtwcoMatthias Krüger-1/+2
Make `UnwindAction::Continue` explicit in MIR dump Makes it easier to spot unwinding related issues in MIR by making `UnwindAction::Continue` explicit, just like all other `UnwindAction`s.
2023-06-27Auto merge of #112693 - ericmarkmartin:use-more-placeref, r=spastorinobors-7/+4
Use PlaceRef abstractions more often Associated issue: https://github.com/rust-lang/rust/issues/80647 r? `@spastorino`
2023-06-26Assert that we don't convert unevaluated MIR promoteds to unevaluated type ↵Oli Scherer-2/+1
constants
2023-06-26Make simd_shuffle_indices use valtreesOli Scherer-17/+9
2023-06-25use PlaceRef abstractions more consistentlyEric Mark Martin-7/+4
2023-06-23Make `UnwindAction::Continue` explicit in MIR dumpGary Guo-1/+2
2023-06-22Tweak CGU size estimate code.Nicholas Nethercote-7/+9
- Rename `create_size_estimate` as `compute_size_estimate`, because that makes more sense for the second and subsequent calls for each CGU. - Change `CodegenUnit::size_estimate` from `Option<usize>` to `usize`. We can still assert that `compute_size_estimate` is called first. - Move the size estimation for `place_mono_items` inside the function, for consistency with `merge_codegen_units`.
2023-06-22Inline before merging CGUs.Nicholas Nethercote-4/+0
Because CGU merging relies on CGU sizes, but the CGU sizes before inlining aren't accurate. This requires tweaking how the sizes are updated during merging: if CGU A and B both have an inlined function F, then `size(A + B)` will be a little less than `size(A) + size(B)`, because `A + B` will only have one copy of F. Also, the minimum CGU size is increased because it now has to account for inlined functions. This change doesn't have much effect on compile perf, but it makes follow-on changes that involve more sophisticated reasoning about CGU sizes much easier.
2023-06-21Rollup merge of #112759 - cjgillot:closure-names, r=oli-obkNilstrieb-0/+4
Make closure_saved_names_of_captured_variables a query. As we will start removing debuginfo during MIR optimizations, we need to keep them somewhere.
2023-06-20update comment on `MutBorrowKind::ClosureCapture`Ziru Niu-4/+7
2023-06-20address most easy commentsZiru Niu-10/+4
2023-06-20merge `BorrowKind::Unique` into `BorrowKind::Mut`Ziru Niu-26/+18
2023-06-19Rollup merge of #112232 - fee1-dead-contrib:match-eq-const-msg, r=b-naberMichael Goulet-5/+29
Better error for non const `PartialEq` call generated by `match` Resolves #90237
2023-06-19Store generator field names in GeneratorLayout.Camille GILLOT-0/+4
2023-06-19Promote unchecked_add/sub/mul/shl/shr to mir::BinOpScott McMurray-2/+29
2023-06-19fix docDeadbeef-1/+1
2023-06-18Auto merge of #112638 - lqd:rpo, r=cjgillotbors-38/+26
Switch the BB CFG cache from postorder to RPO The `BasicBlocks` CFG cache is interesting: - it stores a postorder, but `traversal::postorder` doesn't use it - `traversal::reverse_postorder` does traverse the postorder cache backwards - we do more RPO traversals than postorder traversals (around 20x on the perf.rlo benchmarks IIRC) but it's not cached - a couple places here and there were manually reversing the non-cached postorder traversal This PR switches the order of the cache, and makes a bit more use of it. This is a tiny win locally, but it's also for consistency and aesthetics. r? `@ghost`
2023-06-18remove redundant combinators between PO and RPORémy Rakic-30/+6
2023-06-18Better error for non const `PartialEq` call generated by `match`Deadbeef-5/+29
2023-06-17Rollup merge of #112738 - matthiaskrgr:ice_msg, r=oli-obkMatthias Krüger-3/+3
make ice msg "Unknown runtime phase" a bit nicer
2023-06-17make ice msg "Unknown runtime phase" a bit nicerMatthias Krüger-3/+3
2023-06-17Add `<meta charset="utf-8">` to `-Zdump-mir-spanview` outputZalathar-2/+3
2023-06-16Add `SyntaxContext::is_root`Maybe Waffle-2/+2
2023-06-15Remove comments from mir-opt MIR dumpsBen Kimock-50/+71
2023-06-14remove unused postorder CFG cacheRémy Rakic-9/+0