From e8ecb97d047bf647cbd1502ddae4eda8c1b897a1 Mon Sep 17 00:00:00 2001 From: oflatt Date: Wed, 29 May 2024 11:38:38 -0700 Subject: [PATCH] snapshots --- tests/snapshots/files__add-optimize.snap | 6 +- ...files__add_block_indirection-optimize.snap | 6 +- .../files__block-diamond-optimize.snap | 54 +- tests/snapshots/files__bool-optimize.snap | 6 +- ...files__branch_duplicate_work-optimize.snap | 16 +- ...ollatz_redundant_computation-optimize.snap | 52 +- .../files__constant_fold_simple-optimize.snap | 8 +- tests/snapshots/files__diamond-optimize.snap | 18 +- .../files__duplicate_branch-optimize.snap | 18 +- .../files__eliminate_gamma-optimize.snap | 6 +- ...es__eliminate_gamma_interval-optimize.snap | 30 +- .../files__eliminate_loop-optimize.snap | 6 +- .../files__fib_recursive-optimize.snap | 524 +++++++++--------- .../snapshots/files__fib_shape-optimize.snap | 22 +- .../files__five_call_nestings-optimize.snap | 22 +- .../files__flatten_loop-optimize.snap | 38 +- .../files__four_call_nestings-optimize.snap | 20 +- .../files__gamma_condition_and-optimize.snap | 32 +- .../files__gamma_pull_in-optimize.snap | 20 +- .../files__if_constant_fold-optimize.snap | 10 +- .../files__if_constant_fold2-optimize.snap | 34 +- .../snapshots/files__if_context-optimize.snap | 24 +- .../files__if_dead_code-optimize.snap | 20 +- .../files__if_interval-optimize.snap | 22 +- .../files__implicit-return-optimize.snap | 62 +-- .../files__impossible_if-optimize.snap | 28 +- .../files__jumping_loop-optimize.snap | 20 +- .../snapshots/files__loop_hoist-optimize.snap | 30 +- tests/snapshots/files__loop_if-optimize.snap | 40 +- .../files__loop_pass_through-optimize.snap | 16 +- .../files__loop_with_mul_by_inv-optimize.snap | 24 +- ...s__mem_loop_store_forwarding-optimize.snap | 30 +- ...s__mem_simple_redundant_load-optimize.snap | 22 +- ..._mem_simple_store_forwarding-optimize.snap | 20 +- .../files__nested_call-optimize.snap | 24 +- .../snapshots/files__peel_twice-optimize.snap | 6 +- ...les__peel_twice_precalc_pred-optimize.snap | 6 +- .../files__range_check-optimize.snap | 48 +- .../files__range_splitting-optimize.snap | 46 +- tests/snapshots/files__reassoc-optimize.snap | 14 +- .../files__recurse_once-optimize.snap | 50 +- .../files__simple-call-optimize.snap | 12 +- .../files__simple_branch-optimize.snap | 20 +- .../files__simple_call-optimize.snap | 12 +- .../files__simple_loop-optimize.snap | 6 +- .../files__simple_loop_swap-optimize.snap | 20 +- .../files__simple_recursive-optimize.snap | 56 +- .../files__simplest_loop-optimize.snap | 20 +- .../files__small-collatz-optimize.snap | 58 +- .../snapshots/files__small-fib-optimize.snap | 38 +- tests/snapshots/files__sqrt-optimize.snap | 82 +-- .../files__strong_loop-optimize.snap | 30 +- tests/snapshots/files__two_fns-optimize.snap | 12 +- ...es__unroll_and_constant_fold-optimize.snap | 6 +- .../files__unroll_multiple_4-optimize.snap | 20 +- 55 files changed, 946 insertions(+), 946 deletions(-) diff --git a/tests/snapshots/files__add-optimize.snap b/tests/snapshots/files__add-optimize.snap index d95e208b7..0fa2f9633 100644 --- a/tests/snapshots/files__add-optimize.snap +++ b/tests/snapshots/files__add-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 3; - print v1_; +.b0_: + c1_: int = const 3; + print c1_; } diff --git a/tests/snapshots/files__add_block_indirection-optimize.snap b/tests/snapshots/files__add_block_indirection-optimize.snap index d95e208b7..0fa2f9633 100644 --- a/tests/snapshots/files__add_block_indirection-optimize.snap +++ b/tests/snapshots/files__add_block_indirection-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 3; - print v1_; +.b0_: + c1_: int = const 3; + print c1_; } diff --git a/tests/snapshots/files__block-diamond-optimize.snap b/tests/snapshots/files__block-diamond-optimize.snap index 300d2c0ca..047b5bcce 100644 --- a/tests/snapshots/files__block-diamond-optimize.snap +++ b/tests/snapshots/files__block-diamond-optimize.snap @@ -3,35 +3,35 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 2; - v3_: bool = lt v0 v2_; +.b1_: + c2_: int = const 2; + v3_: bool = lt v0 c2_; v4_: bool = not v3_; - v5_: int = const 0; - v6_: int = const 1; - v7_: int = const 5; - v8_: bool = const true; - v9_: int = id v6_; - v10_: int = id v6_; - v11_: int = id v2_; - v12_: bool = id v8_; - br v3_ .v13_ .v14_; -.v13_: - v15_: int = const 4; - v16_: bool = const false; - v9_: int = id v15_; - v10_: int = id v6_; - v11_: int = id v2_; - v12_: bool = id v16_; -.v14_: + c5_: int = const 0; + c6_: int = const 1; + c7_: int = const 5; + c8_: bool = const true; + v9_: int = id c6_; + v10_: int = id c6_; + v11_: int = id c2_; + v12_: bool = id c8_; + br v3_ .b13_ .b14_; +.b13_: + c15_: int = const 4; + c16_: bool = const false; + v9_: int = id c15_; + v10_: int = id c6_; + v11_: int = id c2_; + v12_: bool = id c16_; +.b14_: v17_: int = id v9_; - v18_: int = id v6_; - br v4_ .v19_ .v20_; -.v19_: - v21_: int = add v2_ v9_; + v18_: int = id c6_; + br v4_ .b19_ .b20_; +.b19_: + v21_: int = add c2_ v9_; v17_: int = id v21_; - v18_: int = id v6_; -.v20_: - v22_: int = add v17_ v6_; + v18_: int = id c6_; +.b20_: + v22_: int = add c6_ v17_; print v22_; } diff --git a/tests/snapshots/files__bool-optimize.snap b/tests/snapshots/files__bool-optimize.snap index 6eecd39bc..be6719990 100644 --- a/tests/snapshots/files__bool-optimize.snap +++ b/tests/snapshots/files__bool-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: bool = const true; - print v1_; +.b0_: + c1_: bool = const true; + print c1_; } diff --git a/tests/snapshots/files__branch_duplicate_work-optimize.snap b/tests/snapshots/files__branch_duplicate_work-optimize.snap index 16aa11209..87248bd9c 100644 --- a/tests/snapshots/files__branch_duplicate_work-optimize.snap +++ b/tests/snapshots/files__branch_duplicate_work-optimize.snap @@ -3,19 +3,19 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 2; - v3_: bool = lt v0 v2_; - br v3_ .v4_ .v5_; -.v4_: +.b1_: + c2_: int = const 2; + v3_: bool = lt v0 c2_; + br v3_ .b4_ .b5_; +.b4_: v6_: int = add v0 v0; v7_: int = id v6_; print v7_; ret; -.v5_: +.b5_: v8_: int = add v0 v0; - v9_: int = mul v2_ v8_; + v9_: int = mul c2_ v8_; v7_: int = id v9_; -.v10_: +.b10_: print v7_; } diff --git a/tests/snapshots/files__collatz_redundant_computation-optimize.snap b/tests/snapshots/files__collatz_redundant_computation-optimize.snap index 187e40bd8..80ca1983d 100644 --- a/tests/snapshots/files__collatz_redundant_computation-optimize.snap +++ b/tests/snapshots/files__collatz_redundant_computation-optimize.snap @@ -3,29 +3,29 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 1; - v3_: int = const 3; - v4_: int = const 2; - v5_: int = const 0; +.b1_: + c2_: int = const 1; + c3_: int = const 3; + c4_: int = const 2; + c5_: int = const 0; v6_: int = id v0; v7_: int = id v0; - v8_: int = id v2_; - v9_: int = id v3_; - v10_: int = id v4_; - v11_: int = id v5_; -.v12_: + v8_: int = id c2_; + v9_: int = id c3_; + v10_: int = id c4_; + v11_: int = id c5_; +.b12_: v13_: bool = eq v7_ v8_; - v14_: bool = const false; + c14_: bool = const false; v15_: int = id v6_; - v16_: bool = id v14_; + v16_: bool = id c14_; v17_: int = id v7_; v18_: int = id v7_; v19_: int = id v9_; v20_: int = id v10_; v21_: int = id v11_; - br v13_ .v22_ .v23_; -.v23_: + br v13_ .b22_ .b23_; +.b23_: v24_: int = div v7_ v10_; v25_: int = mul v10_ v24_; v26_: int = sub v7_ v25_; @@ -33,34 +33,34 @@ expression: visualization.result print v7_; v28_: int = mul v7_ v9_; v29_: int = add v28_ v8_; - v30_: bool = const true; + c30_: bool = const true; v31_: int = id v6_; - v32_: bool = id v30_; + v32_: bool = id c30_; v33_: int = id v29_; v34_: int = id v8_; v35_: int = id v9_; v36_: int = id v10_; v37_: int = id v11_; - br v27_ .v38_ .v39_; -.v38_: - v40_: bool = const true; + br v27_ .b38_ .b39_; +.b38_: + c40_: bool = const true; v31_: int = id v6_; - v32_: bool = id v40_; + v32_: bool = id c40_; v33_: int = id v24_; v34_: int = id v8_; v35_: int = id v9_; v36_: int = id v10_; v37_: int = id v11_; -.v39_: - v41_: bool = const true; +.b39_: + c41_: bool = const true; v15_: int = id v6_; - v16_: bool = id v41_; + v16_: bool = id c41_; v17_: int = id v33_; v18_: int = id v8_; v19_: int = id v9_; v20_: int = id v10_; v21_: int = id v11_; -.v22_: +.b22_: v42_: bool = not v13_; v6_: int = id v6_; v7_: int = id v17_; @@ -68,7 +68,7 @@ expression: visualization.result v9_: int = id v9_; v10_: int = id v10_; v11_: int = id v11_; - br v42_ .v12_ .v43_; -.v43_: + br v42_ .b12_ .b43_; +.b43_: print v0; } diff --git a/tests/snapshots/files__constant_fold_simple-optimize.snap b/tests/snapshots/files__constant_fold_simple-optimize.snap index c32019f7e..e7558db1f 100644 --- a/tests/snapshots/files__constant_fold_simple-optimize.snap +++ b/tests/snapshots/files__constant_fold_simple-optimize.snap @@ -3,9 +3,9 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 3; - v2_: int = const 2; - v3_: int = div v1_ v2_; +.b0_: + c1_: int = const 3; + c2_: int = const 2; + v3_: int = div c1_ c2_; print v3_; } diff --git a/tests/snapshots/files__diamond-optimize.snap b/tests/snapshots/files__diamond-optimize.snap index 815ec7797..8ee1eecf7 100644 --- a/tests/snapshots/files__diamond-optimize.snap +++ b/tests/snapshots/files__diamond-optimize.snap @@ -3,15 +3,15 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: +.b1_: v2_: bool = lt v0 v0; - br v2_ .v3_ .v4_; -.v3_: - v5_: int = const 1; - print v5_; + br v2_ .b3_ .b4_; +.b3_: + c5_: int = const 1; + print c5_; ret; -.v4_: - v6_: int = const 2; - print v6_; -.v7_: +.b4_: + c6_: int = const 2; + print c6_; +.b7_: } diff --git a/tests/snapshots/files__duplicate_branch-optimize.snap b/tests/snapshots/files__duplicate_branch-optimize.snap index cb9f9dd84..7f02efff8 100644 --- a/tests/snapshots/files__duplicate_branch-optimize.snap +++ b/tests/snapshots/files__duplicate_branch-optimize.snap @@ -3,13 +3,13 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 4; - v3_: bool = lt v2_ v0; - v4_: int = id v2_; - br v3_ .v5_ .v6_; -.v5_: - v4_: int = id v2_; -.v6_: - print v2_; +.b1_: + c2_: int = const 4; + v3_: bool = lt c2_ v0; + v4_: int = id c2_; + br v3_ .b5_ .b6_; +.b5_: + v4_: int = id c2_; +.b6_: + print c2_; } diff --git a/tests/snapshots/files__eliminate_gamma-optimize.snap b/tests/snapshots/files__eliminate_gamma-optimize.snap index 8449ee79a..0020317f3 100644 --- a/tests/snapshots/files__eliminate_gamma-optimize.snap +++ b/tests/snapshots/files__eliminate_gamma-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 1; - print v1_; +.b0_: + c1_: int = const 1; + print c1_; } diff --git a/tests/snapshots/files__eliminate_gamma_interval-optimize.snap b/tests/snapshots/files__eliminate_gamma_interval-optimize.snap index fc1dfb7ef..d1d687cc3 100644 --- a/tests/snapshots/files__eliminate_gamma_interval-optimize.snap +++ b/tests/snapshots/files__eliminate_gamma_interval-optimize.snap @@ -3,19 +3,19 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: bool = const false; - v3_: int = const 10; - v4_: bool = lt v0 v3_; - v5_: int = const 5; - v6_: int = const 3; - v7_: int = id v3_; - v8_: int = id v6_; - br v4_ .v9_ .v10_; -.v9_: - v11_: int = const 7; - v7_: int = id v3_; - v8_: int = id v11_; -.v10_: - print v2_; +.b1_: + c2_: bool = const false; + c3_: int = const 10; + v4_: bool = lt v0 c3_; + c5_: int = const 5; + c6_: int = const 3; + v7_: int = id c3_; + v8_: int = id c6_; + br v4_ .b9_ .b10_; +.b9_: + c11_: int = const 7; + v7_: int = id c3_; + v8_: int = id c11_; +.b10_: + print c2_; } diff --git a/tests/snapshots/files__eliminate_loop-optimize.snap b/tests/snapshots/files__eliminate_loop-optimize.snap index 8449ee79a..0020317f3 100644 --- a/tests/snapshots/files__eliminate_loop-optimize.snap +++ b/tests/snapshots/files__eliminate_loop-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 1; - print v1_; +.b0_: + c1_: int = const 1; + print c1_; } diff --git a/tests/snapshots/files__fib_recursive-optimize.snap b/tests/snapshots/files__fib_recursive-optimize.snap index 9a02639c2..248e01f79 100644 --- a/tests/snapshots/files__fib_recursive-optimize.snap +++ b/tests/snapshots/files__fib_recursive-optimize.snap @@ -3,340 +3,340 @@ source: tests/files.rs expression: visualization.result --- @fac(v0: int): int { -.v1_: - v2_: int = const 0; - v3_: bool = eq v0 v2_; - v4_: int = const 1; - v5_: int = id v4_; - br v3_ .v6_ .v7_; -.v7_: - v8_: bool = eq v0 v4_; - br v8_ .v9_ .v10_; -.v9_: - v11_: bool = eq v2_ v2_; - v12_: int = id v4_; - br v11_ .v13_ .v14_; -.v14_: - v15_: bool = eq v2_ v4_; - br v15_ .v16_ .v17_; -.v16_: - v18_: bool = eq v2_ v2_; - v19_: int = id v4_; - br v18_ .v20_ .v21_; -.v21_: - v22_: bool = eq v2_ v4_; - br v22_ .v23_ .v24_; -.v23_: - v25_: int = call @fac v2_; - v26_: int = id v4_; -.v27_: +.b1_: + c2_: int = const 0; + v3_: bool = eq c2_ v0; + c4_: int = const 1; + v5_: int = id c4_; + br v3_ .b6_ .b7_; +.b7_: + v8_: bool = eq c4_ v0; + br v8_ .b9_ .b10_; +.b9_: + v11_: bool = eq c2_ c2_; + v12_: int = id c4_; + br v11_ .b13_ .b14_; +.b14_: + v15_: bool = eq c2_ c4_; + br v15_ .b16_ .b17_; +.b16_: + v18_: bool = eq c2_ c2_; + v19_: int = id c4_; + br v18_ .b20_ .b21_; +.b21_: + v22_: bool = eq c2_ c4_; + br v22_ .b23_ .b24_; +.b23_: + v25_: int = call @fac c2_; + v26_: int = id c4_; +.b27_: v19_: int = id v26_; -.v20_: - v28_: int = id v4_; -.v29_: +.b20_: + v28_: int = id c4_; +.b29_: v12_: int = id v28_; -.v13_: - v30_: int = id v4_; -.v31_: +.b13_: + v30_: int = id c4_; +.b31_: v5_: int = id v30_; ret v5_; -.v24_: - v32_: int = const -1; - v33_: int = sub v32_ v4_; - v34_: int = call @fac v32_; +.b24_: + c32_: int = const -1; + v33_: int = sub c32_ c4_; + v34_: int = call @fac c32_; v35_: int = call @fac v33_; v36_: int = add v34_ v35_; v26_: int = id v36_; - jmp .v27_; -.v17_: - v37_: int = const -2; - v38_: bool = eq v2_ v37_; - v39_: int = const -1; - v40_: bool = eq v2_ v39_; - v41_: int = id v4_; - br v40_ .v42_ .v43_; -.v43_: - v44_: bool = eq v39_ v4_; - br v44_ .v45_ .v46_; -.v45_: - v47_: int = call @fac v2_; - v48_: int = id v4_; -.v49_: + jmp .b27_; +.b17_: + c37_: int = const -2; + v38_: bool = eq c2_ c37_; + c39_: int = const -1; + v40_: bool = eq c2_ c39_; + v41_: int = id c4_; + br v40_ .b42_ .b43_; +.b43_: + v44_: bool = eq c39_ c4_; + br v44_ .b45_ .b46_; +.b45_: + v47_: int = call @fac c2_; + v48_: int = id c4_; +.b49_: v41_: int = id v48_; -.v42_: - v50_: int = id v4_; - br v38_ .v51_ .v52_; -.v52_: - v53_: bool = eq v37_ v4_; - br v53_ .v54_ .v55_; -.v54_: - v56_: int = call @fac v2_; - v57_: int = id v4_; -.v58_: +.b42_: + v50_: int = id c4_; + br v38_ .b51_ .b52_; +.b52_: + v53_: bool = eq c37_ c4_; + br v53_ .b54_ .b55_; +.b54_: + v56_: int = call @fac c2_; + v57_: int = id c4_; +.b58_: v50_: int = id v57_; -.v51_: +.b51_: v59_: int = add v41_ v50_; v28_: int = id v59_; - jmp .v29_; -.v55_: - v60_: int = const -4; - v61_: int = const -3; - v62_: int = call @fac v61_; - v63_: int = call @fac v60_; + jmp .b29_; +.b55_: + c60_: int = const -4; + c61_: int = const -3; + v62_: int = call @fac c61_; + v63_: int = call @fac c60_; v64_: int = add v62_ v63_; v57_: int = id v64_; - jmp .v58_; -.v46_: - v65_: int = const -3; - v66_: int = const -2; - v67_: int = call @fac v66_; - v68_: int = call @fac v65_; + jmp .b58_; +.b46_: + c65_: int = const -3; + c66_: int = const -2; + v67_: int = call @fac c66_; + v68_: int = call @fac c65_; v69_: int = add v67_ v68_; v48_: int = id v69_; - jmp .v49_; -.v10_: - v70_: int = sub v0 v4_; - v71_: int = sub v70_ v4_; - v72_: bool = eq v2_ v71_; - v73_: bool = eq v2_ v70_; - v74_: int = id v4_; - br v73_ .v75_ .v76_; -.v76_: - v77_: bool = eq v4_ v70_; - br v77_ .v78_ .v79_; -.v78_: - v80_: bool = eq v2_ v2_; + jmp .b49_; +.b10_: + v70_: int = sub v0 c4_; + v71_: int = sub v70_ c4_; + v72_: bool = eq c2_ v71_; + v73_: bool = eq c2_ v70_; + v74_: int = id c4_; + br v73_ .b75_ .b76_; +.b76_: + v77_: bool = eq c4_ v70_; + br v77_ .b78_ .b79_; +.b78_: + v80_: bool = eq c2_ c2_; v81_: int = id v70_; - br v80_ .v82_ .v83_; -.v83_: - v84_: bool = eq v2_ v70_; - br v84_ .v85_ .v86_; -.v85_: - v87_: int = call @fac v2_; - v88_: int = id v2_; -.v89_: + br v80_ .b82_ .b83_; +.b83_: + v84_: bool = eq c2_ v70_; + br v84_ .b85_ .b86_; +.b85_: + v87_: int = call @fac c2_; + v88_: int = id c2_; +.b89_: v81_: int = id v88_; -.v82_: +.b82_: v90_: int = id v70_; -.v91_: +.b91_: v74_: int = id v90_; -.v75_: - v92_: int = id v4_; - br v72_ .v93_ .v94_; -.v94_: - v95_: bool = eq v4_ v71_; - br v95_ .v96_ .v97_; -.v96_: - v98_: bool = eq v2_ v2_; +.b75_: + v92_: int = id c4_; + br v72_ .b93_ .b94_; +.b94_: + v95_: bool = eq c4_ v71_; + br v95_ .b96_ .b97_; +.b96_: + v98_: bool = eq c2_ c2_; v99_: int = id v71_; - br v98_ .v100_ .v101_; -.v101_: - v102_: bool = eq v2_ v71_; - br v102_ .v103_ .v104_; -.v103_: - v105_: int = call @fac v2_; + br v98_ .b100_ .b101_; +.b101_: + v102_: bool = eq c2_ v71_; + br v102_ .b103_ .b104_; +.b103_: + v105_: int = call @fac c2_; v106_: int = id v71_; -.v107_: +.b107_: v99_: int = id v106_; -.v100_: +.b100_: v108_: int = id v71_; -.v109_: +.b109_: v92_: int = id v108_; -.v93_: +.b93_: v110_: int = add v74_ v92_; v30_: int = id v110_; - jmp .v31_; -.v104_: - v111_: int = const -2; - v112_: int = const -1; - v113_: int = call @fac v112_; - v114_: int = call @fac v111_; + jmp .b31_; +.b104_: + c111_: int = const -2; + c112_: int = const -1; + v113_: int = call @fac c112_; + v114_: int = call @fac c111_; v115_: int = add v113_ v114_; v106_: int = id v115_; - jmp .v107_; -.v97_: - v116_: int = sub v71_ v4_; - v117_: int = sub v116_ v4_; - v118_: bool = eq v117_ v2_; - v119_: bool = eq v116_ v2_; - v120_: int = id v4_; - br v119_ .v121_ .v122_; -.v122_: - v123_: bool = eq v116_ v4_; - br v123_ .v124_ .v125_; -.v124_: - v126_: int = call @fac v2_; + jmp .b107_; +.b97_: + v116_: int = sub v71_ c4_; + v117_: int = sub v116_ c4_; + v118_: bool = eq c2_ v117_; + v119_: bool = eq c2_ v116_; + v120_: int = id c4_; + br v119_ .b121_ .b122_; +.b122_: + v123_: bool = eq c4_ v116_; + br v123_ .b124_ .b125_; +.b124_: + v126_: int = call @fac c2_; v127_: int = id v116_; -.v128_: +.b128_: v120_: int = id v127_; -.v121_: - v129_: int = id v4_; - br v118_ .v130_ .v131_; -.v131_: - v132_: bool = eq v117_ v4_; - br v132_ .v133_ .v134_; -.v133_: - v135_: int = call @fac v2_; - v136_: int = id v4_; -.v137_: +.b121_: + v129_: int = id c4_; + br v118_ .b130_ .b131_; +.b131_: + v132_: bool = eq c4_ v117_; + br v132_ .b133_ .b134_; +.b133_: + v135_: int = call @fac c2_; + v136_: int = id c4_; +.b137_: v129_: int = id v136_; -.v130_: +.b130_: v138_: int = add v120_ v129_; v108_: int = id v138_; - jmp .v109_; -.v134_: - v139_: int = sub v117_ v4_; - v140_: int = sub v139_ v4_; + jmp .b109_; +.b134_: + v139_: int = sub v117_ c4_; + v140_: int = sub v139_ c4_; v141_: int = call @fac v139_; v142_: int = call @fac v140_; v143_: int = add v141_ v142_; v136_: int = id v143_; - jmp .v137_; -.v125_: - v144_: int = sub v116_ v4_; - v145_: int = sub v144_ v4_; + jmp .b137_; +.b125_: + v144_: int = sub v116_ c4_; + v145_: int = sub v144_ c4_; v146_: int = call @fac v144_; v147_: int = call @fac v145_; v148_: int = add v146_ v147_; v127_: int = id v148_; - jmp .v128_; -.v86_: - v149_: int = const -2; - v150_: int = const -1; - v151_: int = call @fac v150_; - v152_: int = call @fac v149_; + jmp .b128_; +.b86_: + c149_: int = const -2; + c150_: int = const -1; + v151_: int = call @fac c150_; + v152_: int = call @fac c149_; v153_: int = add v151_ v152_; v88_: int = id v153_; - jmp .v89_; -.v79_: - v154_: int = sub v70_ v4_; - v155_: int = sub v154_ v4_; - v156_: bool = eq v155_ v2_; - v157_: bool = eq v154_ v2_; - v158_: int = id v4_; - br v157_ .v159_ .v160_; -.v160_: - v161_: bool = eq v154_ v4_; - br v161_ .v162_ .v163_; -.v162_: - v164_: int = call @fac v2_; - v165_: int = id v4_; -.v166_: + jmp .b89_; +.b79_: + v154_: int = sub v70_ c4_; + v155_: int = sub v154_ c4_; + v156_: bool = eq c2_ v155_; + v157_: bool = eq c2_ v154_; + v158_: int = id c4_; + br v157_ .b159_ .b160_; +.b160_: + v161_: bool = eq c4_ v154_; + br v161_ .b162_ .b163_; +.b162_: + v164_: int = call @fac c2_; + v165_: int = id c4_; +.b166_: v158_: int = id v165_; -.v159_: - v167_: int = id v4_; - br v156_ .v168_ .v169_; -.v169_: - v170_: bool = eq v155_ v4_; - br v170_ .v171_ .v172_; -.v171_: - v173_: int = call @fac v2_; - v174_: int = id v4_; -.v175_: +.b159_: + v167_: int = id c4_; + br v156_ .b168_ .b169_; +.b169_: + v170_: bool = eq c4_ v155_; + br v170_ .b171_ .b172_; +.b171_: + v173_: int = call @fac c2_; + v174_: int = id c4_; +.b175_: v167_: int = id v174_; -.v168_: +.b168_: v176_: int = add v158_ v167_; v90_: int = id v176_; - jmp .v91_; -.v172_: - v177_: int = sub v155_ v4_; - v178_: int = sub v177_ v4_; + jmp .b91_; +.b172_: + v177_: int = sub v155_ c4_; + v178_: int = sub v177_ c4_; v179_: int = call @fac v177_; v180_: int = call @fac v178_; v181_: int = add v179_ v180_; v174_: int = id v181_; - jmp .v175_; -.v163_: - v182_: int = sub v154_ v4_; - v183_: int = sub v182_ v4_; + jmp .b175_; +.b163_: + v182_: int = sub v154_ c4_; + v183_: int = sub v182_ c4_; v184_: int = call @fac v182_; v185_: int = call @fac v183_; v186_: int = add v184_ v185_; v165_: int = id v186_; - jmp .v166_; -.v6_: + jmp .b166_; +.b6_: ret v5_; } @main { -.v0_: - v1_: int = const 2; - v2_: int = const 0; - v3_: bool = eq v1_ v2_; - v4_: int = const 1; - v5_: int = id v4_; - br v3_ .v6_ .v7_; -.v7_: - v8_: bool = eq v1_ v4_; - br v8_ .v9_ .v10_; -.v9_: - v11_: bool = eq v2_ v2_; - v12_: int = id v4_; - br v11_ .v13_ .v14_; -.v14_: - v15_: bool = eq v2_ v4_; - br v15_ .v16_ .v17_; -.v16_: - v18_: int = call @fac v2_; - v19_: int = id v4_; -.v20_: +.b0_: + c1_: int = const 2; + c2_: int = const 0; + v3_: bool = eq c1_ c2_; + c4_: int = const 1; + v5_: int = id c4_; + br v3_ .b6_ .b7_; +.b7_: + v8_: bool = eq c1_ c4_; + br v8_ .b9_ .b10_; +.b9_: + v11_: bool = eq c2_ c2_; + v12_: int = id c4_; + br v11_ .b13_ .b14_; +.b14_: + v15_: bool = eq c2_ c4_; + br v15_ .b16_ .b17_; +.b16_: + v18_: int = call @fac c2_; + v19_: int = id c4_; +.b20_: v12_: int = id v19_; -.v13_: - v21_: int = id v4_; -.v22_: +.b13_: + v21_: int = id c4_; +.b22_: v5_: int = id v21_; print v5_; ret; -.v17_: - v23_: int = const -1; - v24_: int = sub v23_ v4_; - v25_: int = call @fac v23_; +.b17_: + c23_: int = const -1; + v24_: int = sub c23_ c4_; + v25_: int = call @fac c23_; v26_: int = call @fac v24_; v27_: int = add v25_ v26_; v19_: int = id v27_; - jmp .v20_; -.v10_: - v28_: bool = eq v2_ v2_; - v29_: bool = eq v2_ v4_; - v30_: int = id v4_; - br v29_ .v31_ .v32_; -.v32_: - v33_: bool = eq v4_ v4_; - br v33_ .v34_ .v35_; -.v34_: - v36_: int = call @fac v2_; - v37_: int = id v4_; -.v38_: + jmp .b20_; +.b10_: + v28_: bool = eq c2_ c2_; + v29_: bool = eq c2_ c4_; + v30_: int = id c4_; + br v29_ .b31_ .b32_; +.b32_: + v33_: bool = eq c4_ c4_; + br v33_ .b34_ .b35_; +.b34_: + v36_: int = call @fac c2_; + v37_: int = id c4_; +.b38_: v30_: int = id v37_; -.v31_: - v39_: int = id v4_; - br v28_ .v40_ .v41_; -.v41_: - v42_: bool = eq v2_ v4_; - br v42_ .v43_ .v44_; -.v43_: - v45_: int = call @fac v2_; - v46_: int = id v4_; -.v47_: +.b31_: + v39_: int = id c4_; + br v28_ .b40_ .b41_; +.b41_: + v42_: bool = eq c2_ c4_; + br v42_ .b43_ .b44_; +.b43_: + v45_: int = call @fac c2_; + v46_: int = id c4_; +.b47_: v39_: int = id v46_; -.v40_: +.b40_: v48_: int = add v30_ v39_; v21_: int = id v48_; - jmp .v22_; -.v44_: - v49_: int = const -2; - v50_: int = const -1; - v51_: int = call @fac v50_; - v52_: int = call @fac v49_; + jmp .b22_; +.b44_: + c49_: int = const -2; + c50_: int = const -1; + v51_: int = call @fac c50_; + v52_: int = call @fac c49_; v53_: int = add v51_ v52_; v46_: int = id v53_; - jmp .v47_; -.v35_: - v54_: int = const -1; - v55_: int = call @fac v2_; - v56_: int = call @fac v54_; + jmp .b47_; +.b35_: + c54_: int = const -1; + v55_: int = call @fac c2_; + v56_: int = call @fac c54_; v57_: int = add v55_ v56_; v37_: int = id v57_; - jmp .v38_; -.v6_: + jmp .b38_; +.b6_: print v5_; } diff --git a/tests/snapshots/files__fib_shape-optimize.snap b/tests/snapshots/files__fib_shape-optimize.snap index c6fdc858b..28e318faf 100644 --- a/tests/snapshots/files__fib_shape-optimize.snap +++ b/tests/snapshots/files__fib_shape-optimize.snap @@ -3,28 +3,28 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: int = const 1; - v4_: int = id v2_; - v5_: int = id v3_; +.b1_: + c2_: int = const 0; + c3_: int = const 1; + v4_: int = id c2_; + v5_: int = id c3_; v6_: int = id v0; -.v7_: +.b7_: v8_: bool = lt v4_ v6_; v9_: int = id v4_; v10_: int = id v5_; v11_: int = id v6_; - br v8_ .v12_ .v13_; -.v12_: + br v8_ .b12_ .b13_; +.b12_: v14_: int = add v4_ v5_; v9_: int = id v14_; v10_: int = id v5_; v11_: int = id v6_; -.v13_: +.b13_: v4_: int = id v9_; v5_: int = id v10_; v6_: int = id v11_; - br v8_ .v7_ .v15_; -.v15_: + br v8_ .b7_ .b15_; +.b15_: print v4_; } diff --git a/tests/snapshots/files__five_call_nestings-optimize.snap b/tests/snapshots/files__five_call_nestings-optimize.snap index 099ef3d53..addf5f8d8 100644 --- a/tests/snapshots/files__five_call_nestings-optimize.snap +++ b/tests/snapshots/files__five_call_nestings-optimize.snap @@ -3,25 +3,25 @@ source: tests/files.rs expression: visualization.result --- @one { -.v0_: +.b0_: call @four; } @two { -.v0_: - v1_: int = const 4; - print v1_; +.b0_: + c1_: int = const 4; + print c1_; } @three { -.v0_: - v1_: int = const 4; - print v1_; +.b0_: + c1_: int = const 4; + print c1_; } @four { -.v0_: - v1_: int = const 4; - print v1_; +.b0_: + c1_: int = const 4; + print c1_; } @main { -.v0_: +.b0_: call @three; } diff --git a/tests/snapshots/files__flatten_loop-optimize.snap b/tests/snapshots/files__flatten_loop-optimize.snap index 8bb02d229..f6eccb4d9 100644 --- a/tests/snapshots/files__flatten_loop-optimize.snap +++ b/tests/snapshots/files__flatten_loop-optimize.snap @@ -3,36 +3,36 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int, v1: int) { -.v2_: - v3_: int = const 0; - v4_: int = const 1; - v5_: int = id v3_; - v6_: int = id v4_; +.b2_: + c3_: int = const 0; + c4_: int = const 1; + v5_: int = id c3_; + v6_: int = id c4_; v7_: int = id v1; v8_: int = id v0; -.v9_: +.b9_: v10_: bool = lt v5_ v8_; v11_: int = id v5_; v12_: int = id v6_; v13_: int = id v7_; v14_: int = id v8_; - br v10_ .v15_ .v16_; -.v15_: - v17_: int = const 0; + br v10_ .b15_ .b16_; +.b15_: + c17_: int = const 0; v18_: int = id v5_; v19_: int = id v6_; - v20_: int = id v17_; + v20_: int = id c17_; v21_: int = id v7_; v22_: int = id v8_; -.v23_: +.b23_: v24_: bool = lt v20_ v21_; v25_: int = id v18_; v26_: int = id v19_; v27_: int = id v20_; v28_: int = id v21_; v29_: int = id v22_; - br v24_ .v30_ .v31_; -.v30_: + br v24_ .b30_ .b31_; +.b30_: v32_: int = mul v18_ v21_; v33_: int = add v20_ v32_; print v33_; @@ -42,25 +42,25 @@ expression: visualization.result v27_: int = id v34_; v28_: int = id v21_; v29_: int = id v22_; -.v31_: +.b31_: v18_: int = id v25_; v19_: int = id v26_; v20_: int = id v27_; v21_: int = id v28_; v22_: int = id v29_; - br v24_ .v23_ .v35_; -.v35_: + br v24_ .b23_ .b35_; +.b35_: v36_: int = add v5_ v6_; v11_: int = id v36_; v12_: int = id v6_; v13_: int = id v7_; v14_: int = id v8_; -.v16_: +.b16_: v5_: int = id v11_; v6_: int = id v12_; v7_: int = id v13_; v8_: int = id v14_; - br v10_ .v9_ .v37_; -.v37_: + br v10_ .b9_ .b37_; +.b37_: print v5_; } diff --git a/tests/snapshots/files__four_call_nestings-optimize.snap b/tests/snapshots/files__four_call_nestings-optimize.snap index 3c3b0a5bc..467fe4938 100644 --- a/tests/snapshots/files__four_call_nestings-optimize.snap +++ b/tests/snapshots/files__four_call_nestings-optimize.snap @@ -3,21 +3,21 @@ source: tests/files.rs expression: visualization.result --- @one { -.v0_: - v1_: int = const 3; - print v1_; +.b0_: + c1_: int = const 3; + print c1_; } @two { -.v0_: - v1_: int = const 3; - print v1_; +.b0_: + c1_: int = const 3; + print c1_; } @three { -.v0_: - v1_: int = const 3; - print v1_; +.b0_: + c1_: int = const 3; + print c1_; } @main { -.v0_: +.b0_: call @three; } diff --git a/tests/snapshots/files__gamma_condition_and-optimize.snap b/tests/snapshots/files__gamma_condition_and-optimize.snap index d2fb01cff..587bd7e9e 100644 --- a/tests/snapshots/files__gamma_condition_and-optimize.snap +++ b/tests/snapshots/files__gamma_condition_and-optimize.snap @@ -3,22 +3,22 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: bool = lt v2_ v0; - v4_: bool = lt v0 v2_; - v5_: int = const 1; - v6_: int = const 3; - v7_: int = id v6_; - br v3_ .v8_ .v9_; -.v8_: - v10_: int = const 3; - v11_: int = id v10_; - br v4_ .v12_ .v13_; -.v12_: - v11_: int = id v5_; -.v13_: +.b1_: + c2_: int = const 0; + v3_: bool = lt c2_ v0; + v4_: bool = lt v0 c2_; + c5_: int = const 1; + c6_: int = const 3; + v7_: int = id c6_; + br v3_ .b8_ .b9_; +.b8_: + c10_: int = const 3; + v11_: int = id c10_; + br v4_ .b12_ .b13_; +.b12_: + v11_: int = id c5_; +.b13_: v7_: int = id v11_; -.v9_: +.b9_: print v7_; } diff --git a/tests/snapshots/files__gamma_pull_in-optimize.snap b/tests/snapshots/files__gamma_pull_in-optimize.snap index dc6692046..568e0a3b9 100644 --- a/tests/snapshots/files__gamma_pull_in-optimize.snap +++ b/tests/snapshots/files__gamma_pull_in-optimize.snap @@ -3,16 +3,16 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 10; - v3_: bool = lt v0 v2_; - v4_: int = const 3; - v5_: int = id v4_; - br v3_ .v6_ .v7_; -.v6_: - v8_: int = const 2; - v5_: int = id v8_; -.v7_: +.b1_: + c2_: int = const 10; + v3_: bool = lt v0 c2_; + c4_: int = const 3; + v5_: int = id c4_; + br v3_ .b6_ .b7_; +.b6_: + c8_: int = const 2; + v5_: int = id c8_; +.b7_: v9_: int = add v5_ v5_; print v9_; } diff --git a/tests/snapshots/files__if_constant_fold-optimize.snap b/tests/snapshots/files__if_constant_fold-optimize.snap index bbcb07cbd..257db196f 100644 --- a/tests/snapshots/files__if_constant_fold-optimize.snap +++ b/tests/snapshots/files__if_constant_fold-optimize.snap @@ -3,9 +3,9 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 6; - v3_: int = const 3; - print v3_; - print v2_; +.b1_: + c2_: int = const 6; + c3_: int = const 3; + print c3_; + print c2_; } diff --git a/tests/snapshots/files__if_constant_fold2-optimize.snap b/tests/snapshots/files__if_constant_fold2-optimize.snap index 5e90f0242..0ccf05a4e 100644 --- a/tests/snapshots/files__if_constant_fold2-optimize.snap +++ b/tests/snapshots/files__if_constant_fold2-optimize.snap @@ -3,21 +3,21 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 20; - v3_: int = const 5; - v4_: bool = eq v0 v3_; - v5_: int = const 4; - v6_: int = id v2_; - br v4_ .v7_ .v8_; -.v8_: - v9_: bool = eq v0 v5_; - v10_: int = id v2_; - br v9_ .v11_ .v12_; -.v11_: - v10_: int = id v2_; -.v12_: - v6_: int = id v2_; -.v7_: - print v2_; +.b1_: + c2_: int = const 20; + c3_: int = const 5; + v4_: bool = eq c3_ v0; + c5_: int = const 4; + v6_: int = id c2_; + br v4_ .b7_ .b8_; +.b8_: + v9_: bool = eq c5_ v0; + v10_: int = id c2_; + br v9_ .b11_ .b12_; +.b11_: + v10_: int = id c2_; +.b12_: + v6_: int = id c2_; +.b7_: + print c2_; } diff --git a/tests/snapshots/files__if_context-optimize.snap b/tests/snapshots/files__if_context-optimize.snap index 9cbf293e5..1ec15577f 100644 --- a/tests/snapshots/files__if_context-optimize.snap +++ b/tests/snapshots/files__if_context-optimize.snap @@ -3,18 +3,18 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: bool = const true; - v3_: int = const 0; - v4_: bool = le v0 v3_; +.b1_: + c2_: bool = const true; + c3_: int = const 0; + v4_: bool = le v0 c3_; v5_: int = id v0; - v6_: int = id v3_; - br v4_ .v7_ .v8_; -.v8_: - v9_: int = const -1; - v10_: int = mul v0 v9_; + v6_: int = id c3_; + br v4_ .b7_ .b8_; +.b8_: + c9_: int = const -1; + v10_: int = mul c9_ v0; v5_: int = id v10_; - v6_: int = id v3_; -.v7_: - print v2_; + v6_: int = id c3_; +.b7_: + print c2_; } diff --git a/tests/snapshots/files__if_dead_code-optimize.snap b/tests/snapshots/files__if_dead_code-optimize.snap index fed962d86..9e9a5a294 100644 --- a/tests/snapshots/files__if_dead_code-optimize.snap +++ b/tests/snapshots/files__if_dead_code-optimize.snap @@ -3,16 +3,16 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: bool = lt v0 v2_; - v4_: int = const 0; - v5_: int = id v4_; - br v3_ .v6_ .v7_; -.v6_: - v8_: int = const 1; - v5_: int = id v8_; -.v7_: +.b1_: + c2_: int = const 0; + v3_: bool = lt v0 c2_; + c4_: int = const 0; + v5_: int = id c4_; + br v3_ .b6_ .b7_; +.b6_: + c8_: int = const 1; + v5_: int = id c8_; +.b7_: print v5_; print v3_; } diff --git a/tests/snapshots/files__if_interval-optimize.snap b/tests/snapshots/files__if_interval-optimize.snap index 29150d300..4fd11f29d 100644 --- a/tests/snapshots/files__if_interval-optimize.snap +++ b/tests/snapshots/files__if_interval-optimize.snap @@ -3,15 +3,15 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: bool = const true; - v3_: int = const 0; - v4_: bool = le v0 v3_; - v5_: int = const 3; - v6_: int = id v5_; - br v4_ .v7_ .v8_; -.v7_: - v6_: int = id v3_; -.v8_: - print v2_; +.b1_: + c2_: bool = const true; + c3_: int = const 0; + v4_: bool = le v0 c3_; + c5_: int = const 3; + v6_: int = id c5_; + br v4_ .b7_ .b8_; +.b7_: + v6_: int = id c3_; +.b8_: + print c2_; } diff --git a/tests/snapshots/files__implicit-return-optimize.snap b/tests/snapshots/files__implicit-return-optimize.snap index 53ad6fedf..13def91e7 100644 --- a/tests/snapshots/files__implicit-return-optimize.snap +++ b/tests/snapshots/files__implicit-return-optimize.snap @@ -3,69 +3,69 @@ source: tests/files.rs expression: visualization.result --- @pow(v0: int, v1: int) { -.v2_: - v3_: int = const 0; +.b2_: + c3_: int = const 0; v4_: int = id v0; - v5_: int = id v3_; + v5_: int = id c3_; v6_: int = id v0; v7_: int = id v1; -.v8_: - v9_: int = const 1; - v10_: int = sub v7_ v9_; +.b8_: + c9_: int = const 1; + v10_: int = sub v7_ c9_; v11_: bool = lt v5_ v10_; v12_: int = id v4_; v13_: int = id v5_; v14_: int = id v6_; v15_: int = id v7_; - br v11_ .v16_ .v17_; -.v16_: + br v11_ .b16_ .b17_; +.b16_: v18_: int = mul v4_ v6_; - v19_: int = const 1; - v20_: int = add v19_ v5_; + c19_: int = const 1; + v20_: int = add c19_ v5_; v12_: int = id v18_; v13_: int = id v20_; v14_: int = id v6_; v15_: int = id v7_; -.v17_: +.b17_: v4_: int = id v12_; v5_: int = id v13_; v6_: int = id v14_; v7_: int = id v15_; - br v11_ .v8_ .v21_; -.v21_: + br v11_ .b8_ .b21_; +.b21_: print v4_; } @main { -.v0_: - v1_: int = const 4; - v2_: int = const 0; - v3_: int = const 15; - v4_: int = id v1_; - v5_: int = id v2_; - v6_: int = id v1_; - v7_: int = id v3_; -.v8_: - v9_: int = const 14; - v10_: bool = lt v5_ v9_; +.b0_: + c1_: int = const 4; + c2_: int = const 0; + c3_: int = const 15; + v4_: int = id c1_; + v5_: int = id c2_; + v6_: int = id c1_; + v7_: int = id c3_; +.b8_: + c9_: int = const 14; + v10_: bool = lt v5_ c9_; v11_: int = id v4_; v12_: int = id v5_; v13_: int = id v6_; v14_: int = id v7_; - br v10_ .v15_ .v16_; -.v15_: + br v10_ .b15_ .b16_; +.b15_: v17_: int = mul v4_ v6_; - v18_: int = const 1; - v19_: int = add v18_ v5_; + c18_: int = const 1; + v19_: int = add c18_ v5_; v11_: int = id v17_; v12_: int = id v19_; v13_: int = id v6_; v14_: int = id v7_; -.v16_: +.b16_: v4_: int = id v11_; v5_: int = id v12_; v6_: int = id v13_; v7_: int = id v14_; - br v10_ .v8_ .v20_; -.v20_: + br v10_ .b8_ .b20_; +.b20_: print v4_; } diff --git a/tests/snapshots/files__impossible_if-optimize.snap b/tests/snapshots/files__impossible_if-optimize.snap index fd72f3598..f3ebafea2 100644 --- a/tests/snapshots/files__impossible_if-optimize.snap +++ b/tests/snapshots/files__impossible_if-optimize.snap @@ -3,19 +3,19 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 1; - v3_: int = const 2; - v4_: bool = lt v0 v3_; - br v4_ .v5_ .v6_; -.v5_: - print v2_; - v7_: int = id v2_; - print v2_; +.b1_: + c2_: int = const 1; + c3_: int = const 2; + v4_: bool = lt v0 c3_; + br v4_ .b5_ .b6_; +.b5_: + print c2_; + v7_: int = id c2_; + print c2_; ret; -.v6_: - print v2_; - v7_: int = id v2_; -.v8_: - print v2_; +.b6_: + print c2_; + v7_: int = id c2_; +.b8_: + print c2_; } diff --git a/tests/snapshots/files__jumping_loop-optimize.snap b/tests/snapshots/files__jumping_loop-optimize.snap index 03867db9c..ef3829b34 100644 --- a/tests/snapshots/files__jumping_loop-optimize.snap +++ b/tests/snapshots/files__jumping_loop-optimize.snap @@ -3,19 +3,19 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - v2_: int = const 18; - v3_: int = const 4; - v4_: int = id v1_; - v5_: int = id v2_; - v6_: int = id v3_; -.v7_: +.b0_: + c1_: int = const 0; + c2_: int = const 18; + c3_: int = const 4; + v4_: int = id c1_; + v5_: int = id c2_; + v6_: int = id c3_; +.b7_: v8_: int = add v4_ v6_; v9_: bool = lt v8_ v5_; v4_: int = id v8_; v5_: int = id v5_; v6_: int = id v6_; - br v9_ .v7_ .v10_; -.v10_: + br v9_ .b7_ .b10_; +.b10_: } diff --git a/tests/snapshots/files__loop_hoist-optimize.snap b/tests/snapshots/files__loop_hoist-optimize.snap index a1b35cc94..9096261c8 100644 --- a/tests/snapshots/files__loop_hoist-optimize.snap +++ b/tests/snapshots/files__loop_hoist-optimize.snap @@ -3,26 +3,26 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 1; - v2_: int = const 4; - v3_: int = const 3; - v4_: int = const 2; - v5_: int = id v1_; - v6_: int = id v2_; - v7_: int = id v3_; - v8_: int = id v4_; -.v9_: - v10_: int = const 1; - print v10_; - v11_: int = add v10_ v5_; +.b0_: + c1_: int = const 1; + c2_: int = const 4; + c3_: int = const 3; + c4_: int = const 2; + v5_: int = id c1_; + v6_: int = id c2_; + v7_: int = id c3_; + v8_: int = id c4_; +.b9_: + c10_: int = const 1; + print c10_; + v11_: int = add c10_ v5_; v12_: bool = lt v11_ v6_; v13_: bool = not v12_; v5_: int = id v11_; v6_: int = id v6_; v7_: int = id v7_; v8_: int = id v8_; - br v13_ .v9_ .v14_; -.v14_: + br v13_ .b9_ .b14_; +.b14_: print v5_; } diff --git a/tests/snapshots/files__loop_if-optimize.snap b/tests/snapshots/files__loop_if-optimize.snap index 49d6c7952..bbf8b9417 100644 --- a/tests/snapshots/files__loop_if-optimize.snap +++ b/tests/snapshots/files__loop_if-optimize.snap @@ -3,39 +3,39 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - v2_: int = id v1_; - v3_: int = id v1_; -.v4_: +.b0_: + c1_: int = const 0; + v2_: int = id c1_; + v3_: int = id c1_; +.b4_: v5_: bool = eq v2_ v3_; v6_: int = id v2_; v7_: bool = id v5_; v8_: int = id v3_; - br v5_ .v9_ .v10_; -.v10_: - v11_: int = const 1; - v12_: int = add v11_ v2_; - v13_: int = add v11_ v3_; + br v5_ .b9_ .b10_; +.b10_: + c11_: int = const 1; + v12_: int = add c11_ v2_; + v13_: int = add c11_ v3_; v6_: int = id v12_; v7_: bool = id v5_; v8_: int = id v13_; -.v9_: - v14_: bool = const true; +.b9_: + c14_: bool = const true; v15_: int = id v6_; - v16_: bool = id v14_; + v16_: bool = id c14_; v17_: int = id v8_; - br v5_ .v18_ .v19_; -.v18_: - v20_: bool = const false; + br v5_ .b18_ .b19_; +.b18_: + c20_: bool = const false; v15_: int = id v6_; - v16_: bool = id v20_; + v16_: bool = id c20_; v17_: int = id v8_; -.v19_: +.b19_: v21_: bool = not v5_; v2_: int = id v6_; v3_: int = id v8_; - br v21_ .v4_ .v22_; -.v22_: + br v21_ .b4_ .b22_; +.b22_: print v2_; } diff --git a/tests/snapshots/files__loop_pass_through-optimize.snap b/tests/snapshots/files__loop_pass_through-optimize.snap index 8df973601..efd0a0164 100644 --- a/tests/snapshots/files__loop_pass_through-optimize.snap +++ b/tests/snapshots/files__loop_pass_through-optimize.snap @@ -3,18 +3,18 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 1; - v3_: int = id v2_; +.b1_: + c2_: int = const 1; + v3_: int = id c2_; v4_: int = id v0; -.v5_: +.b5_: v6_: int = add v3_ v3_; - v7_: int = const 10; - v8_: bool = lt v3_ v7_; + c7_: int = const 10; + v8_: bool = lt v3_ c7_; v3_: int = id v6_; v4_: int = id v4_; - br v8_ .v5_ .v9_; -.v9_: + br v8_ .b5_ .b9_; +.b9_: v10_: int = add v0 v3_; print v10_; } diff --git a/tests/snapshots/files__loop_with_mul_by_inv-optimize.snap b/tests/snapshots/files__loop_with_mul_by_inv-optimize.snap index 21dfa2fe9..cf4d4300c 100644 --- a/tests/snapshots/files__loop_with_mul_by_inv-optimize.snap +++ b/tests/snapshots/files__loop_with_mul_by_inv-optimize.snap @@ -3,18 +3,18 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: int = const 5; - v4_: int = id v2_; - v5_: int = id v2_; - v6_: int = id v3_; +.b1_: + c2_: int = const 0; + c3_: int = const 5; + v4_: int = id c2_; + v5_: int = id c2_; + v6_: int = id c3_; v7_: int = id v0; - v8_: int = id v2_; -.v9_: + v8_: int = id c2_; +.b9_: v10_: int = add v4_ v8_; - v11_: int = const 1; - v12_: int = add v11_ v5_; + c11_: int = const 1; + v12_: int = add c11_ v5_; v13_: int = add v6_ v8_; v14_: bool = lt v5_ v7_; v4_: int = id v10_; @@ -22,7 +22,7 @@ expression: visualization.result v6_: int = id v6_; v7_: int = id v7_; v8_: int = id v13_; - br v14_ .v9_ .v15_; -.v15_: + br v14_ .b9_ .b15_; +.b15_: print v4_; } diff --git a/tests/snapshots/files__mem_loop_store_forwarding-optimize.snap b/tests/snapshots/files__mem_loop_store_forwarding-optimize.snap index 4424ca2b5..3607aca2b 100644 --- a/tests/snapshots/files__mem_loop_store_forwarding-optimize.snap +++ b/tests/snapshots/files__mem_loop_store_forwarding-optimize.snap @@ -3,29 +3,29 @@ source: tests/files.rs expression: visualization.result --- @main(v0: bool) { -.v1_: - v2_: int = const 3; - v3_: ptr = alloc v2_; - v4_: int = const 1; - v5_: ptr = ptradd v3_ v4_; - v6_: int = const 2; - v7_: ptr = ptradd v3_ v6_; +.b1_: + c2_: int = const 3; + v3_: ptr = alloc c2_; + c4_: int = const 1; + v5_: ptr = ptradd v3_ c4_; + c6_: int = const 2; + v7_: ptr = ptradd v3_ c6_; v8_: ptr = id v5_; v9_: ptr = id v3_; v10_: ptr = id v7_; v11_: bool = id v0; -.v12_: +.b12_: v8_: ptr = id v9_; v9_: ptr = id v8_; v10_: ptr = id v10_; v11_: bool = id v11_; - br v11_ .v12_ .v13_; -.v13_: - v14_: int = const 10; - v15_: int = const 20; - store v9_ v14_; - store v10_ v15_; + br v11_ .b12_ .b13_; +.b13_: + c14_: int = const 10; + c15_: int = const 20; + store v9_ c14_; + store v10_ c15_; v16_: int = load v9_; - print v14_; + print c14_; free v8_; } diff --git a/tests/snapshots/files__mem_simple_redundant_load-optimize.snap b/tests/snapshots/files__mem_simple_redundant_load-optimize.snap index 07f982a9f..bef49176a 100644 --- a/tests/snapshots/files__mem_simple_redundant_load-optimize.snap +++ b/tests/snapshots/files__mem_simple_redundant_load-optimize.snap @@ -3,24 +3,24 @@ source: tests/files.rs expression: visualization.result --- @main(v0: bool) { -.v1_: - v2_: int = const 1; - v3_: ptr = alloc v2_; - br v0 .v4_ .v5_; -.v4_: - v6_: int = const 2; - store v3_ v6_; +.b1_: + c2_: int = const 1; + v3_: ptr = alloc c2_; + br v0 .b4_ .b5_; +.b4_: + c6_: int = const 2; + store v3_ c6_; v7_: ptr = id v3_; v8_: int = load v3_; v9_: int = load v3_; print v8_; free v3_; ret; -.v5_: - v10_: int = const 3; - store v3_ v10_; +.b5_: + c10_: int = const 3; + store v3_ c10_; v7_: ptr = id v3_; -.v11_: +.b11_: v8_: int = load v3_; v9_: int = load v3_; print v8_; diff --git a/tests/snapshots/files__mem_simple_store_forwarding-optimize.snap b/tests/snapshots/files__mem_simple_store_forwarding-optimize.snap index 6ed994670..56e06754f 100644 --- a/tests/snapshots/files__mem_simple_store_forwarding-optimize.snap +++ b/tests/snapshots/files__mem_simple_store_forwarding-optimize.snap @@ -3,16 +3,16 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 2; - v2_: ptr = alloc v1_; - v3_: int = const 10; - v4_: int = const 1; - v5_: ptr = ptradd v2_ v4_; - v6_: int = const 20; - store v2_ v3_; - store v5_ v6_; +.b0_: + c1_: int = const 2; + v2_: ptr = alloc c1_; + c3_: int = const 10; + c4_: int = const 1; + v5_: ptr = ptradd v2_ c4_; + c6_: int = const 20; + store v2_ c3_; + store v5_ c6_; v7_: int = load v2_; - print v3_; + print c3_; free v2_; } diff --git a/tests/snapshots/files__nested_call-optimize.snap b/tests/snapshots/files__nested_call-optimize.snap index d777b1e3b..f45a1c0f5 100644 --- a/tests/snapshots/files__nested_call-optimize.snap +++ b/tests/snapshots/files__nested_call-optimize.snap @@ -3,22 +3,22 @@ source: tests/files.rs expression: visualization.result --- @inc(v0: int): int { -.v1_: - v2_: int = const 1; - v3_: int = add v0 v2_; - v4_: int = const 2; - v5_: int = mul v3_ v4_; +.b1_: + c2_: int = const 1; + v3_: int = add c2_ v0; + c4_: int = const 2; + v5_: int = mul c4_ v3_; ret v5_; } @double(v0: int): int { -.v1_: - v2_: int = const 2; - v3_: int = mul v0 v2_; +.b1_: + c2_: int = const 2; + v3_: int = mul c2_ v0; ret v3_; } @main { -.v0_: - v1_: int = const 2; - print v1_; - print v1_; +.b0_: + c1_: int = const 2; + print c1_; + print c1_; } diff --git a/tests/snapshots/files__peel_twice-optimize.snap b/tests/snapshots/files__peel_twice-optimize.snap index f2691ba96..bf02b33e4 100644 --- a/tests/snapshots/files__peel_twice-optimize.snap +++ b/tests/snapshots/files__peel_twice-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 2; - print v1_; +.b0_: + c1_: int = const 2; + print c1_; } diff --git a/tests/snapshots/files__peel_twice_precalc_pred-optimize.snap b/tests/snapshots/files__peel_twice_precalc_pred-optimize.snap index f2691ba96..bf02b33e4 100644 --- a/tests/snapshots/files__peel_twice_precalc_pred-optimize.snap +++ b/tests/snapshots/files__peel_twice_precalc_pred-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 2; - print v1_; +.b0_: + c1_: int = const 2; + print c1_; } diff --git a/tests/snapshots/files__range_check-optimize.snap b/tests/snapshots/files__range_check-optimize.snap index 59f868ab0..cfecc22af 100644 --- a/tests/snapshots/files__range_check-optimize.snap +++ b/tests/snapshots/files__range_check-optimize.snap @@ -3,34 +3,34 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - v2_: int = id v1_; -.v3_: - v4_: int = const 6; - v5_: bool = lt v2_ v4_; - v6_: int = const 5; - v7_: bool = lt v2_ v6_; - br v7_ .v8_ .v9_; -.v8_: - v10_: int = const 1; - print v10_; +.b0_: + c1_: int = const 0; + v2_: int = id c1_; +.b3_: + c4_: int = const 6; + v5_: bool = lt v2_ c4_; + c6_: int = const 5; + v7_: bool = lt v2_ c6_; + br v7_ .b8_ .b9_; +.b8_: + c10_: int = const 1; + print c10_; v11_: int = id v2_; -.v12_: - v13_: int = const 1; - v14_: int = add v13_ v2_; +.b12_: + c13_: int = const 1; + v14_: int = add c13_ v2_; v15_: int = id v14_; - br v5_ .v16_ .v17_; -.v16_: + br v5_ .b16_ .b17_; +.b16_: v15_: int = id v14_; -.v17_: +.b17_: v2_: int = id v15_; - br v5_ .v3_ .v18_; -.v9_: - v19_: int = const 2; - print v19_; + br v5_ .b3_ .b18_; +.b9_: + c19_: int = const 2; + print c19_; v11_: int = id v2_; - jmp .v12_; -.v18_: + jmp .b12_; +.b18_: print v2_; } diff --git a/tests/snapshots/files__range_splitting-optimize.snap b/tests/snapshots/files__range_splitting-optimize.snap index 1e64a449e..156f153b9 100644 --- a/tests/snapshots/files__range_splitting-optimize.snap +++ b/tests/snapshots/files__range_splitting-optimize.snap @@ -3,33 +3,33 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - v2_: int = id v1_; -.v3_: - v4_: int = const 1; - v5_: int = add v2_ v4_; - v6_: int = const 5; - v7_: bool = lt v5_ v6_; - v8_: bool = lt v2_ v6_; - br v8_ .v9_ .v10_; -.v9_: - v11_: int = const 1; - print v11_; +.b0_: + c1_: int = const 0; + v2_: int = id c1_; +.b3_: + c4_: int = const 1; + v5_: int = add c4_ v2_; + c6_: int = const 5; + v7_: bool = lt v5_ c6_; + v8_: bool = lt v2_ c6_; + br v8_ .b9_ .b10_; +.b9_: + c11_: int = const 1; + print c11_; v12_: int = id v2_; -.v13_: +.b13_: v14_: int = id v5_; - br v7_ .v15_ .v16_; -.v15_: + br v7_ .b15_ .b16_; +.b15_: v14_: int = id v5_; -.v16_: +.b16_: v2_: int = id v14_; - br v7_ .v3_ .v17_; -.v10_: - v18_: int = const 2; - print v18_; + br v7_ .b3_ .b17_; +.b10_: + c18_: int = const 2; + print c18_; v12_: int = id v2_; - jmp .v13_; -.v17_: + jmp .b13_; +.b17_: print v2_; } diff --git a/tests/snapshots/files__reassoc-optimize.snap b/tests/snapshots/files__reassoc-optimize.snap index e0ef8fc33..505472839 100644 --- a/tests/snapshots/files__reassoc-optimize.snap +++ b/tests/snapshots/files__reassoc-optimize.snap @@ -3,13 +3,13 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int, v1: int) { -.v2_: - v3_: int = const 1; - v4_: int = const 4; - v5_: int = add v1 v4_; - v6_: int = const 3; - v7_: int = add v0 v6_; +.b2_: + c3_: int = const 1; + c4_: int = const 4; + v5_: int = add c4_ v1; + c6_: int = const 3; + v7_: int = add c6_ v0; v8_: int = add v5_ v7_; - v9_: int = add v3_ v8_; + v9_: int = add c3_ v8_; print v9_; } diff --git a/tests/snapshots/files__recurse_once-optimize.snap b/tests/snapshots/files__recurse_once-optimize.snap index 5f46c84d7..095b6cb89 100644 --- a/tests/snapshots/files__recurse_once-optimize.snap +++ b/tests/snapshots/files__recurse_once-optimize.snap @@ -3,39 +3,39 @@ source: tests/files.rs expression: visualization.result --- @to_zero(v0: int): int { -.v1_: - v2_: int = const 0; - v3_: bool = lt v2_ v0; +.b1_: + c2_: int = const 0; + v3_: bool = lt c2_ v0; v4_: int = id v0; - br v3_ .v5_ .v6_; -.v5_: - v7_: int = const 0; - v8_: int = const 1; - v9_: int = sub v0 v8_; - v10_: bool = lt v7_ v9_; + br v3_ .b5_ .b6_; +.b5_: + c7_: int = const 0; + c8_: int = const 1; + v9_: int = sub v0 c8_; + v10_: bool = lt c7_ v9_; v11_: int = id v9_; - br v10_ .v12_ .v13_; -.v12_: - v14_: int = const 0; - v15_: int = const 1; - v16_: int = sub v9_ v15_; - v17_: bool = lt v14_ v16_; + br v10_ .b12_ .b13_; +.b12_: + c14_: int = const 0; + c15_: int = const 1; + v16_: int = sub v9_ c15_; + v17_: bool = lt c14_ v16_; v18_: int = id v16_; - br v17_ .v19_ .v20_; -.v19_: - v21_: int = const 1; - v22_: int = sub v16_ v21_; + br v17_ .b19_ .b20_; +.b19_: + c21_: int = const 1; + v22_: int = sub v16_ c21_; v23_: int = call @to_zero v22_; v18_: int = id v23_; -.v20_: +.b20_: v11_: int = id v18_; -.v13_: +.b13_: v4_: int = id v11_; -.v6_: +.b6_: ret v4_; } @main { -.v0_: - v1_: int = const 0; - print v1_; +.b0_: + c1_: int = const 0; + print c1_; } diff --git a/tests/snapshots/files__simple-call-optimize.snap b/tests/snapshots/files__simple-call-optimize.snap index a8eb698f7..52bd492cf 100644 --- a/tests/snapshots/files__simple-call-optimize.snap +++ b/tests/snapshots/files__simple-call-optimize.snap @@ -3,13 +3,13 @@ source: tests/files.rs expression: visualization.result --- @inc(v0: int): int { -.v1_: - v2_: int = const 1; - v3_: int = add v0 v2_; +.b1_: + c2_: int = const 1; + v3_: int = add c2_ v0; ret v3_; } @main { -.v0_: - v1_: int = const 1; - print v1_; +.b0_: + c1_: int = const 1; + print c1_; } diff --git a/tests/snapshots/files__simple_branch-optimize.snap b/tests/snapshots/files__simple_branch-optimize.snap index d08d85a7d..f282440eb 100644 --- a/tests/snapshots/files__simple_branch-optimize.snap +++ b/tests/snapshots/files__simple_branch-optimize.snap @@ -3,15 +3,15 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: bool = lt v0 v2_; - v4_: int = const 0; - v5_: int = id v4_; - br v3_ .v6_ .v7_; -.v6_: - v8_: int = const 1; - v5_: int = id v8_; -.v7_: +.b1_: + c2_: int = const 0; + v3_: bool = lt v0 c2_; + c4_: int = const 0; + v5_: int = id c4_; + br v3_ .b6_ .b7_; +.b6_: + c8_: int = const 1; + v5_: int = id c8_; +.b7_: print v5_; } diff --git a/tests/snapshots/files__simple_call-optimize.snap b/tests/snapshots/files__simple_call-optimize.snap index 0da2d197d..f390f720b 100644 --- a/tests/snapshots/files__simple_call-optimize.snap +++ b/tests/snapshots/files__simple_call-optimize.snap @@ -3,13 +3,13 @@ source: tests/files.rs expression: visualization.result --- @inc(v0: int) { -.v1_: - v2_: int = const 1; - v3_: int = add v0 v2_; +.b1_: + c2_: int = const 1; + v3_: int = add c2_ v0; print v3_; } @main { -.v0_: - v1_: int = const 1; - print v1_; +.b0_: + c1_: int = const 1; + print c1_; } diff --git a/tests/snapshots/files__simple_loop-optimize.snap b/tests/snapshots/files__simple_loop-optimize.snap index 08f616927..97630776e 100644 --- a/tests/snapshots/files__simple_loop-optimize.snap +++ b/tests/snapshots/files__simple_loop-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - print v1_; +.b0_: + c1_: int = const 0; + print c1_; } diff --git a/tests/snapshots/files__simple_loop_swap-optimize.snap b/tests/snapshots/files__simple_loop_swap-optimize.snap index 6ed994670..56e06754f 100644 --- a/tests/snapshots/files__simple_loop_swap-optimize.snap +++ b/tests/snapshots/files__simple_loop_swap-optimize.snap @@ -3,16 +3,16 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 2; - v2_: ptr = alloc v1_; - v3_: int = const 10; - v4_: int = const 1; - v5_: ptr = ptradd v2_ v4_; - v6_: int = const 20; - store v2_ v3_; - store v5_ v6_; +.b0_: + c1_: int = const 2; + v2_: ptr = alloc c1_; + c3_: int = const 10; + c4_: int = const 1; + v5_: ptr = ptradd v2_ c4_; + c6_: int = const 20; + store v2_ c3_; + store v5_ c6_; v7_: int = load v2_; - print v3_; + print c3_; free v2_; } diff --git a/tests/snapshots/files__simple_recursive-optimize.snap b/tests/snapshots/files__simple_recursive-optimize.snap index cc846abe5..7a0b2aba6 100644 --- a/tests/snapshots/files__simple_recursive-optimize.snap +++ b/tests/snapshots/files__simple_recursive-optimize.snap @@ -3,46 +3,46 @@ source: tests/files.rs expression: visualization.result --- @inc(v0: int): int { -.v1_: - v2_: int = const 2; - v3_: bool = lt v0 v2_; +.b1_: + c2_: int = const 2; + v3_: bool = lt v0 c2_; v4_: int = id v0; - br v3_ .v5_ .v6_; -.v5_: - v7_: int = const 1; - v8_: int = add v0 v7_; - v9_: int = const 2; - v10_: bool = lt v8_ v9_; + br v3_ .b5_ .b6_; +.b5_: + c7_: int = const 1; + v8_: int = add c7_ v0; + c9_: int = const 2; + v10_: bool = lt v8_ c9_; print v8_; v11_: int = id v8_; - br v10_ .v12_ .v13_; -.v12_: - v14_: int = const 1; - v15_: int = add v14_ v8_; - v16_: int = const 2; - v17_: bool = lt v15_ v16_; + br v10_ .b12_ .b13_; +.b12_: + c14_: int = const 1; + v15_: int = add c14_ v8_; + c16_: int = const 2; + v17_: bool = lt v15_ c16_; print v15_; v18_: int = id v15_; - br v17_ .v19_ .v20_; -.v19_: - v21_: int = const 1; - v22_: int = add v15_ v21_; + br v17_ .b19_ .b20_; +.b19_: + c21_: int = const 1; + v22_: int = add c21_ v15_; print v22_; v23_: int = call @inc v22_; v18_: int = id v23_; -.v20_: +.b20_: v11_: int = id v18_; -.v13_: +.b13_: v4_: int = id v11_; -.v6_: +.b6_: ret v4_; } @main { -.v0_: - v1_: int = const 2; - v2_: int = const 1; - print v2_; - print v1_; - v3_: int = call @inc v1_; +.b0_: + c1_: int = const 2; + c2_: int = const 1; + print c2_; + print c1_; + v3_: int = call @inc c1_; print v3_; } diff --git a/tests/snapshots/files__simplest_loop-optimize.snap b/tests/snapshots/files__simplest_loop-optimize.snap index b1a6cd2c5..a539c7461 100644 --- a/tests/snapshots/files__simplest_loop-optimize.snap +++ b/tests/snapshots/files__simplest_loop-optimize.snap @@ -3,19 +3,19 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - v2_: int = const 5; - v3_: int = const 1; - v4_: int = id v1_; - v5_: int = id v2_; - v6_: int = id v3_; -.v7_: +.b0_: + c1_: int = const 0; + c2_: int = const 5; + c3_: int = const 1; + v4_: int = id c1_; + v5_: int = id c2_; + v6_: int = id c3_; +.b7_: v8_: int = add v4_ v6_; v9_: bool = lt v8_ v5_; v4_: int = id v8_; v5_: int = id v5_; v6_: int = id v6_; - br v9_ .v7_ .v10_; -.v10_: + br v9_ .b7_ .b10_; +.b10_: } diff --git a/tests/snapshots/files__small-collatz-optimize.snap b/tests/snapshots/files__small-collatz-optimize.snap index 53118761e..eafb1f0c9 100644 --- a/tests/snapshots/files__small-collatz-optimize.snap +++ b/tests/snapshots/files__small-collatz-optimize.snap @@ -3,55 +3,55 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: int = const 2; - v4_: int = const 1; - v5_: int = const 3; - v6_: int = id v2_; +.b1_: + c2_: int = const 0; + c3_: int = const 2; + c4_: int = const 1; + c5_: int = const 3; + v6_: int = id c2_; v7_: int = id v0; - v8_: int = id v3_; - v9_: int = id v4_; - v10_: int = id v5_; - v11_: int = id v2_; -.v12_: + v8_: int = id c3_; + v9_: int = id c4_; + v10_: int = id c5_; + v11_: int = id c2_; +.b12_: v13_: bool = eq v7_ v9_; - v14_: bool = const false; + c14_: bool = const false; v15_: int = id v6_; - v16_: bool = id v14_; + v16_: bool = id c14_; v17_: int = id v9_; v18_: int = id v8_; v19_: int = id v9_; v20_: int = id v10_; v21_: int = id v11_; - br v13_ .v22_ .v23_; -.v23_: + br v13_ .b22_ .b23_; +.b23_: v24_: int = div v7_ v8_; v25_: int = mul v24_ v8_; v26_: int = sub v7_ v25_; v27_: bool = eq v11_ v26_; v28_: int = add v6_ v9_; - br v27_ .v29_ .v30_; -.v29_: - v31_: bool = const true; + br v27_ .b29_ .b30_; +.b29_: + c31_: bool = const true; v32_: int = div v7_ v8_; v33_: int = id v28_; - v34_: bool = id v31_; + v34_: bool = id c31_; v35_: int = id v32_; v36_: int = id v8_; v37_: int = id v9_; v38_: int = id v10_; v39_: int = id v11_; -.v40_: - v41_: bool = const true; +.b40_: + c41_: bool = const true; v15_: int = id v28_; - v16_: bool = id v41_; + v16_: bool = id c41_; v17_: int = id v35_; v18_: int = id v8_; v19_: int = id v9_; v20_: int = id v10_; v21_: int = id v11_; -.v22_: +.b22_: v42_: bool = not v13_; v6_: int = id v15_; v7_: int = id v17_; @@ -59,19 +59,19 @@ expression: visualization.result v9_: int = id v9_; v10_: int = id v10_; v11_: int = id v11_; - br v42_ .v12_ .v43_; -.v30_: - v44_: bool = const true; + br v42_ .b12_ .b43_; +.b30_: + c44_: bool = const true; v45_: int = mul v10_ v7_; v46_: int = add v45_ v9_; v33_: int = id v28_; - v34_: bool = id v44_; + v34_: bool = id c44_; v35_: int = id v46_; v36_: int = id v8_; v37_: int = id v9_; v38_: int = id v10_; v39_: int = id v11_; - jmp .v40_; -.v43_: + jmp .b40_; +.b43_: print v6_; } diff --git a/tests/snapshots/files__small-fib-optimize.snap b/tests/snapshots/files__small-fib-optimize.snap index b350d3e56..6899c481e 100644 --- a/tests/snapshots/files__small-fib-optimize.snap +++ b/tests/snapshots/files__small-fib-optimize.snap @@ -3,39 +3,39 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 0; - v3_: bool = eq v0 v2_; - v4_: int = const 1; - print v4_; - br v3_ .v5_ .v6_; -.v6_: - print v4_; - v7_: int = id v4_; - v8_: int = id v4_; - v9_: int = id v4_; +.b1_: + c2_: int = const 0; + v3_: bool = eq c2_ v0; + c4_: int = const 1; + print c4_; + br v3_ .b5_ .b6_; +.b6_: + print c4_; + v7_: int = id c4_; + v8_: int = id c4_; + v9_: int = id c4_; v10_: int = id v0; -.v11_: +.b11_: v12_: bool = lt v7_ v10_; v13_: int = id v7_; v14_: int = id v8_; v15_: int = id v9_; v16_: int = id v10_; - br v12_ .v17_ .v18_; -.v17_: + br v12_ .b17_ .b18_; +.b17_: v19_: int = add v8_ v9_; print v19_; - v20_: int = const 1; - v21_: int = add v20_ v7_; + c20_: int = const 1; + v21_: int = add c20_ v7_; v13_: int = id v21_; v14_: int = id v19_; v15_: int = id v8_; v16_: int = id v10_; -.v18_: +.b18_: v7_: int = id v13_; v8_: int = id v14_; v9_: int = id v15_; v10_: int = id v16_; - br v12_ .v11_ .v5_; -.v5_: + br v12_ .b11_ .b5_; +.b5_: } diff --git a/tests/snapshots/files__sqrt-optimize.snap b/tests/snapshots/files__sqrt-optimize.snap index ad9335e24..e43913c9a 100644 --- a/tests/snapshots/files__sqrt-optimize.snap +++ b/tests/snapshots/files__sqrt-optimize.snap @@ -3,35 +3,35 @@ source: tests/files.rs expression: visualization.result --- @main(v0: float) { -.v1_: - v2_: float = const 0; - v3_: bool = feq v0 v2_; - br v3_ .v4_ .v5_; -.v4_: - print v2_; +.b1_: + c2_: float = const 0; + v3_: bool = feq v0 c2_; + br v3_ .b4_ .b5_; +.b4_: + print c2_; ret; -.v5_: +.b5_: v6_: bool = feq v0 v0; - v7_: bool = const true; - v8_: float = id v2_; - v9_: bool = id v7_; - br v6_ .v10_ .v11_; -.v10_: - v12_: bool = flt v0 v2_; - v13_: float = id v2_; - br v12_ .v14_ .v15_; -.v15_: - v16_: float = const 1; - v17_: float = const 1.0000000001; - v18_: float = const 0.9999999999; - v19_: float = const 2; - v20_: float = id v2_; - v21_: float = id v16_; - v22_: float = id v17_; - v23_: float = id v18_; - v24_: float = id v19_; + c7_: bool = const true; + v8_: float = id c2_; + v9_: bool = id c7_; + br v6_ .b10_ .b11_; +.b10_: + v12_: bool = flt v0 c2_; + v13_: float = id c2_; + br v12_ .b14_ .b15_; +.b15_: + c16_: float = const 1; + c17_: float = const 1.0000000001; + c18_: float = const 0.9999999999; + c19_: float = const 2; + v20_: float = id c2_; + v21_: float = id c16_; + v22_: float = id c17_; + v23_: float = id c18_; + v24_: float = id c19_; v25_: float = id v0; -.v26_: +.b26_: v27_: float = fdiv v25_ v21_; v28_: float = fadd v21_ v27_; v29_: float = fdiv v28_ v24_; @@ -39,25 +39,25 @@ expression: visualization.result v31_: bool = fle v30_ v22_; v32_: bool = fge v30_ v23_; v33_: bool = and v31_ v32_; - v34_: bool = const true; + c34_: bool = const true; v35_: float = id v20_; v36_: float = id v29_; - v37_: bool = id v34_; + v37_: bool = id c34_; v38_: float = id v22_; v39_: float = id v23_; v40_: float = id v24_; v41_: float = id v25_; - br v33_ .v42_ .v43_; -.v42_: - v44_: bool = const false; + br v33_ .b42_ .b43_; +.b42_: + c44_: bool = const false; v35_: float = id v20_; v36_: float = id v29_; - v37_: bool = id v44_; + v37_: bool = id c44_; v38_: float = id v22_; v39_: float = id v23_; v40_: float = id v24_; v41_: float = id v25_; -.v43_: +.b43_: v45_: bool = not v33_; v20_: float = id v20_; v21_: float = id v29_; @@ -65,18 +65,18 @@ expression: visualization.result v23_: float = id v23_; v24_: float = id v24_; v25_: float = id v25_; - br v45_ .v26_ .v46_; -.v46_: + br v45_ .b26_ .b46_; +.b46_: print v21_; v13_: float = id v20_; -.v14_: +.b14_: v8_: float = id v13_; v9_: bool = id v12_; -.v11_: - br v9_ .v47_ .v48_; -.v47_: +.b11_: + br v9_ .b47_ .b48_; +.b47_: v49_: float = fdiv v8_ v8_; print v49_; -.v48_: -.v50_: +.b48_: +.b50_: } diff --git a/tests/snapshots/files__strong_loop-optimize.snap b/tests/snapshots/files__strong_loop-optimize.snap index afe95a437..f51f71ccf 100644 --- a/tests/snapshots/files__strong_loop-optimize.snap +++ b/tests/snapshots/files__strong_loop-optimize.snap @@ -3,31 +3,31 @@ source: tests/files.rs expression: visualization.result --- @main(v0: int) { -.v1_: - v2_: int = const 3; - v3_: int = add v0 v2_; - v4_: int = const 0; - v5_: int = const 21; - v6_: int = id v2_; +.b1_: + c2_: int = const 3; + v3_: int = add c2_ v0; + c4_: int = const 0; + c5_: int = const 21; + v6_: int = id c2_; v7_: int = id v3_; - v8_: int = id v4_; + v8_: int = id c4_; v9_: int = id v0; - v10_: int = id v5_; -.v11_: + v10_: int = id c5_; +.b11_: print v10_; - v12_: int = const 1; - v13_: int = add v12_ v6_; + c12_: int = const 1; + v13_: int = add c12_ v6_; v14_: int = add v10_ v8_; - v15_: int = const 7; - v16_: int = add v10_ v15_; + c15_: int = const 7; + v16_: int = add c15_ v10_; v17_: bool = lt v6_ v9_; v6_: int = id v13_; v7_: int = id v7_; v8_: int = id v14_; v9_: int = id v9_; v10_: int = id v16_; - br v17_ .v11_ .v18_; -.v18_: + br v17_ .b11_ .b18_; +.b18_: print v8_; print v3_; print v6_; diff --git a/tests/snapshots/files__two_fns-optimize.snap b/tests/snapshots/files__two_fns-optimize.snap index d2d20fb74..32fee4b71 100644 --- a/tests/snapshots/files__two_fns-optimize.snap +++ b/tests/snapshots/files__two_fns-optimize.snap @@ -3,12 +3,12 @@ source: tests/files.rs expression: visualization.result --- @sub: int { -.v0_: - v1_: int = const -1; - ret v1_; +.b0_: + c1_: int = const -1; + ret c1_; } @main { -.v0_: - v1_: int = const 3; - print v1_; +.b0_: + c1_: int = const 3; + print c1_; } diff --git a/tests/snapshots/files__unroll_and_constant_fold-optimize.snap b/tests/snapshots/files__unroll_and_constant_fold-optimize.snap index 8449ee79a..0020317f3 100644 --- a/tests/snapshots/files__unroll_and_constant_fold-optimize.snap +++ b/tests/snapshots/files__unroll_and_constant_fold-optimize.snap @@ -3,7 +3,7 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 1; - print v1_; +.b0_: + c1_: int = const 1; + print c1_; } diff --git a/tests/snapshots/files__unroll_multiple_4-optimize.snap b/tests/snapshots/files__unroll_multiple_4-optimize.snap index e338c81fa..aca316d41 100644 --- a/tests/snapshots/files__unroll_multiple_4-optimize.snap +++ b/tests/snapshots/files__unroll_multiple_4-optimize.snap @@ -3,14 +3,14 @@ source: tests/files.rs expression: visualization.result --- @main { -.v0_: - v1_: int = const 0; - v2_: int = const 16; - v3_: int = const 1; - v4_: int = id v1_; - v5_: int = id v2_; - v6_: int = id v3_; -.v7_: +.b0_: + c1_: int = const 0; + c2_: int = const 16; + c3_: int = const 1; + v4_: int = id c1_; + v5_: int = id c2_; + v6_: int = id c3_; +.b7_: v8_: int = add v4_ v6_; v9_: int = add v6_ v8_; v10_: int = add v6_ v9_; @@ -19,7 +19,7 @@ expression: visualization.result v4_: int = id v11_; v5_: int = id v5_; v6_: int = id v6_; - br v12_ .v7_ .v13_; -.v13_: + br v12_ .b7_ .b13_; +.b13_: print v4_; }