============ after processor `borrow_analysis` ================ [variant baseline] pub fun Trafo::incr_ref($t0|r: &mut u64) { var $t1: u64 var $t2: u64 var $t3: u64 # live_nodes: Reference($t0) 0: trace_local[r]($t0) # live_nodes: Reference($t0) 1: $t1 := read_ref($t0) # live_nodes: Reference($t0) 2: $t2 := 1 # live_nodes: Reference($t0) 3: $t3 := +($t1, $t2) # live_nodes: Reference($t0) 4: write_ref($t0, $t3) # live_nodes: Reference($t0) 5: trace_local[r]($t0) 6: return () } [variant baseline] pub fun Trafo::use_incr_ref($t0|b: bool): Trafo::R { var $t1|r1: Trafo::R var $t2|r2: Trafo::R var $t3|r_ref: &mut Trafo::R var $t4|tmp#$4: &mut Trafo::R var $t5: u64 var $t6: u64 var $t7: &mut Trafo::R var $t8: &mut Trafo::R var $t9: &mut u64 var $t10: Trafo::R # live_nodes: LocalRoot($t0) 0: trace_local[b]($t0) # live_nodes: LocalRoot($t0) 1: $t5 := 1 # live_nodes: LocalRoot($t0) 2: $t1 := pack Trafo::R($t5) # live_nodes: LocalRoot($t0) 3: trace_local[r1]($t1) # live_nodes: LocalRoot($t0) 4: $t6 := 2 # live_nodes: LocalRoot($t0) 5: $t2 := pack Trafo::R($t6) # live_nodes: LocalRoot($t0) 6: trace_local[r2]($t2) # live_nodes: LocalRoot($t0) 7: if ($t0) goto 10 else goto 8 # live_nodes: LocalRoot($t0) 8: label L1 # live_nodes: LocalRoot($t0) 9: goto 15 # live_nodes: LocalRoot($t0) 10: label L0 # live_nodes: LocalRoot($t0) 11: $t7 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t7) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t7))} # borrows_from: Reference($t7) -> {(*, LocalRoot($t1))} 12: $t4 := $t7 # live_nodes: LocalRoot($t0), Reference($t4) # moved_nodes: Reference($t7) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1))} 13: trace_local[tmp#$4]($t7) # live_nodes: LocalRoot($t0), Reference($t4) # moved_nodes: Reference($t7) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1))} 14: goto 19 # live_nodes: LocalRoot($t0) 15: label L2 # live_nodes: LocalRoot($t0) 16: $t8 := borrow_local($t2) # live_nodes: LocalRoot($t0), Reference($t8) # borrowed_by: LocalRoot($t2) -> {(*, Reference($t8))} # borrows_from: Reference($t8) -> {(*, LocalRoot($t2))} 17: $t4 := $t8 # live_nodes: LocalRoot($t0), Reference($t4) # moved_nodes: Reference($t8) # borrowed_by: LocalRoot($t2) -> {(*, Reference($t4))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t2))} 18: trace_local[tmp#$4]($t8) # live_nodes: LocalRoot($t0), Reference($t4) # moved_nodes: Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t2) -> {(*, Reference($t4))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t2))} 19: label L3 # live_nodes: LocalRoot($t0), Reference($t4) # moved_nodes: Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t2) -> {(*, Reference($t4))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t2))} 20: trace_local[r_ref]($t4) # live_nodes: LocalRoot($t0), Reference($t4) # moved_nodes: Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t2) -> {(*, Reference($t4))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t2))} 21: $t9 := borrow_field.x($t4) # live_nodes: LocalRoot($t0), Reference($t9) # moved_nodes: Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t2) -> {(*, Reference($t4))}, Reference($t4) -> {(*, Reference($t9))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t2))}, Reference($t9) -> {(*, Reference($t4))} 22: Trafo::incr_ref($t9) # live_nodes: LocalRoot($t0) # moved_nodes: Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t2) -> {(*, Reference($t4))}, Reference($t4) -> {(*, Reference($t9))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t2))}, Reference($t9) -> {(*, Reference($t4))} 23: $t10 := move($t2) # live_nodes: LocalRoot($t0) # moved_nodes: LocalRoot($t2), Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t10) -> {(*, Reference($t4))}, Reference($t4) -> {(*, Reference($t9))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t10))}, Reference($t9) -> {(*, Reference($t4))} 24: trace_return[0]($t10) # live_nodes: LocalRoot($t0) # moved_nodes: LocalRoot($t2), Reference($t7), Reference($t8) # borrowed_by: LocalRoot($t1) -> {(*, Reference($t4))}, LocalRoot($t10) -> {(*, Reference($t4))}, Reference($t4) -> {(*, Reference($t9))} # borrows_from: Reference($t4) -> {(*, LocalRoot($t1)), (*, LocalRoot($t10))}, Reference($t9) -> {(*, Reference($t4))} 25: return $t10 }