-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split rustc_mir #80522
Split rustc_mir #80522
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
85ccd81
to
f53a7e0
Compare
The old dependency graph is
, the new dependency graph is
Does this actually improve build performance? |
r? @ecstatic-morse on the specifics (as gitHub suggests) in case this improves the build in general (in which I'm not sure). |
some strange results from cargo timing for this PR on my 32 thread cpu. |
This new version now splits the rustc_mir crate into four:
|
☔ The latest upstream changes (presumably #80655) made this pull request unmergeable. Please resolve the merge conflicts. |
@cjgillot Please update the PR summary and title to reflect the status quo. I think this is the right direction. Even though The dataflow framework should also be separable with little effort. It depends on a few I think it's beneficial to do these big refactorings all in one go, so that people don't have to adjust their workflow for the intermediate state, only for it to change again a few months later. I also think you should try to publicize these changes somehow. r? @wesleywiser (compiler-team lead and MIR opt person) for a final sign-off or referral to MCP. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
217507a
to
c184d57
Compare
This comment has been minimized.
This comment has been minimized.
c184d57
to
d4b9410
Compare
@@ -296,7 +296,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { | |||
/// Note that for a given layout, this operation will either always fail or always | |||
/// succeed! Whether it succeeds depends on whether the layout can be represented | |||
/// in an `Immediate`, not on which data is stored there currently. | |||
pub(crate) fn try_read_immediate( | |||
pub fn try_read_immediate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to expose these methods publicly is not great.... that's the issue with this crate splitting business: it makes it a lot harder to uphold invariants inside modules like the interpreter engine.
Finished benchmarking commit (97032a6): comparison url. Summary: This change led to large relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
@cjgillot @oli-obk This seems to have hurt the bootstrap time by perf.r-l.o's measurement and the results for individual benchmarks are also mixed. Is there reason to believe that measurement is flawed? Did we measure before this splitting? (I suppose recompilations with smaller changes may be helped by it...). |
perf.r-l.o only checks the bootstra time for individual crates. It doesn't check the bootstrap time when multiple crates can compile at the same time, which is what this was meant to improve. |
rust-lang/rust#80522 split the `rustc_mir` crates into 5 crates, effectively invalidating all the direct links to `rustc_mir` in the docs. I found this while looking at the Two Phase Borrows doc, which is why I am giving out this PR to fix this.
I think the regressions here are unfortunate, but I don't think we're going to do anything about them. I think it's potentially true there's more parallelism here but it's also true that these crates are somewhat interconnected regardless (the dependency tree goes through most of the new crates linearly, rather than as siblings), but regardless, it seems like a better factoring is in theory going to make other aspects of this easier in the future. Marking as triaged. @rustbot label +perf-regression-triaged |
Remove box syntax from rustc_mir_dataflow and rustc_mir_transform Continuation of rust-lang#87781, inspired by rust-lang#97239. The usages that this PR removes have not appeared from nothing, instead the usage in `rustc_mir_dataflow` and `rustc_mir_transform` was from rust-lang#80522 which split up `rustc_mir`, and which was filed before I filed rust-lang#87781, so it was using the state from before my PR. But it was merged after my PR was merged, so the `box_syntax` uses were able to survive here. Outside of this introduction due to the code being outside of the master branch at the point of merging of my PR, there was only one other introduction of box syntax, in rust-lang#95159. That box syntax was removed again though in rust-lang#95555. Outside of that, `box_syntax` has not made its reoccurrance in compiler crates.
The
rustc_mir
crate is the second largest in the compiler.This PR splits it up into 5 crates: