-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #133946 - Zalathar:ready-first, r=oli-obk
coverage: Prefer to visit nodes whose predecessors have been visited In coverage instrumentation, we need to traverse the control-flow graph and decide what kind of counter (physical counter or counter-expression) should be used for each node that needs a counter. The existing traversal order is complex and hard to tweak. This new traversal order tries to be a bit more principled, by always preferring to visit nodes whose predecessors have already been visited, which is a good match for how the counter-creation code ends up dealing with a node's in-edges and out-edges. For several of the coverage tests, this ends up being a strict improvement in reducing the size of the coverage metadata, and also reducing the number of physical counters needed. (The new traversal should hopefully also allow some further code simplifications in the future.) --- This is made possible by the separate simplification pass introduced by #133849. Without that, almost any change to the traversal order ends up increasing the size of the expression table or the number of physical counters.
- Loading branch information
Showing
25 changed files
with
908 additions
and
1,222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
Function name: guard::branch_match_guard | ||
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] | ||
Raw bytes (89): 0x[01, 01, 08, 05, 0d, 05, 17, 0d, 11, 1f, 17, 05, 09, 0d, 11, 1f, 15, 05, 09, 0d, 01, 0c, 01, 01, 10, 02, 03, 0b, 00, 0c, 15, 01, 14, 02, 0a, 0d, 03, 0e, 00, 0f, 05, 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, 06, 00, 14, 00, 1e, 11, 00, 1d, 02, 0a, 0e, 03, 0e, 02, 0a, 1b, 04, 01, 00, 02] | ||
Number of files: 1 | ||
- file 0 => global file 1 | ||
Number of expressions: 6 | ||
- expression 0 operands: lhs = Counter(6), rhs = Counter(3) | ||
- expression 1 operands: lhs = Counter(1), rhs = Counter(2) | ||
- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(5) | ||
- expression 3 operands: lhs = Expression(4, Add), rhs = Counter(4) | ||
- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) | ||
- expression 5 operands: lhs = Counter(1), rhs = Counter(2) | ||
Number of expressions: 8 | ||
- expression 0 operands: lhs = Counter(1), rhs = Counter(3) | ||
- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) | ||
- expression 2 operands: lhs = Counter(3), rhs = Counter(4) | ||
- expression 3 operands: lhs = Expression(7, Add), rhs = Expression(5, Add) | ||
- expression 4 operands: lhs = Counter(1), rhs = Counter(2) | ||
- expression 5 operands: lhs = Counter(3), rhs = Counter(4) | ||
- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(5) | ||
- expression 7 operands: lhs = Counter(1), rhs = Counter(2) | ||
Number of file 0 mappings: 13 | ||
- Code(Counter(0)) at (prev + 12, 1) to (start + 1, 16) | ||
- Code(Expression(0, Sub)) at (prev + 3, 11) to (start + 0, 12) | ||
= (c6 - c3) | ||
= (c1 - c3) | ||
- Code(Counter(5)) at (prev + 1, 20) to (start + 2, 10) | ||
- Code(Counter(3)) at (prev + 3, 14) to (start + 0, 15) | ||
- Code(Counter(6)) at (prev + 0, 20) to (start + 0, 25) | ||
- Code(Counter(1)) at (prev + 0, 20) to (start + 0, 25) | ||
- Branch { true: Counter(3), false: Expression(0, Sub) } at (prev + 0, 20) to (start + 0, 30) | ||
true = c3 | ||
false = (c6 - c3) | ||
false = (c1 - c3) | ||
- Code(Counter(3)) at (prev + 0, 29) to (start + 2, 10) | ||
- Code(Counter(4)) at (prev + 3, 14) to (start + 0, 15) | ||
- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 25) | ||
= (c6 - c3) | ||
- Branch { true: Counter(4), false: Counter(1) } at (prev + 0, 20) to (start + 0, 30) | ||
= (c1 - c3) | ||
- Branch { true: Counter(4), false: Expression(1, Sub) } at (prev + 0, 20) to (start + 0, 30) | ||
true = c4 | ||
false = c1 | ||
false = (c1 - (c3 + c4)) | ||
- Code(Counter(4)) at (prev + 0, 29) to (start + 2, 10) | ||
- Code(Expression(5, Add)) at (prev + 3, 14) to (start + 2, 10) | ||
= (c1 + c2) | ||
- Code(Expression(2, Add)) at (prev + 4, 1) to (start + 0, 2) | ||
= ((((c1 + c2) + c3) + c4) + c5) | ||
Highest counter ID seen: c6 | ||
- Code(Expression(3, Sub)) at (prev + 3, 14) to (start + 2, 10) | ||
= ((c1 + c2) - (c3 + c4)) | ||
- Code(Expression(6, Add)) at (prev + 4, 1) to (start + 0, 2) | ||
= ((c1 + c2) + c5) | ||
Highest counter ID seen: c5 | ||
|
Oops, something went wrong.