-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Elide superfluous storage markers #99946
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit c9d476336c00f9ffd444b7203c5b9d9b5d1d00d7 with merge 467f2108b6f0f8a8c387d759b25d440430e7e572... |
☀️ Try build successful - checks-actions |
Queued 467f2108b6f0f8a8c387d759b25d440430e7e572 with parent 110777b, future comparison URL. |
Finished benchmarking commit (467f2108b6f0f8a8c387d759b25d440430e7e572): 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 |
c9d4763
to
33c614e
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 33c614ec0dc321327621b90936ad4d19fd659237 with merge 0ea3f3531361953de2d99a64b714377969aa108b... |
33c614e
to
df0f5e9
Compare
@bors try- |
df0f5e9
to
49ca4af
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 49ca4afb560812b0328e6beaa1c0b3709e841316 with merge b5d548b9a46d827dc93bcd09057231b8201a446e... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued b5d548b9a46d827dc93bcd09057231b8201a446e with parent a231865, future comparison URL. |
This feature of MIR patch system is no longer used.
14af9eb
to
f8ca6aa
Compare
@@ -616,7 +616,9 @@ impl<'tcx> Inliner<'tcx> { | |||
// If there are any locals without storage markers, give them storage only for the | |||
// duration of the call. | |||
for local in callee_body.vars_and_temps_iter() { | |||
if integrator.always_live_locals.contains(local) { | |||
if !callee_body.local_decls[local].internal |
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.
cc @rust-lang/wg-const-eval I think we could do something similar for internal locals without storage markers in const eval. Basically not eagerly initialize them and also not error when writing to them without marking them as live first.
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.
Sounds like you are suggesting a change to the operational semantics of MIR? I don't quite understand what change you are suggesting, though.
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.
Somewhat. We'd need to change MIR validation to make sure that internal locals are only referenced after being assigned to first. If that is guaranteed, then it's just an evaluator optimization to lazily initialize internal locals
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.
We'd also have to make sure that syntactically they are never accessed after the StorageDead, and that they never have their address taken. Otherwise we could miss UB.
@bors r+ |
@bors r- |
@bors r=oli-obk rollup=never Marking as triaged based on perf comparision without codegen unit partitioning bias #99946 (comment). |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5462da5): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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 |
Follow the existing strategy of omitting the storage markers for temporaries
introduced for internal usage when elaborating derefs and deref projections.
Those temporaries are simple scalars which are used immediately after being
defined and never have their address taken. There is no benefit from storage
markers from either liveness analysis or code generation perspective.