about summary refs log tree commit diff
path: root/tests/coverage/assert_not.cov-map
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 /tests/coverage/assert_not.cov-map
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 'tests/coverage/assert_not.cov-map')
-rw-r--r--tests/coverage/assert_not.cov-map12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/coverage/assert_not.cov-map b/tests/coverage/assert_not.cov-map
index 35568a98af4..526110ebbb7 100644
--- a/tests/coverage/assert_not.cov-map
+++ b/tests/coverage/assert_not.cov-map
@@ -1,13 +1,13 @@
 Function name: assert_not::main
-Raw bytes (29): 0x[01, 01, 00, 05, 01, 06, 01, 01, 12, 05, 02, 05, 00, 14, 09, 01, 05, 00, 14, 0d, 01, 05, 00, 16, 0d, 01, 01, 00, 02]
+Raw bytes (29): 0x[01, 01, 00, 05, 01, 06, 01, 01, 12, 01, 02, 05, 00, 14, 01, 01, 05, 00, 14, 01, 01, 05, 00, 16, 01, 01, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 0
 Number of file 0 mappings: 5
 - Code(Counter(0)) at (prev + 6, 1) to (start + 1, 18)
-- Code(Counter(1)) at (prev + 2, 5) to (start + 0, 20)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 20)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 22)
-- Code(Counter(3)) at (prev + 1, 1) to (start + 0, 2)
-Highest counter ID seen: c3
+- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 22)
+- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
+Highest counter ID seen: c0