-
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: Use a query to identify which counter/expression IDs are used #133446
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
drop(coverage_map); | ||
let cond_bitmap = bx.coverage_cx() | ||
.try_get_mcdc_condition_bitmap(&instance, decision_depth) | ||
.expect("mcdc cond bitmap should have been allocated for merging into the global bitmap"); |
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.
For some reason this long string causes rustfmt to completely give up on the enclosing statement, so I've split it up to work around that.
☔ The latest upstream changes (presumably #133551) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased due to import conflicts; no changes. |
not familiar with coverage, sorry r? compiler |
not familiar with coverage either, sorry r? compiler |
☔ The latest upstream changes (presumably #133608) made this pull request unmergeable. Please resolve the merge conflicts. |
This context is stored in `CodegenCx`, which makes it per-CGU rather than per-crate. A single crate can have multiple CGUs.
There is unlikely to be any practical difference between a counter limit of 2^32 and a counter limit of (2^32 - 256).
This is currently handled automatically by the fact that codegen doesn't visit coverage statements in unused functions, but that will no longer be the case when unused IDs are identified by a separate query instead.
Rebased again; no changes. |
@bors r+ rollup |
Rollup of 5 pull requests Successful merges: - rust-lang#131416 (Mark `slice::copy_from_slice` unstably const) - rust-lang#131784 (Stabilize unsigned and float variants of `num_midpoint` feature) - rust-lang#133446 (coverage: Use a query to identify which counter/expression IDs are used) - rust-lang#133711 (add isatty doc alias for `is_terminal`) - rust-lang#133712 (rust_analyzer_settings: force use of 'nightly' toolchain) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133446 - Zalathar:querify, r=cjgillot coverage: Use a query to identify which counter/expression IDs are used Given that we already have a query to identify the highest-numbered counter ID in a MIR body, we can extend that query to also build bitsets of used counter/expression IDs. That lets us avoid some messy coverage bookkeeping during the main MIR traversal for codegen. This does mean that we fail to treat some IDs as used in certain MIR-inlining scenarios, but I think that's fine, because it means that the results will be consistent across all instantiations of a function. --- There's some more cleanup I want to do in the function coverage collector, since it isn't really collecting anything any more, but I'll leave that for future work.
coverage: Use a query to find counters/expressions that must be zero As of rust-lang#133446, this query (`coverage_ids_info`) determines which counter/expression IDs are unused. So with only a little extra work, we can take the code that was using that information to determine which coverage counters/expressions must be zero, and move that inside the query as well. There should be no change in compiler output.
coverage: Use a query to find counters/expressions that must be zero As of rust-lang#133446, this query (`coverage_ids_info`) determines which counter/expression IDs are unused. So with only a little extra work, we can take the code that was using that information to determine which coverage counters/expressions must be zero, and move that inside the query as well. There should be no change in compiler output.
coverage: Use a query to find counters/expressions that must be zero As of rust-lang#133446, this query (`coverage_ids_info`) determines which counter/expression IDs are unused. So with only a little extra work, we can take the code that was using that information to determine which coverage counters/expressions must be zero, and move that inside the query as well. There should be no change in compiler output.
coverage: Use a query to find counters/expressions that must be zero As of rust-lang#133446, this query (`coverage_ids_info`) determines which counter/expression IDs are unused. So with only a little extra work, we can take the code that was using that information to determine which coverage counters/expressions must be zero, and move that inside the query as well. There should be no change in compiler output.
Rollup merge of rust-lang#134029 - Zalathar:zero, r=oli-obk coverage: Use a query to find counters/expressions that must be zero As of rust-lang#133446, this query (`coverage_ids_info`) determines which counter/expression IDs are unused. So with only a little extra work, we can take the code that was using that information to determine which coverage counters/expressions must be zero, and move that inside the query as well. There should be no change in compiler output.
Given that we already have a query to identify the highest-numbered counter ID in a MIR body, we can extend that query to also build bitsets of used counter/expression IDs. That lets us avoid some messy coverage bookkeeping during the main MIR traversal for codegen.
This does mean that we fail to treat some IDs as used in certain MIR-inlining scenarios, but I think that's fine, because it means that the results will be consistent across all instantiations of a function.
There's some more cleanup I want to do in the function coverage collector, since it isn't really collecting anything any more, but I'll leave that for future work.