rust/compiler/rustc_mir_transform/src/coverage
Zalathar ab786d3b98 coverage: Eliminate more counters by giving them to unreachable nodes
When preparing a function's coverage counters and metadata during codegen, any
part of the original coverage graph that was removed by MIR optimizations can
be treated as having an execution count of zero.

Somewhat counter-intuitively, if we give those unreachable nodes a _higher_
priority for receiving physical counters (instead of counter expressions), that
ends up reducing the total number of physical counters needed.

This works because if a node is unreachable, we don't actually create a
physical counter for it. Instead that node gets a fixed zero counter, and any
other node that would have relied on that physical counter in its counter
expression can just ignore that term completely.
2025-02-13 13:45:53 +11:00
..
counters Rollup merge of #136053 - Zalathar:defer-counters, r=saethlin 2025-02-10 00:51:49 -08:00
spans coverage: Defer part of counter-creation until codegen 2025-02-06 21:44:31 +11:00
counters.rs coverage: Eliminate more counters by giving them to unreachable nodes 2025-02-13 13:45:53 +11:00
graph.rs coverage: Store BCB node IDs in mappings, and resolve them in codegen 2025-02-06 21:44:29 +11:00
mappings.rs coverage: Defer part of counter-creation until codegen 2025-02-06 21:44:31 +11:00
mod.rs coverage: Defer part of counter-creation until codegen 2025-02-06 21:44:31 +11:00
query.rs coverage: Eliminate more counters by giving them to unreachable nodes 2025-02-13 13:45:53 +11:00
spans.rs coverage: Rename basic_coverage_blocks to just graph 2024-12-20 17:48:59 +11:00
tests.rs Rustfmt 2025-02-08 22:12:13 +00:00
unexpand.rs coverage: Treat await similar to a macro 2024-09-06 17:01:59 +12:00