-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: Simplify the coverageinfo
query
#115586
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
The two-pass structure seems to have served some purpose prior to #113428, when we couldn't know for sure whether an operand was a counter ID or expression ID just by looking at it. That distinction is now preserved explicitly by the |
@rustbot label +A-code-coverage |
910e632
to
2788b2a
Compare
…ents Both of the coverage queries can now use this one helper function to iterate over all of the `mir::Coverage` payloads in the statements of a `mir::Body`.
This makes the visitor track the highest seen counter/expression IDs directly, and only add +1 (to convert to a vector length) at the very end.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (69ec430): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. 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: 628.971s -> 628.962s (-0.00%) |
The
coverageinfo
query walks through amir::Body
's statements to find the total number of coverage counter IDs and coverage expression IDs that have been used, as this information is needed by coverage codegen.This PR makes 3 nice simplifications to that query:
I also updated some related comments. Some had been invalidated by these changes, while others had already been invalidated by previous coverage changes.