about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/errors.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-02-11 14:09:11 +1100
committerZalathar <Zalathar@users.noreply.github.com>2025-02-13 13:45:53 +1100
commitab786d3b98d640b1208eff371c1184e3e8ce1d17 (patch)
treef215f03b8300fe0151f46b9922d2ca053604770d /compiler/rustc_mir_transform/src/errors.rs
parentef148cd7eb00a5a973130dc6473da71fd6c487ee (diff)
downloadrust-ab786d3b98d640b1208eff371c1184e3e8ce1d17.tar.gz
rust-ab786d3b98d640b1208eff371c1184e3e8ce1d17.zip
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.
Diffstat (limited to 'compiler/rustc_mir_transform/src/errors.rs')
0 files changed, 0 insertions, 0 deletions