mir_build: Add an extra intermediate step in MIR building for patterns #155144
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mir_build: Add an extra intermediate step in MIR building for patterns
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (76367e4): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -9.8%, secondary -4.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 491.148s -> 509.241s (3.68%) |
This comment was marked as resolved.
This comment was marked as resolved.
0623749 to
c9949ba
Compare
This comment has been minimized.
This comment has been minimized.
9631275 to
7abdb0f
Compare
|
Marking this as ready for consideration. I'm not entirely confident about the name “InterPat”, and I'm aware that this change doesn't yet demonstrate any clear benefit on its own, but I think it's a worthwhile step towards hopefully being able to disentangle match-lowering a bit more. |
|
Some changes occurred in match lowering cc @Nadrieril |
|
LGTM! @bors r+ |
|
@bors rollup=maybe |
mir_build: Add an extra intermediate step in MIR building for patterns This is an attempt to partly decouple the data structures created by `match_pair.rs` from the data structures that are ultimately consumed by the main part of match lowering. In some ways this is a reversal from rust-lang#137875. That PR succeeded in removing the `TestCase::Irrefutable` variant, by taking a pre-existing “simplification” step and fusing it directly into `MatchPairTree::for_pattern`. Unfortunately, in doing so it also reinforced a very high degree of coupling between the transformations performed in `match_pair`, and the data structures used by later steps. My hope is that these changes will make it easier for follow-up work to further separate decision-making from MIR building when lowering patterns. r? Nadrieril
mir_build: Add an extra intermediate step in MIR building for patterns This is an attempt to partly decouple the data structures created by `match_pair.rs` from the data structures that are ultimately consumed by the main part of match lowering. In some ways this is a reversal from rust-lang#137875. That PR succeeded in removing the `TestCase::Irrefutable` variant, by taking a pre-existing “simplification” step and fusing it directly into `MatchPairTree::for_pattern`. Unfortunately, in doing so it also reinforced a very high degree of coupling between the transformations performed in `match_pair`, and the data structures used by later steps. My hope is that these changes will make it easier for follow-up work to further separate decision-making from MIR building when lowering patterns. r? Nadrieril
…uwer Rollup of 17 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
…uwer Rollup of 17 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
…uwer Rollup of 17 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
mir_build: Add an extra intermediate step in MIR building for patterns This is an attempt to partly decouple the data structures created by `match_pair.rs` from the data structures that are ultimately consumed by the main part of match lowering. In some ways this is a reversal from rust-lang#137875. That PR succeeded in removing the `TestCase::Irrefutable` variant, by taking a pre-existing “simplification” step and fusing it directly into `MatchPairTree::for_pattern`. Unfortunately, in doing so it also reinforced a very high degree of coupling between the transformations performed in `match_pair`, and the data structures used by later steps. My hope is that these changes will make it easier for follow-up work to further separate decision-making from MIR building when lowering patterns. r? Nadrieril
mir_build: Add an extra intermediate step in MIR building for patterns This is an attempt to partly decouple the data structures created by `match_pair.rs` from the data structures that are ultimately consumed by the main part of match lowering. In some ways this is a reversal from rust-lang#137875. That PR succeeded in removing the `TestCase::Irrefutable` variant, by taking a pre-existing “simplification” step and fusing it directly into `MatchPairTree::for_pattern`. Unfortunately, in doing so it also reinforced a very high degree of coupling between the transformations performed in `match_pair`, and the data structures used by later steps. My hope is that these changes will make it easier for follow-up work to further separate decision-making from MIR building when lowering patterns. r? Nadrieril
Rollup of 25 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #156222 (Stabilize `Result::map_or_default` and `Option::map_or_default`) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #156573 (Add unwinder_private_data_size for wasm64 target) - #156783 (docs: make `Rc::into_raw` clickable in `Rc::increment_strong_count` doc) - #156840 (Stabilize `PathBuf::into_string`) - #156936 (Remove FIXME about impl PinCoerceUnsized for UnsafePinned<T>) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157380 (clarify compiler_fence (and fence) docs) - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) - #157531 (ci: bump x86_64-gnu base image to 26.04) - #157556 (Add `BTree::append()` change to 1.96.0 relnotes) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
Rollup merge of #155144 - Zalathar:inter-pat, r=Nadrieril mir_build: Add an extra intermediate step in MIR building for patterns This is an attempt to partly decouple the data structures created by `match_pair.rs` from the data structures that are ultimately consumed by the main part of match lowering. In some ways this is a reversal from #137875. That PR succeeded in removing the `TestCase::Irrefutable` variant, by taking a pre-existing “simplification” step and fusing it directly into `MatchPairTree::for_pattern`. Unfortunately, in doing so it also reinforced a very high degree of coupling between the transformations performed in `match_pair`, and the data structures used by later steps. My hope is that these changes will make it easier for follow-up work to further separate decision-making from MIR building when lowering patterns. r? Nadrieril
Rollup of 25 pull requests Successful merges: - rust-lang/rust#157251 (`rust-analyzer` subtree update) - rust-lang/rust#157533 (Subtree sync for rustc_codegen_cranelift) - rust-lang/rust#154742 (Add APIs for case folding to the standard library) - rust-lang/rust#155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - rust-lang/rust#156222 (Stabilize `Result::map_or_default` and `Option::map_or_default`) - rust-lang/rust#157016 (add `extern "tail"` calling convention) - rust-lang/rust#157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - rust-lang/rust#157386 (Parse deprecated note links separately in rustc_resolve) - rust-lang/rust#157483 (fix windows-gnu TLS leak) - rust-lang/rust#157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - rust-lang/rust#157509 (remove solaris implementation for File::lock, it has the wrong semantics) - rust-lang/rust#157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - rust-lang/rust#156136 (Move tests box) - rust-lang/rust#156573 (Add unwinder_private_data_size for wasm64 target) - rust-lang/rust#156783 (docs: make `Rc::into_raw` clickable in `Rc::increment_strong_count` doc) - rust-lang/rust#156840 (Stabilize `PathBuf::into_string`) - rust-lang/rust#156936 (Remove FIXME about impl PinCoerceUnsized for UnsafePinned<T>) - rust-lang/rust#157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - rust-lang/rust#157380 (clarify compiler_fence (and fence) docs) - rust-lang/rust#157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - rust-lang/rust#157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - rust-lang/rust#157494 (Convert `QueryRegionConstraint` into a struct) - rust-lang/rust#157526 (std tests: skip a slow test on Miri) - rust-lang/rust#157531 (ci: bump x86_64-gnu base image to 26.04) - rust-lang/rust#157556 (Add `BTree::append()` change to 1.96.0 relnotes) Failed merges: - rust-lang/rust#155527 (Replace printables table with `unicode_data.rs` tables)
|
for #157558 @rust-timer build e6eba30 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e6eba30): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 514.705s -> 517.685s (0.58%) |
|
This caused the regression in #157558. Looks like the pre-merge run didn't mark a similarly sized regression in html5ever as significant but something of that magnitude was already there. This doesn't look like that big of a deal to me, but it might be worth a second look just in case this is unexpected. |
|
Indeed yeah, that type of delta is well within the "can completely ignore" range, as far as I'm used to do things. |
Rollup of 25 pull requests Successful merges: - rust-lang/rust#157251 (`rust-analyzer` subtree update) - rust-lang/rust#157533 (Subtree sync for rustc_codegen_cranelift) - rust-lang/rust#154742 (Add APIs for case folding to the standard library) - rust-lang/rust#155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - rust-lang/rust#156222 (Stabilize `Result::map_or_default` and `Option::map_or_default`) - rust-lang/rust#157016 (add `extern "tail"` calling convention) - rust-lang/rust#157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - rust-lang/rust#157386 (Parse deprecated note links separately in rustc_resolve) - rust-lang/rust#157483 (fix windows-gnu TLS leak) - rust-lang/rust#157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - rust-lang/rust#157509 (remove solaris implementation for File::lock, it has the wrong semantics) - rust-lang/rust#157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - rust-lang/rust#156136 (Move tests box) - rust-lang/rust#156573 (Add unwinder_private_data_size for wasm64 target) - rust-lang/rust#156783 (docs: make `Rc::into_raw` clickable in `Rc::increment_strong_count` doc) - rust-lang/rust#156840 (Stabilize `PathBuf::into_string`) - rust-lang/rust#156936 (Remove FIXME about impl PinCoerceUnsized for UnsafePinned<T>) - rust-lang/rust#157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - rust-lang/rust#157380 (clarify compiler_fence (and fence) docs) - rust-lang/rust#157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - rust-lang/rust#157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - rust-lang/rust#157494 (Convert `QueryRegionConstraint` into a struct) - rust-lang/rust#157526 (std tests: skip a slow test on Miri) - rust-lang/rust#157531 (ci: bump x86_64-gnu base image to 26.04) - rust-lang/rust#157556 (Add `BTree::append()` change to 1.96.0 relnotes) Failed merges: - rust-lang/rust#155527 (Replace printables table with `unicode_data.rs` tables)
View all comments
This is an attempt to partly decouple the data structures created by
match_pair.rsfrom the data structures that are ultimately consumed by the main part of match lowering.In some ways this is a reversal from #137875. That PR succeeded in removing the
TestCase::Irrefutablevariant, by taking a pre-existing “simplification” step and fusing it directly intoMatchPairTree::for_pattern. Unfortunately, in doing so it also reinforced a very high degree of coupling between the transformations performed inmatch_pair, and the data structures used by later steps.My hope is that these changes will make it easier for follow-up work to further separate decision-making from MIR building when lowering patterns.
r? Nadrieril