Skip to content

Commit e0d9228

Browse files
authored
Rollup merge of #125106 - Zalathar:expressions, r=davidtwco
coverage: Memoize and simplify counter expressions When creating coverage counter expressions as part of coverage instrumentation, we often end up creating obviously-redundant expressions like `c1 + (c0 - c1)`, which is equivalent to just `c0`. To avoid doing so, this PR checks when we would create an expression matching one of 5 patterns, and uses the simplified form instead: - `(a - b) + b` → `a`. - `(a + b) - b` → `a`. - `(a + b) - a` → `b`. - `a + (b - a)` → `b`. - `a - (a - b)` → `b`. Of all the different ways to combine 3 operands and 2 operators, these are the patterns that allow simplification. (Some of those patterns currently don't occur in practice, but are included anyway for completeness, to avoid having to add them later as branch coverage and MC/DC coverage support expands.) --- This PR also adds memoization for newly-created (or newly-simplified) counter expressions, to avoid creating duplicates. This currently makes no difference to the final mappings, but is expected to be useful for MC/DC coverage of match expressions, as proposed by #124278 (comment).
2 parents ba1bb80 + d01df6f commit e0d9228

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+890
-1322
lines changed

compiler/rustc_middle/src/mir/coverage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ impl Debug for CodeRegion {
181181
}
182182
}
183183

184-
#[derive(Copy, Clone, Debug, PartialEq, TyEncodable, TyDecodable, Hash, HashStable)]
185-
#[derive(TypeFoldable, TypeVisitable)]
184+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, HashStable)]
185+
#[derive(TyEncodable, TyDecodable, TypeFoldable, TypeVisitable)]
186186
pub enum Op {
187187
Subtract,
188188
Add,

compiler/rustc_mir_transform/src/coverage/counters.rs

+80-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph, TraverseCoverage
1111

1212
/// The coverage counter or counter expression associated with a particular
1313
/// BCB node or BCB edge.
14-
#[derive(Clone, Copy)]
14+
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
1515
pub(super) enum BcbCounter {
1616
Counter { id: CounterId },
1717
Expression { id: ExpressionId },
@@ -35,6 +35,13 @@ impl Debug for BcbCounter {
3535
}
3636
}
3737

38+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
39+
struct BcbExpression {
40+
lhs: BcbCounter,
41+
op: Op,
42+
rhs: BcbCounter,
43+
}
44+
3845
#[derive(Debug)]
3946
pub(super) enum CounterIncrementSite {
4047
Node { bcb: BasicCoverageBlock },
@@ -56,9 +63,13 @@ pub(super) struct CoverageCounters {
5663
/// We currently don't iterate over this map, but if we do in the future,
5764
/// switch it back to `FxIndexMap` to avoid query stability hazards.
5865
bcb_edge_counters: FxHashMap<(BasicCoverageBlock, BasicCoverageBlock), BcbCounter>,
66+
5967
/// Table of expression data, associating each expression ID with its
6068
/// corresponding operator (+ or -) and its LHS/RHS operands.
61-
expressions: IndexVec<ExpressionId, Expression>,
69+
expressions: IndexVec<ExpressionId, BcbExpression>,
70+
/// Remember expressions that have already been created (or simplified),
71+
/// so that we don't create unnecessary duplicates.
72+
expressions_memo: FxHashMap<BcbExpression, BcbCounter>,
6273
}
6374

6475
impl CoverageCounters {
@@ -76,6 +87,7 @@ impl CoverageCounters {
7687
bcb_counters: IndexVec::from_elem_n(None, num_bcbs),
7788
bcb_edge_counters: FxHashMap::default(),
7889
expressions: IndexVec::new(),
90+
expressions_memo: FxHashMap::default(),
7991
};
8092

8193
MakeBcbCounters::new(&mut this, basic_coverage_blocks)
@@ -90,8 +102,57 @@ impl CoverageCounters {
90102
}
91103

92104
fn make_expression(&mut self, lhs: BcbCounter, op: Op, rhs: BcbCounter) -> BcbCounter {
93-
let expression = Expression { lhs: lhs.as_term(), op, rhs: rhs.as_term() };
94-
let id = self.expressions.push(expression);
105+
let new_expr = BcbExpression { lhs, op, rhs };
106+
*self
107+
.expressions_memo
108+
.entry(new_expr)
109+
.or_insert_with(|| Self::make_expression_inner(&mut self.expressions, new_expr))
110+
}
111+
112+
/// This is an associated function so that we can call it while borrowing
113+
/// `&mut self.expressions_memo`.
114+
fn make_expression_inner(
115+
expressions: &mut IndexVec<ExpressionId, BcbExpression>,
116+
new_expr: BcbExpression,
117+
) -> BcbCounter {
118+
// Simplify expressions using basic algebra.
119+
//
120+
// Some of these cases might not actually occur in practice, depending
121+
// on the details of how the instrumentor builds expressions.
122+
let BcbExpression { lhs, op, rhs } = new_expr;
123+
124+
if let BcbCounter::Expression { id } = lhs {
125+
let lhs_expr = &expressions[id];
126+
127+
// Simplify `(a - b) + b` to `a`.
128+
if lhs_expr.op == Op::Subtract && op == Op::Add && lhs_expr.rhs == rhs {
129+
return lhs_expr.lhs;
130+
}
131+
// Simplify `(a + b) - b` to `a`.
132+
if lhs_expr.op == Op::Add && op == Op::Subtract && lhs_expr.rhs == rhs {
133+
return lhs_expr.lhs;
134+
}
135+
// Simplify `(a + b) - a` to `b`.
136+
if lhs_expr.op == Op::Add && op == Op::Subtract && lhs_expr.lhs == rhs {
137+
return lhs_expr.rhs;
138+
}
139+
}
140+
141+
if let BcbCounter::Expression { id } = rhs {
142+
let rhs_expr = &expressions[id];
143+
144+
// Simplify `a + (b - a)` to `b`.
145+
if op == Op::Add && rhs_expr.op == Op::Subtract && lhs == rhs_expr.rhs {
146+
return rhs_expr.lhs;
147+
}
148+
// Simplify `a - (a - b)` to `b`.
149+
if op == Op::Subtract && rhs_expr.op == Op::Subtract && lhs == rhs_expr.lhs {
150+
return rhs_expr.rhs;
151+
}
152+
}
153+
154+
// Simplification failed, so actually create the new expression.
155+
let id = expressions.push(new_expr);
95156
BcbCounter::Expression { id }
96157
}
97158

@@ -166,7 +227,21 @@ impl CoverageCounters {
166227
}
167228

168229
pub(super) fn into_expressions(self) -> IndexVec<ExpressionId, Expression> {
169-
self.expressions
230+
let old_len = self.expressions.len();
231+
let expressions = self
232+
.expressions
233+
.into_iter()
234+
.map(|BcbExpression { lhs, op, rhs }| Expression {
235+
lhs: lhs.as_term(),
236+
op,
237+
rhs: rhs.as_term(),
238+
})
239+
.collect::<IndexVec<ExpressionId, _>>();
240+
241+
// Expression IDs are indexes into this vector, so make sure we didn't
242+
// accidentally invalidate them by changing its length.
243+
assert_eq!(old_len, expressions.len());
244+
expressions
170245
}
171246
}
172247

tests/coverage/abort.cov-map

+17-25
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,37 @@
11
Function name: abort::main
2-
Raw bytes (105): 0x[01, 01, 12, 01, 47, 05, 09, 03, 0d, 42, 11, 03, 0d, 11, 3e, 42, 11, 03, 0d, 3b, 15, 11, 3e, 42, 11, 03, 0d, 15, 36, 3b, 15, 11, 3e, 42, 11, 03, 0d, 05, 09, 0d, 01, 0e, 01, 01, 1b, 03, 02, 0b, 00, 18, 42, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 3e, 02, 0a, 00, 0b, 3b, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 36, 00, 31, 00, 32, 33, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 31, 00, 32, 47, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
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, 0e, 01, 01, 1b, 03, 02, 0b, 00, 18, 22, 01, 0c, 00, 19, 11, 00, 1a, 02, 0a, 0e, 02, 0a, 00, 0b, 22, 02, 0c, 00, 19, 15, 00, 1a, 00, 31, 1a, 00, 31, 00, 32, 22, 04, 0c, 00, 19, 05, 00, 1a, 00, 31, 09, 00, 31, 00, 32, 27, 01, 09, 00, 17, 0d, 02, 05, 01, 02]
33
Number of files: 1
44
- file 0 => global file 1
5-
Number of expressions: 18
6-
- expression 0 operands: lhs = Counter(0), rhs = Expression(17, Add)
5+
Number of expressions: 10
6+
- expression 0 operands: lhs = Counter(0), rhs = Expression(9, Add)
77
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
88
- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3)
9-
- expression 3 operands: lhs = Expression(16, Sub), rhs = Counter(4)
9+
- expression 3 operands: lhs = Expression(8, Sub), rhs = Counter(4)
1010
- expression 4 operands: lhs = Expression(0, Add), rhs = Counter(3)
11-
- expression 5 operands: lhs = Counter(4), rhs = Expression(15, Sub)
12-
- expression 6 operands: lhs = Expression(16, Sub), rhs = Counter(4)
11+
- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(3)
12+
- expression 6 operands: lhs = Expression(8, Sub), rhs = Counter(5)
1313
- expression 7 operands: lhs = Expression(0, Add), rhs = Counter(3)
14-
- expression 8 operands: lhs = Expression(14, Add), rhs = Counter(5)
15-
- expression 9 operands: lhs = Counter(4), rhs = Expression(15, Sub)
16-
- expression 10 operands: lhs = Expression(16, Sub), rhs = Counter(4)
17-
- expression 11 operands: lhs = Expression(0, Add), rhs = Counter(3)
18-
- expression 12 operands: lhs = Counter(5), rhs = Expression(13, Sub)
19-
- expression 13 operands: lhs = Expression(14, Add), rhs = Counter(5)
20-
- expression 14 operands: lhs = Counter(4), rhs = Expression(15, Sub)
21-
- expression 15 operands: lhs = Expression(16, Sub), rhs = Counter(4)
22-
- expression 16 operands: lhs = Expression(0, Add), rhs = Counter(3)
23-
- expression 17 operands: lhs = Counter(1), rhs = Counter(2)
14+
- expression 8 operands: lhs = Expression(0, Add), rhs = Counter(3)
15+
- expression 9 operands: lhs = Counter(1), rhs = Counter(2)
2416
Number of file 0 mappings: 13
2517
- Code(Counter(0)) at (prev + 14, 1) to (start + 1, 27)
2618
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
2719
= (c0 + (c1 + c2))
28-
- Code(Expression(16, Sub)) at (prev + 1, 12) to (start + 0, 25)
20+
- Code(Expression(8, Sub)) at (prev + 1, 12) to (start + 0, 25)
2921
= ((c0 + (c1 + c2)) - c3)
3022
- Code(Counter(4)) at (prev + 0, 26) to (start + 2, 10)
31-
- Code(Expression(15, Sub)) at (prev + 2, 10) to (start + 0, 11)
23+
- Code(Expression(3, Sub)) at (prev + 2, 10) to (start + 0, 11)
3224
= (((c0 + (c1 + c2)) - c3) - c4)
33-
- Code(Expression(14, Add)) at (prev + 2, 12) to (start + 0, 25)
34-
= (c4 + (((c0 + (c1 + c2)) - c3) - c4))
25+
- Code(Expression(8, Sub)) at (prev + 2, 12) to (start + 0, 25)
26+
= ((c0 + (c1 + c2)) - c3)
3527
- Code(Counter(5)) at (prev + 0, 26) to (start + 0, 49)
36-
- Code(Expression(13, Sub)) at (prev + 0, 49) to (start + 0, 50)
37-
= ((c4 + (((c0 + (c1 + c2)) - c3) - c4)) - c5)
38-
- Code(Expression(12, Add)) at (prev + 4, 12) to (start + 0, 25)
39-
= (c5 + ((c4 + (((c0 + (c1 + c2)) - c3) - c4)) - c5))
28+
- Code(Expression(6, Sub)) at (prev + 0, 49) to (start + 0, 50)
29+
= (((c0 + (c1 + c2)) - c3) - c5)
30+
- Code(Expression(8, Sub)) at (prev + 4, 12) to (start + 0, 25)
31+
= ((c0 + (c1 + c2)) - c3)
4032
- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 49)
4133
- Code(Counter(2)) at (prev + 0, 49) to (start + 0, 50)
42-
- Code(Expression(17, Add)) at (prev + 1, 9) to (start + 0, 23)
34+
- Code(Expression(9, Add)) at (prev + 1, 9) to (start + 0, 23)
4335
= (c1 + c2)
4436
- Code(Counter(3)) at (prev + 2, 5) to (start + 1, 2)
4537

tests/coverage/async.cov-map

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ Number of file 0 mappings: 1
77
- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 25)
88

99
Function name: async::c::{closure#0}
10-
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 09, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 07, 02, 01, 00, 02]
10+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 09, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02]
1111
Number of files: 1
1212
- file 0 => global file 1
13-
Number of expressions: 2
13+
Number of expressions: 1
1414
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
15-
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
1615
Number of file 0 mappings: 4
1716
- Code(Counter(0)) at (prev + 9, 25) to (start + 1, 14)
1817
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 10)
1918
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10)
2019
= (c0 - c1)
21-
- Code(Expression(1, Add)) at (prev + 2, 1) to (start + 0, 2)
22-
= (c1 + (c0 - c1))
20+
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
2321

2422
Function name: async::d
2523
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 01, 00, 14]
@@ -188,19 +186,17 @@ Number of file 0 mappings: 9
188186
= ((c1 + c2) + c3)
189187

190188
Function name: async::j::c
191-
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 37, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 0a, 0d, 00, 0e, 07, 02, 05, 00, 06]
189+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 37, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 0a, 0d, 00, 0e, 01, 02, 05, 00, 06]
192190
Number of files: 1
193191
- file 0 => global file 1
194-
Number of expressions: 2
192+
Number of expressions: 1
195193
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
196-
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
197194
Number of file 0 mappings: 4
198195
- Code(Counter(0)) at (prev + 55, 5) to (start + 1, 18)
199196
- Code(Counter(1)) at (prev + 2, 13) to (start + 0, 14)
200197
- Code(Expression(0, Sub)) at (prev + 10, 13) to (start + 0, 14)
201198
= (c0 - c1)
202-
- Code(Expression(1, Add)) at (prev + 2, 5) to (start + 0, 6)
203-
= (c1 + (c0 - c1))
199+
- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6)
204200

205201
Function name: async::j::d
206202
Raw bytes (9): 0x[01, 01, 00, 01, 01, 46, 05, 00, 17]

tests/coverage/async2.cov-map

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@ Number of file 0 mappings: 1
77
- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 23)
88

99
Function name: async2::async_func::{closure#0}
10-
Raw bytes (26): 0x[01, 01, 01, 05, 00, 04, 01, 0d, 17, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 06, 00, 07, 03, 01, 01, 00, 02]
10+
Raw bytes (24): 0x[01, 01, 00, 04, 01, 0d, 17, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 06, 00, 07, 01, 01, 01, 00, 02]
1111
Number of files: 1
1212
- file 0 => global file 1
13-
Number of expressions: 1
14-
- expression 0 operands: lhs = Counter(1), rhs = Zero
13+
Number of expressions: 0
1514
Number of file 0 mappings: 4
1615
- Code(Counter(0)) at (prev + 13, 23) to (start + 3, 9)
1716
- Code(Counter(1)) at (prev + 3, 10) to (start + 2, 6)
1817
- Code(Zero) at (prev + 2, 6) to (start + 0, 7)
19-
- Code(Expression(0, Add)) at (prev + 1, 1) to (start + 0, 2)
20-
= (c1 + Zero)
18+
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
2119

2220
Function name: async2::async_func_just_println
2321
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 00, 24]
@@ -44,15 +42,13 @@ Number of file 0 mappings: 1
4442
- Code(Counter(0)) at (prev + 25, 1) to (start + 7, 2)
4543

4644
Function name: async2::non_async_func
47-
Raw bytes (26): 0x[01, 01, 01, 05, 00, 04, 01, 05, 01, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 06, 00, 07, 03, 01, 01, 00, 02]
45+
Raw bytes (24): 0x[01, 01, 00, 04, 01, 05, 01, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 06, 00, 07, 01, 01, 01, 00, 02]
4846
Number of files: 1
4947
- file 0 => global file 1
50-
Number of expressions: 1
51-
- expression 0 operands: lhs = Counter(1), rhs = Zero
48+
Number of expressions: 0
5249
Number of file 0 mappings: 4
5350
- Code(Counter(0)) at (prev + 5, 1) to (start + 3, 9)
5451
- Code(Counter(1)) at (prev + 3, 10) to (start + 2, 6)
5552
- Code(Zero) at (prev + 2, 6) to (start + 0, 7)
56-
- Code(Expression(0, Add)) at (prev + 1, 1) to (start + 0, 2)
57-
= (c1 + Zero)
53+
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
5854

tests/coverage/async_block.cov-map

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
Function name: async_block::main
2-
Raw bytes (38): 0x[01, 01, 02, 01, 05, 03, 05, 06, 01, 05, 01, 00, 0b, 05, 01, 09, 00, 0a, 03, 00, 0e, 00, 13, 05, 00, 14, 01, 16, 05, 07, 0a, 02, 06, 06, 03, 01, 00, 02]
2+
Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 05, 01, 00, 0b, 05, 01, 09, 00, 0a, 03, 00, 0e, 00, 13, 05, 00, 14, 01, 16, 05, 07, 0a, 02, 06, 01, 03, 01, 00, 02]
33
Number of files: 1
44
- file 0 => global file 1
5-
Number of expressions: 2
5+
Number of expressions: 1
66
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
7-
- expression 1 operands: lhs = Expression(0, Add), rhs = Counter(1)
87
Number of file 0 mappings: 6
98
- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 11)
109
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10)
1110
- Code(Expression(0, Add)) at (prev + 0, 14) to (start + 0, 19)
1211
= (c0 + c1)
1312
- Code(Counter(1)) at (prev + 0, 20) to (start + 1, 22)
1413
- Code(Counter(1)) at (prev + 7, 10) to (start + 2, 6)
15-
- Code(Expression(1, Sub)) at (prev + 3, 1) to (start + 0, 2)
16-
= ((c0 + c1) - c1)
14+
- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2)
1715

1816
Function name: async_block::main::{closure#0}
19-
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 07, 1c, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 07, 03, 09, 00, 0a]
17+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 07, 1c, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a]
2018
Number of files: 1
2119
- file 0 => global file 1
22-
Number of expressions: 2
20+
Number of expressions: 1
2321
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
24-
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
2522
Number of file 0 mappings: 4
2623
- Code(Counter(0)) at (prev + 7, 28) to (start + 1, 23)
2724
- Code(Counter(1)) at (prev + 1, 24) to (start + 2, 14)
2825
- Code(Expression(0, Sub)) at (prev + 2, 20) to (start + 2, 14)
2926
= (c0 - c1)
30-
- Code(Expression(1, Add)) at (prev + 3, 9) to (start + 0, 10)
31-
= (c1 + (c0 - c1))
27+
- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10)
3228

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
Function name: generics::print_size::<()>
2-
Raw bytes (35): 0x[01, 01, 02, 01, 05, 05, 02, 05, 01, 06, 01, 01, 24, 20, 05, 02, 01, 08, 00, 24, 05, 00, 25, 02, 06, 02, 02, 0c, 02, 06, 07, 03, 01, 00, 02]
2+
Raw bytes (33): 0x[01, 01, 01, 01, 05, 05, 01, 06, 01, 01, 24, 20, 05, 02, 01, 08, 00, 24, 05, 00, 25, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02]
33
Number of files: 1
44
- file 0 => global file 1
5-
Number of expressions: 2
5+
Number of expressions: 1
66
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
7-
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
87
Number of file 0 mappings: 5
98
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 36)
109
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 1, 8) to (start + 0, 36)
@@ -13,16 +12,14 @@ Number of file 0 mappings: 5
1312
- Code(Counter(1)) at (prev + 0, 37) to (start + 2, 6)
1413
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6)
1514
= (c0 - c1)
16-
- Code(Expression(1, Add)) at (prev + 3, 1) to (start + 0, 2)
17-
= (c1 + (c0 - c1))
15+
- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2)
1816

1917
Function name: generics::print_size::<u32>
20-
Raw bytes (35): 0x[01, 01, 02, 01, 05, 05, 02, 05, 01, 06, 01, 01, 24, 20, 05, 02, 01, 08, 00, 24, 05, 00, 25, 02, 06, 02, 02, 0c, 02, 06, 07, 03, 01, 00, 02]
18+
Raw bytes (33): 0x[01, 01, 01, 01, 05, 05, 01, 06, 01, 01, 24, 20, 05, 02, 01, 08, 00, 24, 05, 00, 25, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02]
2119
Number of files: 1
2220
- file 0 => global file 1
23-
Number of expressions: 2
21+
Number of expressions: 1
2422
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
25-
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
2623
Number of file 0 mappings: 5
2724
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 36)
2825
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 1, 8) to (start + 0, 36)
@@ -31,16 +28,14 @@ Number of file 0 mappings: 5
3128
- Code(Counter(1)) at (prev + 0, 37) to (start + 2, 6)
3229
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6)
3330
= (c0 - c1)
34-
- Code(Expression(1, Add)) at (prev + 3, 1) to (start + 0, 2)
35-
= (c1 + (c0 - c1))
31+
- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2)
3632

3733
Function name: generics::print_size::<u64>
38-
Raw bytes (35): 0x[01, 01, 02, 01, 05, 05, 02, 05, 01, 06, 01, 01, 24, 20, 05, 02, 01, 08, 00, 24, 05, 00, 25, 02, 06, 02, 02, 0c, 02, 06, 07, 03, 01, 00, 02]
34+
Raw bytes (33): 0x[01, 01, 01, 01, 05, 05, 01, 06, 01, 01, 24, 20, 05, 02, 01, 08, 00, 24, 05, 00, 25, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02]
3935
Number of files: 1
4036
- file 0 => global file 1
41-
Number of expressions: 2
37+
Number of expressions: 1
4238
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
43-
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
4439
Number of file 0 mappings: 5
4540
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 36)
4641
- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 1, 8) to (start + 0, 36)
@@ -49,6 +44,5 @@ Number of file 0 mappings: 5
4944
- Code(Counter(1)) at (prev + 0, 37) to (start + 2, 6)
5045
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6)
5146
= (c0 - c1)
52-
- Code(Expression(1, Add)) at (prev + 3, 1) to (start + 0, 2)
53-
= (c1 + (c0 - c1))
47+
- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2)
5448

0 commit comments

Comments
 (0)