Skip to content

Commit 3252548

Browse files
authored
Unrolled build for rust-lang#133849
Rollup merge of rust-lang#133849 - Zalathar:replay, r=oli-obk coverage: Use a separate counter type and simplification step during counter creation When instrumenting a function's MIR for coverage, there is a point where we need to decide, for each node in the control-flow graph, whether its execution count will be tracked by a physical counter, or by an expression that combines physical counters from other parts of the graph. Currently the code for doing that is heavily tied to the final form of the LLVM coverage mapping format, and performs some important simplification steps on-the-fly. These factors make the code extremely difficult to modify without breaking or massively worsening the resulting coverage-instrumentation metadata. --- This PR aims to improve that situation somewhat by adding an extra intermediate representation between the code that chooses how each node will be counted, and the code that converts those decisions into actual tables of physical counters and trees of counter expressions. As part of doing that, some of the simplifications that are currently performed during the main counter creation step have been pulled out into a separate step. In most cases the resulting coverage metadata is equivalent, slightly better, or slightly worse. The biggest outlier is `counters.rs`, where the coverage metadata ends up about 10% larger. This seems to be the result of the new approach having less subexpression sharing (because it relies on flatten-sort-cancel), and therefore being less effective at taking advantage of MIR optimizations to replace counters for unused control-flow with zeroes. I think the modest downside is acceptable in light of the future possibilities opened up by this decoupling.
2 parents 96e51d9 + ba08056 commit 3252548

38 files changed

+1719
-1589
lines changed

compiler/rustc_mir_transform/src/coverage/counters.rs

+230-144
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
use std::fmt::Debug;
2+
3+
use super::sort_and_cancel;
4+
5+
fn flatten<T>(input: Vec<Option<T>>) -> Vec<T> {
6+
input.into_iter().flatten().collect()
7+
}
8+
9+
fn sort_and_cancel_and_flatten<T: Clone + Ord>(pos: Vec<T>, neg: Vec<T>) -> (Vec<T>, Vec<T>) {
10+
let (pos_actual, neg_actual) = sort_and_cancel(pos, neg);
11+
(flatten(pos_actual), flatten(neg_actual))
12+
}
13+
14+
#[track_caller]
15+
fn check_test_case<T: Clone + Debug + Ord>(
16+
pos: Vec<T>,
17+
neg: Vec<T>,
18+
pos_expected: Vec<T>,
19+
neg_expected: Vec<T>,
20+
) {
21+
eprintln!("pos = {pos:?}; neg = {neg:?}");
22+
let output = sort_and_cancel_and_flatten(pos, neg);
23+
assert_eq!(output, (pos_expected, neg_expected));
24+
}
25+
26+
#[test]
27+
fn cancellation() {
28+
let cases: &[(Vec<u32>, Vec<u32>, Vec<u32>, Vec<u32>)] = &[
29+
(vec![], vec![], vec![], vec![]),
30+
(vec![4, 2, 1, 5, 3], vec![], vec![1, 2, 3, 4, 5], vec![]),
31+
(vec![5, 5, 5, 5, 5], vec![5], vec![5, 5, 5, 5], vec![]),
32+
(vec![1, 1, 2, 2, 3, 3], vec![1, 2, 3], vec![1, 2, 3], vec![]),
33+
(vec![1, 1, 2, 2, 3, 3], vec![2, 4, 2], vec![1, 1, 3, 3], vec![4]),
34+
];
35+
36+
for (pos, neg, pos_expected, neg_expected) in cases {
37+
check_test_case(pos.to_vec(), neg.to_vec(), pos_expected.to_vec(), neg_expected.to_vec());
38+
// Same test case, but with its inputs flipped and its outputs flipped.
39+
check_test_case(neg.to_vec(), pos.to_vec(), neg_expected.to_vec(), pos_expected.to_vec());
40+
}
41+
}

compiler/rustc_mir_transform/src/coverage/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use rustc_span::source_map::SourceMap;
2525
use rustc_span::{BytePos, Pos, SourceFile, Span};
2626
use tracing::{debug, debug_span, trace};
2727

28-
use crate::coverage::counters::{CounterIncrementSite, CoverageCounters};
28+
use crate::coverage::counters::{CoverageCounters, Site};
2929
use crate::coverage::graph::CoverageGraph;
3030
use crate::coverage::mappings::ExtractedMappings;
3131

@@ -265,13 +265,13 @@ fn inject_coverage_statements<'tcx>(
265265
coverage_counters: &CoverageCounters,
266266
) {
267267
// Inject counter-increment statements into MIR.
268-
for (id, counter_increment_site) in coverage_counters.counter_increment_sites() {
268+
for (id, site) in coverage_counters.counter_increment_sites() {
269269
// Determine the block to inject a counter-increment statement into.
270270
// For BCB nodes this is just their first block, but for edges we need
271271
// to create a new block between the two BCBs, and inject into that.
272-
let target_bb = match *counter_increment_site {
273-
CounterIncrementSite::Node { bcb } => basic_coverage_blocks[bcb].leader_bb(),
274-
CounterIncrementSite::Edge { from_bcb, to_bcb } => {
272+
let target_bb = match site {
273+
Site::Node { bcb } => basic_coverage_blocks[bcb].leader_bb(),
274+
Site::Edge { from_bcb, to_bcb } => {
275275
// Create a new block between the last block of `from_bcb` and
276276
// the first block of `to_bcb`.
277277
let from_bb = basic_coverage_blocks[from_bcb].last_bb();

tests/coverage/abort.cov-map

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
Function name: abort::main
2-
Raw bytes (89): 0x[01, 01, 0a, 01, 27, 05, 09, 03, 0d, 22, 11, 03, 0d, 03, 0d, 22, 15, 03, 0d, 03, 0d, 05, 09, 0d, 01, 0d, 01, 01, 1b, 03, 02, 0b, 00, 18, 22, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 0e, 02, 09, 00, 0a, 22, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 1a, 00, 30, 00, 31, 22, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 30, 00, 31, 27, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
2+
Raw bytes (89): 0x[01, 01, 0a, 07, 09, 01, 05, 03, 0d, 03, 13, 0d, 11, 03, 0d, 03, 1f, 0d, 15, 03, 0d, 05, 09, 0d, 01, 0d, 01, 01, 1b, 03, 02, 0b, 00, 18, 22, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 0e, 02, 09, 00, 0a, 22, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 1a, 00, 30, 00, 31, 22, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 30, 00, 31, 27, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 10
6-
- expression 0 operands: lhs = Counter(0), rhs = Expression(9, Add)
7-
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
6+
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2)
7+
- expression 1 operands: lhs = Counter(0), rhs = Counter(1)
88
- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3)
9-
- expression 3 operands: lhs = Expression(8, Sub), rhs = Counter(4)
10-
- expression 4 operands: lhs = Expression(0, Add), rhs = Counter(3)
9+
- expression 3 operands: lhs = Expression(0, Add), rhs = Expression(4, Add)
10+
- expression 4 operands: lhs = Counter(3), rhs = Counter(4)
1111
- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(3)
12-
- expression 6 operands: lhs = Expression(8, Sub), rhs = Counter(5)
13-
- expression 7 operands: lhs = Expression(0, Add), rhs = Counter(3)
12+
- expression 6 operands: lhs = Expression(0, Add), rhs = Expression(7, Add)
13+
- expression 7 operands: lhs = Counter(3), rhs = Counter(5)
1414
- expression 8 operands: lhs = Expression(0, Add), rhs = Counter(3)
1515
- expression 9 operands: lhs = Counter(1), rhs = Counter(2)
1616
Number of file 0 mappings: 13
1717
- Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27)
1818
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
19-
= (c0 + (c1 + c2))
19+
= ((c0 + c1) + c2)
2020
- Code(Expression(8, Sub)) at (prev + 1, 12) to (start + 0, 25)
21-
= ((c0 + (c1 + c2)) - c3)
21+
= (((c0 + c1) + c2) - c3)
2222
- Code(Counter(4)) at (prev + 0, 26) to (start + 2, 10)
2323
- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10)
24-
= (((c0 + (c1 + c2)) - c3) - c4)
24+
= (((c0 + c1) + c2) - (c3 + c4))
2525
- Code(Expression(8, Sub)) at (prev + 2, 12) to (start + 0, 25)
26-
= ((c0 + (c1 + c2)) - c3)
26+
= (((c0 + c1) + c2) - c3)
2727
- Code(Counter(5)) at (prev + 0, 26) to (start + 0, 49)
2828
- Code(Expression(6, Sub)) at (prev + 0, 48) to (start + 0, 49)
29-
= (((c0 + (c1 + c2)) - c3) - c5)
29+
= (((c0 + c1) + c2) - (c3 + c5))
3030
- Code(Expression(8, Sub)) at (prev + 4, 12) to (start + 0, 25)
31-
= ((c0 + (c1 + c2)) - c3)
31+
= (((c0 + c1) + c2) - c3)
3232
- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 49)
3333
- Code(Counter(2)) at (prev + 0, 48) to (start + 0, 49)
3434
- Code(Expression(9, Add)) at (prev + 1, 9) to (start + 0, 23)

tests/coverage/assert.cov-map

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
Function name: assert::main
2-
Raw bytes (65): 0x[01, 01, 08, 01, 1b, 05, 1f, 09, 0d, 03, 11, 16, 05, 03, 11, 05, 1f, 09, 0d, 09, 01, 09, 01, 01, 1b, 03, 02, 0b, 00, 18, 16, 01, 0c, 00, 1a, 05, 00, 1b, 02, 0a, 12, 02, 13, 00, 20, 09, 00, 21, 02, 0a, 0d, 02, 09, 00, 0a, 1b, 01, 09, 00, 17, 11, 02, 05, 01, 02]
2+
Raw bytes (67): 0x[01, 01, 09, 07, 0d, 0b, 09, 01, 05, 03, 11, 17, 11, 1b, 0d, 01, 09, 23, 0d, 05, 09, 09, 01, 09, 01, 01, 1b, 03, 02, 0b, 00, 18, 0e, 01, 0c, 00, 1a, 05, 00, 1b, 02, 0a, 12, 02, 13, 00, 20, 09, 00, 21, 02, 0a, 0d, 02, 09, 00, 0a, 1f, 01, 09, 00, 17, 11, 02, 05, 01, 02]
33
Number of files: 1
44
- file 0 => global file 1
5-
Number of expressions: 8
6-
- expression 0 operands: lhs = Counter(0), rhs = Expression(6, Add)
7-
- expression 1 operands: lhs = Counter(1), rhs = Expression(7, Add)
8-
- expression 2 operands: lhs = Counter(2), rhs = Counter(3)
5+
Number of expressions: 9
6+
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3)
7+
- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2)
8+
- expression 2 operands: lhs = Counter(0), rhs = Counter(1)
99
- expression 3 operands: lhs = Expression(0, Add), rhs = Counter(4)
10-
- expression 4 operands: lhs = Expression(5, Sub), rhs = Counter(1)
11-
- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(4)
12-
- expression 6 operands: lhs = Counter(1), rhs = Expression(7, Add)
13-
- expression 7 operands: lhs = Counter(2), rhs = Counter(3)
10+
- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4)
11+
- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(3)
12+
- expression 6 operands: lhs = Counter(0), rhs = Counter(2)
13+
- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(3)
14+
- expression 8 operands: lhs = Counter(1), rhs = Counter(2)
1415
Number of file 0 mappings: 9
1516
- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 27)
1617
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
17-
= (c0 + (c1 + (c2 + c3)))
18-
- Code(Expression(5, Sub)) at (prev + 1, 12) to (start + 0, 26)
19-
= ((c0 + (c1 + (c2 + c3))) - c4)
18+
= (((c0 + c1) + c2) + c3)
19+
- Code(Expression(3, Sub)) at (prev + 1, 12) to (start + 0, 26)
20+
= ((((c0 + c1) + c2) + c3) - c4)
2021
- Code(Counter(1)) at (prev + 0, 27) to (start + 2, 10)
2122
- Code(Expression(4, Sub)) at (prev + 2, 19) to (start + 0, 32)
22-
= (((c0 + (c1 + (c2 + c3))) - c4) - c1)
23+
= (((c0 + c2) + c3) - c4)
2324
- Code(Counter(2)) at (prev + 0, 33) to (start + 2, 10)
2425
- Code(Counter(3)) at (prev + 2, 9) to (start + 0, 10)
25-
- Code(Expression(6, Add)) at (prev + 1, 9) to (start + 0, 23)
26-
= (c1 + (c2 + c3))
26+
- Code(Expression(7, Add)) at (prev + 1, 9) to (start + 0, 23)
27+
= ((c1 + c2) + c3)
2728
- Code(Counter(4)) at (prev + 2, 5) to (start + 1, 2)
2829
Highest counter ID seen: c4
2930

tests/coverage/async.cov-map

+12-15
Original file line numberDiff line numberDiff line change
@@ -155,25 +155,25 @@ Number of file 0 mappings: 1
155155
Highest counter ID seen: c0
156156

157157
Function name: async::i::{closure#0}
158-
Raw bytes (63): 0x[01, 01, 02, 07, 19, 11, 15, 0b, 01, 2d, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 15, 01, 09, 00, 0a, 0d, 00, 0e, 00, 17, 1d, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 19, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
158+
Raw bytes (63): 0x[01, 01, 02, 07, 15, 0d, 11, 0b, 01, 2d, 13, 04, 0c, 09, 05, 09, 00, 0a, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 11, 01, 09, 00, 0a, 19, 00, 0e, 00, 17, 1d, 00, 1b, 00, 20, 11, 00, 24, 00, 26, 15, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
159159
Number of files: 1
160160
- file 0 => global file 1
161161
Number of expressions: 2
162-
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(6)
163-
- expression 1 operands: lhs = Counter(4), rhs = Counter(5)
162+
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(5)
163+
- expression 1 operands: lhs = Counter(3), rhs = Counter(4)
164164
Number of file 0 mappings: 11
165165
- Code(Counter(0)) at (prev + 45, 19) to (start + 4, 12)
166166
- Code(Counter(2)) at (prev + 5, 9) to (start + 0, 10)
167167
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 24)
168168
- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 33)
169169
- Code(Counter(2)) at (prev + 0, 39) to (start + 0, 48)
170-
- Code(Counter(5)) at (prev + 1, 9) to (start + 0, 10)
171-
- Code(Counter(3)) at (prev + 0, 14) to (start + 0, 23)
170+
- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 10)
171+
- Code(Counter(6)) at (prev + 0, 14) to (start + 0, 23)
172172
- Code(Counter(7)) at (prev + 0, 27) to (start + 0, 32)
173-
- Code(Counter(5)) at (prev + 0, 36) to (start + 0, 38)
174-
- Code(Counter(6)) at (prev + 1, 14) to (start + 0, 16)
173+
- Code(Counter(4)) at (prev + 0, 36) to (start + 0, 38)
174+
- Code(Counter(5)) at (prev + 1, 14) to (start + 0, 16)
175175
- Code(Expression(0, Add)) at (prev + 2, 1) to (start + 0, 2)
176-
= ((c4 + c5) + c6)
176+
= ((c3 + c4) + c5)
177177
Highest counter ID seen: c7
178178

179179
Function name: async::j
@@ -243,22 +243,19 @@ Number of file 0 mappings: 5
243243
Highest counter ID seen: (none)
244244

245245
Function name: async::l
246-
Raw bytes (37): 0x[01, 01, 04, 01, 07, 05, 09, 0f, 02, 09, 05, 05, 01, 52, 01, 01, 0c, 02, 02, 0e, 00, 10, 05, 01, 0e, 00, 10, 09, 01, 0e, 00, 10, 0b, 02, 01, 00, 02]
246+
Raw bytes (33): 0x[01, 01, 02, 01, 07, 05, 09, 05, 01, 52, 01, 01, 0c, 02, 02, 0e, 00, 10, 09, 01, 0e, 00, 10, 05, 01, 0e, 00, 10, 01, 02, 01, 00, 02]
247247
Number of files: 1
248248
- file 0 => global file 1
249-
Number of expressions: 4
249+
Number of expressions: 2
250250
- expression 0 operands: lhs = Counter(0), rhs = Expression(1, Add)
251251
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
252-
- expression 2 operands: lhs = Expression(3, Add), rhs = Expression(0, Sub)
253-
- expression 3 operands: lhs = Counter(2), rhs = Counter(1)
254252
Number of file 0 mappings: 5
255253
- Code(Counter(0)) at (prev + 82, 1) to (start + 1, 12)
256254
- Code(Expression(0, Sub)) at (prev + 2, 14) to (start + 0, 16)
257255
= (c0 - (c1 + c2))
258-
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 16)
259256
- Code(Counter(2)) at (prev + 1, 14) to (start + 0, 16)
260-
- Code(Expression(2, Add)) at (prev + 2, 1) to (start + 0, 2)
261-
= ((c2 + c1) + (c0 - (c1 + c2)))
257+
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 16)
258+
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
262259
Highest counter ID seen: c2
263260

264261
Function name: async::m

tests/coverage/branch/guard.cov-map

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Function name: guard::branch_match_guard
2-
Raw bytes (85): 0x[01, 01, 06, 19, 0d, 05, 09, 0f, 15, 13, 11, 17, 0d, 05, 09, 0d, 01, 0c, 01, 01, 10, 1d, 03, 0b, 00, 0c, 15, 01, 14, 02, 0a, 0d, 03, 0e, 00, 0f, 19, 00, 14, 00, 19, 20, 0d, 02, 00, 14, 00, 1e, 0d, 00, 1d, 02, 0a, 11, 03, 0e, 00, 0f, 1d, 00, 14, 00, 19, 20, 11, 09, 00, 14, 00, 1e, 11, 00, 1d, 02, 0a, 17, 03, 0e, 02, 0a, 0b, 04, 01, 00, 02]
2+
Raw bytes (85): 0x[01, 01, 06, 19, 0d, 05, 09, 0f, 15, 13, 11, 17, 0d, 05, 09, 0d, 01, 0c, 01, 01, 10, 02, 03, 0b, 00, 0c, 15, 01, 14, 02, 0a, 0d, 03, 0e, 00, 0f, 19, 00, 14, 00, 19, 20, 0d, 02, 00, 14, 00, 1e, 0d, 00, 1d, 02, 0a, 11, 03, 0e, 00, 0f, 02, 00, 14, 00, 19, 20, 11, 05, 00, 14, 00, 1e, 11, 00, 1d, 02, 0a, 17, 03, 0e, 02, 0a, 0b, 04, 01, 00, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 6
@@ -11,7 +11,8 @@ Number of expressions: 6
1111
- expression 5 operands: lhs = Counter(1), rhs = Counter(2)
1212
Number of file 0 mappings: 13
1313
- Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16)
14-
- Code(Counter(7)) at (prev + 3, 11) to (start + 0, 12)
14+
- Code(Expression(0, Sub)) at (prev + 3, 11) to (start + 0, 12)
15+
= (c6 - c3)
1516
- Code(Counter(5)) at (prev + 1, 20) to (start + 2, 10)
1617
- Code(Counter(3)) at (prev + 3, 14) to (start + 0, 15)
1718
- Code(Counter(6)) at (prev + 0, 20) to (start + 0, 25)
@@ -20,14 +21,15 @@ Number of file 0 mappings: 13
2021
false = (c6 - c3)
2122
- Code(Counter(3)) at (prev + 0, 29) to (start + 2, 10)
2223
- Code(Counter(4)) at (prev + 3, 14) to (start + 0, 15)
23-
- Code(Counter(7)) at (prev + 0, 20) to (start + 0, 25)
24-
- Branch { true: Counter(4), false: Counter(2) } at (prev + 0, 20) to (start + 0, 30)
24+
- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 25)
25+
= (c6 - c3)
26+
- Branch { true: Counter(4), false: Counter(1) } at (prev + 0, 20) to (start + 0, 30)
2527
true = c4
26-
false = c2
28+
false = c1
2729
- Code(Counter(4)) at (prev + 0, 29) to (start + 2, 10)
2830
- Code(Expression(5, Add)) at (prev + 3, 14) to (start + 2, 10)
2931
= (c1 + c2)
3032
- Code(Expression(2, Add)) at (prev + 4, 1) to (start + 0, 2)
3133
= ((((c1 + c2) + c3) + c4) + c5)
32-
Highest counter ID seen: c7
34+
Highest counter ID seen: c6
3335

tests/coverage/branch/if.cov-map

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
Function name: if::branch_and
2-
Raw bytes (56): 0x[01, 01, 04, 05, 09, 0d, 02, 11, 0f, 0d, 02, 08, 01, 2b, 01, 01, 10, 05, 03, 08, 00, 09, 20, 09, 02, 00, 08, 00, 09, 09, 00, 0d, 00, 0e, 20, 11, 0d, 00, 0d, 00, 0e, 11, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
2+
Raw bytes (60): 0x[01, 01, 06, 05, 09, 0b, 09, 05, 11, 13, 09, 17, 11, 05, 0d, 08, 01, 2b, 01, 01, 10, 05, 03, 08, 00, 09, 20, 09, 02, 00, 08, 00, 09, 09, 00, 0d, 00, 0e, 20, 0d, 11, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 06, 02, 0c, 02, 06, 0e, 03, 01, 00, 02]
33
Number of files: 1
44
- file 0 => global file 1
5-
Number of expressions: 4
5+
Number of expressions: 6
66
- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
7-
- expression 1 operands: lhs = Counter(3), rhs = Expression(0, Sub)
8-
- expression 2 operands: lhs = Counter(4), rhs = Expression(3, Add)
9-
- expression 3 operands: lhs = Counter(3), rhs = Expression(0, Sub)
7+
- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2)
8+
- expression 2 operands: lhs = Counter(1), rhs = Counter(4)
9+
- expression 3 operands: lhs = Expression(4, Add), rhs = Counter(2)
10+
- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4)
11+
- expression 5 operands: lhs = Counter(1), rhs = Counter(3)
1012
Number of file 0 mappings: 8
1113
- Code(Counter(0)) at (prev + 43, 1) to (start + 1, 16)
1214
- Code(Counter(1)) at (prev + 3, 8) to (start + 0, 9)
1315
- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9)
1416
true = c2
1517
false = (c1 - c2)
1618
- Code(Counter(2)) at (prev + 0, 13) to (start + 0, 14)
17-
- Branch { true: Counter(4), false: Counter(3) } at (prev + 0, 13) to (start + 0, 14)
18-
true = c4
19-
false = c3
20-
- Code(Counter(4)) at (prev + 0, 15) to (start + 2, 6)
21-
- Code(Expression(3, Add)) at (prev + 2, 12) to (start + 2, 6)
22-
= (c3 + (c1 - c2))
23-
- Code(Expression(2, Add)) at (prev + 3, 1) to (start + 0, 2)
24-
= (c4 + (c3 + (c1 - c2)))
19+
- Branch { true: Counter(3), false: Counter(4) } at (prev + 0, 13) to (start + 0, 14)
20+
true = c3
21+
false = c4
22+
- Code(Counter(3)) at (prev + 0, 15) to (start + 2, 6)
23+
- Code(Expression(1, Sub)) at (prev + 2, 12) to (start + 2, 6)
24+
= ((c1 + c4) - c2)
25+
- Code(Expression(3, Sub)) at (prev + 3, 1) to (start + 0, 2)
26+
= (((c1 + c3) + c4) - c2)
2527
Highest counter ID seen: c4
2628

2729
Function name: if::branch_not

0 commit comments

Comments
 (0)