-
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
Only run MaybeInitializedPlaces dataflow once to elaborate drops #111555
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 6185b06e28ff0e0699b0b4c13f8a1375371cc13e with merge 4436f122442131f57e5dcd6b62dd883bfd5e8204... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4436f122442131f57e5dcd6b62dd883bfd5e8204): comparison URL. Overall result: ✅ improvements - no 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. @bors rollup=never 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 660.613s -> 659.115s (-0.23%) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? compiler |
let mut reachable = BitSet::new_empty(body.basic_blocks.len()); | ||
for bb in body.basic_blocks.indices() { | ||
if inits.results().entry_set_for_block(bb).is_reachable() { | ||
reachable.insert(bb); | ||
} | ||
} |
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.
It looks like reachable
and all uses that follow could be removed now. Do you think it is still useful? As I understand, this boils down to difference between unreachable unelaborated drop, and unreachable elaborated drop that doesn't drop anything. So it might be simpler to just remove this.
Although, in any case, to minimize the diff I would leave that for a potential followup.
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.
This is still used to avoid a seek into an unreachable block. The dataflow framework ICEs in certain conditions in those cases.
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.
Initially there are no structurally unreachable blocks (in a sense of traversal::reachable
), so we can execute the dataflow engine without running into ICE. In the new approach, the subsequent execution of dataflow engine uses the same MIR body, so we shouldn't have any structurally unreachable blocks still.
☔ The latest upstream changes (presumably #112016) made this pull request unmergeable. Please resolve the merge conflicts. |
261b20e
to
168e725
Compare
This comment has been minimized.
This comment has been minimized.
a7fafc8
to
6930099
Compare
☔ The latest upstream changes (presumably #113102) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #112882) made this pull request unmergeable. Please resolve the merge conflicts. |
84f47e9
to
9f2da27
Compare
This comment has been minimized.
This comment has been minimized.
9f2da27
to
5b2524e
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f3b4c67): 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 635.21s -> 632.126s (-0.49%) |
This pass allows forward dataflow analyses to modify the CFG depending on the dataflow state. This possibility is used for the
MaybeInitializedPlace
analysis in drop elaboration, to skip the dataflow effect of dead unwinds without having to compute dataflow twice.