-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Enable MIR inlining for generators too #99782
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit a4a8252e576a22eae530dc638bf98102f566f4d8 with merge ac9b18299e23be0ac59586be05a93e8e9e0f54d8... |
☀️ Try build successful - checks-actions |
Queued ac9b18299e23be0ac59586be05a93e8e9e0f54d8 with parent c11207e, future comparison URL. |
Finished benchmarking commit (ac9b18299e23be0ac59586be05a93e8e9e0f54d8): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.
Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Footnotes |
r? rust-lang/compiler |
The issue with |
This comment has been minimized.
This comment has been minimized.
457f7df
to
10c9543
Compare
☔ The latest upstream changes (presumably #99780) made this pull request unmergeable. Please resolve the merge conflicts. |
10c9543
to
6ff150c
Compare
☔ The latest upstream changes (presumably #100089) made this pull request unmergeable. Please resolve the merge conflicts. |
6ff150c
to
1a47e5d
Compare
☔ The latest upstream changes (presumably #99908) made this pull request unmergeable. Please resolve the merge conflicts. |
1a47e5d
to
c75d32c
Compare
☔ The latest upstream changes (presumably #99946) made this pull request unmergeable. Please resolve the merge conflicts. |
c75d32c
to
24722aa
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 24722aac770190c699585342078635d9e478696b with merge f33592845aa45f6bdcf5e797c6209813fe179704... |
24722aa
to
9b0c4be
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 9b0c4be7988c3d7906f99e86af021fd9fe6199dd with merge 22ba33181fb0c3e6588779a40a43dae8865e3993... |
☀️ Try build successful - checks-actions |
Queued 22ba33181fb0c3e6588779a40a43dae8865e3993 with parent d0e1491, future comparison URL. |
Finished benchmarking commit (22ba33181fb0c3e6588779a40a43dae8865e3993): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Warning ⚠: The following benchmark(s) failed to build:
Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
9b0c4be
to
3128b8f
Compare
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras |
☔ The latest upstream changes (presumably #101086) made this pull request unmergeable. Please resolve the merge conflicts. |
From perf results, this does not seem to be worth it. |
I agree that we should maybe not be turning this on right now, but I'd also caution against just using perf results here. Compile time perf is not the same as runtime perf, and also in general this will enable other optimizations that we may take advantage of in the future. I expect that we will want to revive this PR at some point. |
Agreed, I think there might be code quality reasons to enable this in the future. I do wonder though if inlining into generators is what we want. It seems plausible to me that keeping the generator code as small as possible might enable better inlining of the generator into its callsite which could also be beneficial to runtime performance. |
Hmm, what makes you think that generators are more affected by this than any other function? |
This is a tentative to enable MIR inlining on generators too.
This PR proceeds in 2 steps:
mir_generator_lowered
andmir_generator_info
;generator_resume
function).This PR took the opportunity to simplify the generated
generator_drop
code, since it won't be optimized on its own.