coverage: Don't rely on the custom traversal to find enclosing loops#132091
coverage: Don't rely on the custom traversal to find enclosing loops#132091bors merged 1 commit intorust-lang:masterfrom
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). |
| pub(crate) fn loop_headers_containing( | ||
| &self, | ||
| bcb: BasicCoverageBlock, | ||
| ) -> impl Iterator<Item = BasicCoverageBlock> + Captures<'_> { |
There was a problem hiding this comment.
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.
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.