mir_build: Add an extra intermediate step in MIR building for patterns #155144
mir_build: Add an extra intermediate step in MIR building for patterns #155144Zalathar wants to merge 2 commits into
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 |
This comment has been minimized.
This comment has been minimized.
|
(Rebased onto main to make things easier; no actual changes yet.) |
|
Updated some comments (diff); still considering what to do about the style feedback. |
2165ec3 to
6a94268
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Still waiting on you, right? @rustbot author |
|
Oh I thought I was waiting for you, but I'll do another self-review pass before kicking this back to ready. 😅 |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
This makes it easier to perform coordinated modifications to `FlatPat::new` and `MatchPairTree::from_pattern`, because the two functions are heavily coupled.
This splits out a separate `InterPat` data structure from `MatchPairTree`/`FlatPat`/`Candidate`, which should hopefully make it easier to modify these earlier parts of match lowering without having to simultaneously adjust many use-sites in later steps.
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