-
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
coverage: Don't rely on the custom traversal to find enclosing loops #132091
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
88a4970
to
e9a7bb4
Compare
Clarified that dominator order doesn't have to be reverse postorder; that's just what it currently is (diff). |
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.
lgtm
pub(crate) fn loop_headers_containing( | ||
&self, | ||
bcb: BasicCoverageBlock, | ||
) -> impl Iterator<Item = BasicCoverageBlock> + Captures<'_> { |
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.
just a side note here, the Rust 1.82 release notes mention that we now have dedicated use<>
syntax to replace Captures
, and this eventually becoming the default in Rust 2024.
Though I believe + '_
would also work here, as the &self
lifelime is the only one captured here?
I also don’t really know what the current conventions for compiler code are related to all this.
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.
Oh, is that stable now? Nice.
I think I'm going to stick with Captures
for now. After the compiler switches over to Rust 2024, someone will probably go through and try to rip out unnecessary uses of Captures
, and it will be easier to find and migrate this code if it matches the prevailing style in the rest of the compiler.
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (e454c45): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.4%)This 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.
CyclesResults (primary 1.1%)This 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: 783.844s -> 783.471s (-0.05%) |
This opens up the possibility of modifying or removing the custom graph traversal used in coverage counter creation, without losing access to the heuristics that care about a node's enclosing loops.
Actually changing the traversal is left for future work, because this PR on its own doesn't change the emitted coverage mappings at all.