Skip to content

Commit

Permalink
Unrolled build for rust-lang#133849
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Dec 4, 2024
2 parents 96e51d9 + ba08056 commit 3252548
Show file tree
Hide file tree
Showing 38 changed files with 1,719 additions and 1,589 deletions.
374 changes: 230 additions & 144 deletions compiler/rustc_mir_transform/src/coverage/counters.rs

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions compiler/rustc_mir_transform/src/coverage/counters/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
use std::fmt::Debug;

use super::sort_and_cancel;

fn flatten<T>(input: Vec<Option<T>>) -> Vec<T> {
input.into_iter().flatten().collect()
}

fn sort_and_cancel_and_flatten<T: Clone + Ord>(pos: Vec<T>, neg: Vec<T>) -> (Vec<T>, Vec<T>) {
let (pos_actual, neg_actual) = sort_and_cancel(pos, neg);
(flatten(pos_actual), flatten(neg_actual))
}

#[track_caller]
fn check_test_case<T: Clone + Debug + Ord>(
pos: Vec<T>,
neg: Vec<T>,
pos_expected: Vec<T>,
neg_expected: Vec<T>,
) {
eprintln!("pos = {pos:?}; neg = {neg:?}");
let output = sort_and_cancel_and_flatten(pos, neg);
assert_eq!(output, (pos_expected, neg_expected));
}

#[test]
fn cancellation() {
let cases: &[(Vec<u32>, Vec<u32>, Vec<u32>, Vec<u32>)] = &[
(vec![], vec![], vec![], vec![]),
(vec![4, 2, 1, 5, 3], vec![], vec![1, 2, 3, 4, 5], vec![]),
(vec![5, 5, 5, 5, 5], vec![5], vec![5, 5, 5, 5], vec![]),
(vec![1, 1, 2, 2, 3, 3], vec![1, 2, 3], vec![1, 2, 3], vec![]),
(vec![1, 1, 2, 2, 3, 3], vec![2, 4, 2], vec![1, 1, 3, 3], vec![4]),
];

for (pos, neg, pos_expected, neg_expected) in cases {
check_test_case(pos.to_vec(), neg.to_vec(), pos_expected.to_vec(), neg_expected.to_vec());
// Same test case, but with its inputs flipped and its outputs flipped.
check_test_case(neg.to_vec(), pos.to_vec(), neg_expected.to_vec(), pos_expected.to_vec());
}
}
10 changes: 5 additions & 5 deletions compiler/rustc_mir_transform/src/coverage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use rustc_span::source_map::SourceMap;
use rustc_span::{BytePos, Pos, SourceFile, Span};
use tracing::{debug, debug_span, trace};

use crate::coverage::counters::{CounterIncrementSite, CoverageCounters};
use crate::coverage::counters::{CoverageCounters, Site};
use crate::coverage::graph::CoverageGraph;
use crate::coverage::mappings::ExtractedMappings;

Expand Down Expand Up @@ -265,13 +265,13 @@ fn inject_coverage_statements<'tcx>(
coverage_counters: &CoverageCounters,
) {
// Inject counter-increment statements into MIR.
for (id, counter_increment_site) in coverage_counters.counter_increment_sites() {
for (id, site) in coverage_counters.counter_increment_sites() {
// Determine the block to inject a counter-increment statement into.
// For BCB nodes this is just their first block, but for edges we need
// to create a new block between the two BCBs, and inject into that.
let target_bb = match *counter_increment_site {
CounterIncrementSite::Node { bcb } => basic_coverage_blocks[bcb].leader_bb(),
CounterIncrementSite::Edge { from_bcb, to_bcb } => {
let target_bb = match site {
Site::Node { bcb } => basic_coverage_blocks[bcb].leader_bb(),
Site::Edge { from_bcb, to_bcb } => {
// Create a new block between the last block of `from_bcb` and
// the first block of `to_bcb`.
let from_bb = basic_coverage_blocks[from_bcb].last_bb();
Expand Down
26 changes: 13 additions & 13 deletions tests/coverage/abort.cov-map
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
Function name: abort::main
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]
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 10
- expression 0 operands: lhs = Counter(0), rhs = Expression(9, Add)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(2)
- expression 1 operands: lhs = Counter(0), rhs = Counter(1)
- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3)
- expression 3 operands: lhs = Expression(8, Sub), rhs = Counter(4)
- expression 4 operands: lhs = Expression(0, Add), rhs = Counter(3)
- expression 3 operands: lhs = Expression(0, Add), rhs = Expression(4, Add)
- expression 4 operands: lhs = Counter(3), rhs = Counter(4)
- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(3)
- expression 6 operands: lhs = Expression(8, Sub), rhs = Counter(5)
- expression 7 operands: lhs = Expression(0, Add), rhs = Counter(3)
- expression 6 operands: lhs = Expression(0, Add), rhs = Expression(7, Add)
- expression 7 operands: lhs = Counter(3), rhs = Counter(5)
- expression 8 operands: lhs = Expression(0, Add), rhs = Counter(3)
- expression 9 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 13
- Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27)
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
= (c0 + (c1 + c2))
= ((c0 + c1) + c2)
- Code(Expression(8, Sub)) at (prev + 1, 12) to (start + 0, 25)
= ((c0 + (c1 + c2)) - c3)
= (((c0 + c1) + c2) - c3)
- Code(Counter(4)) at (prev + 0, 26) to (start + 2, 10)
- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10)
= (((c0 + (c1 + c2)) - c3) - c4)
= (((c0 + c1) + c2) - (c3 + c4))
- Code(Expression(8, Sub)) at (prev + 2, 12) to (start + 0, 25)
= ((c0 + (c1 + c2)) - c3)
= (((c0 + c1) + c2) - c3)
- Code(Counter(5)) at (prev + 0, 26) to (start + 0, 49)
- Code(Expression(6, Sub)) at (prev + 0, 48) to (start + 0, 49)
= (((c0 + (c1 + c2)) - c3) - c5)
= (((c0 + c1) + c2) - (c3 + c5))
- Code(Expression(8, Sub)) at (prev + 4, 12) to (start + 0, 25)
= ((c0 + (c1 + c2)) - c3)
= (((c0 + c1) + c2) - c3)
- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 49)
- Code(Counter(2)) at (prev + 0, 48) to (start + 0, 49)
- Code(Expression(9, Add)) at (prev + 1, 9) to (start + 0, 23)
Expand Down
31 changes: 16 additions & 15 deletions tests/coverage/assert.cov-map
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
Function name: assert::main
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]
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 8
- expression 0 operands: lhs = Counter(0), rhs = Expression(6, Add)
- expression 1 operands: lhs = Counter(1), rhs = Expression(7, Add)
- expression 2 operands: lhs = Counter(2), rhs = Counter(3)
Number of expressions: 9
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3)
- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2)
- expression 2 operands: lhs = Counter(0), rhs = Counter(1)
- expression 3 operands: lhs = Expression(0, Add), rhs = Counter(4)
- expression 4 operands: lhs = Expression(5, Sub), rhs = Counter(1)
- expression 5 operands: lhs = Expression(0, Add), rhs = Counter(4)
- expression 6 operands: lhs = Counter(1), rhs = Expression(7, Add)
- expression 7 operands: lhs = Counter(2), rhs = Counter(3)
- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4)
- expression 5 operands: lhs = Expression(6, Add), rhs = Counter(3)
- expression 6 operands: lhs = Counter(0), rhs = Counter(2)
- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(3)
- expression 8 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 9
- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 27)
- Code(Expression(0, Add)) at (prev + 2, 11) to (start + 0, 24)
= (c0 + (c1 + (c2 + c3)))
- Code(Expression(5, Sub)) at (prev + 1, 12) to (start + 0, 26)
= ((c0 + (c1 + (c2 + c3))) - c4)
= (((c0 + c1) + c2) + c3)
- Code(Expression(3, Sub)) at (prev + 1, 12) to (start + 0, 26)
= ((((c0 + c1) + c2) + c3) - c4)
- Code(Counter(1)) at (prev + 0, 27) to (start + 2, 10)
- Code(Expression(4, Sub)) at (prev + 2, 19) to (start + 0, 32)
= (((c0 + (c1 + (c2 + c3))) - c4) - c1)
= (((c0 + c2) + c3) - c4)
- Code(Counter(2)) at (prev + 0, 33) to (start + 2, 10)
- Code(Counter(3)) at (prev + 2, 9) to (start + 0, 10)
- Code(Expression(6, Add)) at (prev + 1, 9) to (start + 0, 23)
= (c1 + (c2 + c3))
- Code(Expression(7, Add)) at (prev + 1, 9) to (start + 0, 23)
= ((c1 + c2) + c3)
- Code(Counter(4)) at (prev + 2, 5) to (start + 1, 2)
Highest counter ID seen: c4

Expand Down
27 changes: 12 additions & 15 deletions tests/coverage/async.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,25 @@ Number of file 0 mappings: 1
Highest counter ID seen: c0

Function name: async::i::{closure#0}
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]
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(6)
- expression 1 operands: lhs = Counter(4), rhs = Counter(5)
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(5)
- expression 1 operands: lhs = Counter(3), rhs = Counter(4)
Number of file 0 mappings: 11
- Code(Counter(0)) at (prev + 45, 19) to (start + 4, 12)
- Code(Counter(2)) at (prev + 5, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 24)
- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 33)
- Code(Counter(2)) at (prev + 0, 39) to (start + 0, 48)
- Code(Counter(5)) at (prev + 1, 9) to (start + 0, 10)
- Code(Counter(3)) at (prev + 0, 14) to (start + 0, 23)
- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 10)
- Code(Counter(6)) at (prev + 0, 14) to (start + 0, 23)
- Code(Counter(7)) at (prev + 0, 27) to (start + 0, 32)
- Code(Counter(5)) at (prev + 0, 36) to (start + 0, 38)
- Code(Counter(6)) at (prev + 1, 14) to (start + 0, 16)
- Code(Counter(4)) at (prev + 0, 36) to (start + 0, 38)
- Code(Counter(5)) at (prev + 1, 14) to (start + 0, 16)
- Code(Expression(0, Add)) at (prev + 2, 1) to (start + 0, 2)
= ((c4 + c5) + c6)
= ((c3 + c4) + c5)
Highest counter ID seen: c7

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

Function name: async::l
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]
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Expression(1, Add)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
- expression 2 operands: lhs = Expression(3, Add), rhs = Expression(0, Sub)
- expression 3 operands: lhs = Counter(2), rhs = Counter(1)
Number of file 0 mappings: 5
- Code(Counter(0)) at (prev + 82, 1) to (start + 1, 12)
- Code(Expression(0, Sub)) at (prev + 2, 14) to (start + 0, 16)
= (c0 - (c1 + c2))
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 16)
- Code(Counter(2)) at (prev + 1, 14) to (start + 0, 16)
- Code(Expression(2, Add)) at (prev + 2, 1) to (start + 0, 2)
= ((c2 + c1) + (c0 - (c1 + c2)))
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 16)
- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
Highest counter ID seen: c2

Function name: async::m
Expand Down
14 changes: 8 additions & 6 deletions tests/coverage/branch/guard.cov-map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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, 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]
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 6
Expand All @@ -11,7 +11,8 @@ Number of expressions: 6
- expression 5 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(Counter(7)) at (prev + 3, 11) to (start + 0, 12)
- Code(Expression(0, Sub)) at (prev + 3, 11) to (start + 0, 12)
= (c6 - 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)
Expand All @@ -20,14 +21,15 @@ Number of file 0 mappings: 13
false = (c6 - c3)
- Code(Counter(3)) at (prev + 0, 29) to (start + 2, 10)
- Code(Counter(4)) at (prev + 3, 14) to (start + 0, 15)
- Code(Counter(7)) at (prev + 0, 20) to (start + 0, 25)
- Branch { true: Counter(4), false: Counter(2) } at (prev + 0, 20) to (start + 0, 30)
- 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)
true = c4
false = c2
false = c1
- 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: c7
Highest counter ID seen: c6

28 changes: 15 additions & 13 deletions tests/coverage/branch/if.cov-map
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
Function name: if::branch_and
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]
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Number of expressions: 6
- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
- expression 1 operands: lhs = Counter(3), rhs = Expression(0, Sub)
- expression 2 operands: lhs = Counter(4), rhs = Expression(3, Add)
- expression 3 operands: lhs = Counter(3), rhs = Expression(0, Sub)
- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2)
- expression 2 operands: lhs = Counter(1), rhs = Counter(4)
- expression 3 operands: lhs = Expression(4, Add), rhs = Counter(2)
- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4)
- expression 5 operands: lhs = Counter(1), rhs = Counter(3)
Number of file 0 mappings: 8
- Code(Counter(0)) at (prev + 43, 1) to (start + 1, 16)
- Code(Counter(1)) at (prev + 3, 8) to (start + 0, 9)
- Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9)
true = c2
false = (c1 - c2)
- Code(Counter(2)) at (prev + 0, 13) to (start + 0, 14)
- Branch { true: Counter(4), false: Counter(3) } at (prev + 0, 13) to (start + 0, 14)
true = c4
false = c3
- Code(Counter(4)) at (prev + 0, 15) to (start + 2, 6)
- Code(Expression(3, Add)) at (prev + 2, 12) to (start + 2, 6)
= (c3 + (c1 - c2))
- Code(Expression(2, Add)) at (prev + 3, 1) to (start + 0, 2)
= (c4 + (c3 + (c1 - c2)))
- Branch { true: Counter(3), false: Counter(4) } at (prev + 0, 13) to (start + 0, 14)
true = c3
false = c4
- Code(Counter(3)) at (prev + 0, 15) to (start + 2, 6)
- Code(Expression(1, Sub)) at (prev + 2, 12) to (start + 2, 6)
= ((c1 + c4) - c2)
- Code(Expression(3, Sub)) at (prev + 3, 1) to (start + 0, 2)
= (((c1 + c3) + c4) - c2)
Highest counter ID seen: c4

Function name: if::branch_not
Expand Down
Loading

0 comments on commit 3252548

Please sign in to comment.