From 58d823e3bf2dffb15648f594c4c66496c64692ee Mon Sep 17 00:00:00 2001 From: oflatt Date: Wed, 30 Oct 2024 14:50:50 -0700 Subject: [PATCH] snapshots --- ...state_mem_to_cfg_more_blocks_snapshot.snap | 2 - ...es__block-diamond-optimize-sequential.snap | 3 - .../files__block-diamond-optimize.snap | 3 - ...ch_duplicate_work-optimize-sequential.snap | 2 - ...files__branch_duplicate_work-optimize.snap | 2 - .../files__diamond-optimize-sequential.snap | 1 - tests/snapshots/files__diamond-optimize.snap | 1 - ...es__fib_recursive-optimize-sequential.snap | 774 ++++++++---------- .../files__fib_recursive-optimize.snap | 774 ++++++++---------- ...mma_condition_and-optimize-sequential.snap | 9 +- .../files__gamma_condition_and-optimize.snap | 9 +- ...es__gamma_pull_in-optimize-sequential.snap | 3 - .../files__gamma_pull_in-optimize.snap | 3 - ...les__if_dead_code-optimize-sequential.snap | 3 - .../files__if_dead_code-optimize.snap | 3 - ..._dead_code_nested-optimize-sequential.snap | 88 +- .../files__if_dead_code_nested-optimize.snap | 88 +- ...es__impossible_if-optimize-sequential.snap | 2 - .../files__impossible_if-optimize.snap | 2 - .../files__max-optimize-sequential.snap | 2 - ...le_redundant_load-optimize-sequential.snap | 5 - ...s__mem_simple_redundant_load-optimize.snap | 5 - .../files__min-optimize-sequential.snap | 2 - ...les__recurse_once-optimize-sequential.snap | 11 +- .../files__recurse_once-optimize.snap | 11 +- ...es__simple_branch-optimize-sequential.snap | 2 - .../files__simple_branch-optimize.snap | 2 - ..._simple_recursive-optimize-sequential.snap | 11 +- .../files__simple_recursive-optimize.snap | 11 +- .../files__small-fib-optimize-sequential.snap | 1 - .../snapshots/files__small-fib-optimize.snap | 1 - ...files__sqrt_small-optimize-sequential.snap | 18 +- .../snapshots/files__sqrt_small-optimize.snap | 18 +- 33 files changed, 784 insertions(+), 1088 deletions(-) diff --git a/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_state_mem_to_cfg_more_blocks_snapshot.snap b/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_state_mem_to_cfg_more_blocks_snapshot.snap index f7c550a4..6c8e2b10 100644 --- a/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_state_mem_to_cfg_more_blocks_snapshot.snap +++ b/src/rvsdg/snapshots/eggcc__rvsdg__tests__rvsdg_state_mem_to_cfg_more_blocks_snapshot.snap @@ -26,6 +26,4 @@ expression: prog.to_string() print v31; ret; .__42__: - print v31; - ret; } diff --git a/tests/snapshots/files__block-diamond-optimize-sequential.snap b/tests/snapshots/files__block-diamond-optimize-sequential.snap index 3a88679c..18063fe0 100644 --- a/tests/snapshots/files__block-diamond-optimize-sequential.snap +++ b/tests/snapshots/files__block-diamond-optimize-sequential.snap @@ -34,7 +34,4 @@ expression: visualization.result print v15_; ret; .b16_: - v15_: int = add c2_ v13_; - print v15_; - ret; } diff --git a/tests/snapshots/files__block-diamond-optimize.snap b/tests/snapshots/files__block-diamond-optimize.snap index 3a88679c..18063fe0 100644 --- a/tests/snapshots/files__block-diamond-optimize.snap +++ b/tests/snapshots/files__block-diamond-optimize.snap @@ -34,7 +34,4 @@ expression: visualization.result print v15_; ret; .b16_: - v15_: int = add c2_ v13_; - print v15_; - ret; } diff --git a/tests/snapshots/files__branch_duplicate_work-optimize-sequential.snap b/tests/snapshots/files__branch_duplicate_work-optimize-sequential.snap index 81c2c4d9..a30cea73 100644 --- a/tests/snapshots/files__branch_duplicate_work-optimize-sequential.snap +++ b/tests/snapshots/files__branch_duplicate_work-optimize-sequential.snap @@ -20,6 +20,4 @@ expression: visualization.result print v7_; ret; .b8_: - print v7_; - ret; } diff --git a/tests/snapshots/files__branch_duplicate_work-optimize.snap b/tests/snapshots/files__branch_duplicate_work-optimize.snap index 81c2c4d9..a30cea73 100644 --- a/tests/snapshots/files__branch_duplicate_work-optimize.snap +++ b/tests/snapshots/files__branch_duplicate_work-optimize.snap @@ -20,6 +20,4 @@ expression: visualization.result print v7_; ret; .b8_: - print v7_; - ret; } diff --git a/tests/snapshots/files__diamond-optimize-sequential.snap b/tests/snapshots/files__diamond-optimize-sequential.snap index c73f98b6..ba688f8e 100644 --- a/tests/snapshots/files__diamond-optimize-sequential.snap +++ b/tests/snapshots/files__diamond-optimize-sequential.snap @@ -16,5 +16,4 @@ expression: visualization.result print c7_; ret; .b6_: - ret; } diff --git a/tests/snapshots/files__diamond-optimize.snap b/tests/snapshots/files__diamond-optimize.snap index c73f98b6..ba688f8e 100644 --- a/tests/snapshots/files__diamond-optimize.snap +++ b/tests/snapshots/files__diamond-optimize.snap @@ -16,5 +16,4 @@ expression: visualization.result print c7_; ret; .b6_: - ret; } diff --git a/tests/snapshots/files__fib_recursive-optimize-sequential.snap b/tests/snapshots/files__fib_recursive-optimize-sequential.snap index 26b7c4e6..1b84dc9c 100644 --- a/tests/snapshots/files__fib_recursive-optimize-sequential.snap +++ b/tests/snapshots/files__fib_recursive-optimize-sequential.snap @@ -23,395 +23,334 @@ expression: visualization.result v16_: int = id v0; v5_: int = id v16_; ret v5_; -.b17_: - ret v5_; + jmp .b8_; +.b15_: + v17_: bool = eq c2_ v0; + br v17_ .b18_ .b19_; .b18_: + v20_: bool = eq c2_ c2_; + v21_: int = id c2_; + br v20_ .b22_ .b23_; +.b22_: + v24_: int = id c2_; + v13_: int = id v24_; + v16_: int = id v0; + v5_: int = id v16_; ret v5_; jmp .b8_; -.b15_: - v19_: bool = eq c2_ v0; - br v19_ .b20_ .b21_; -.b20_: - v22_: bool = eq c2_ c2_; - v23_: int = id c2_; - br v22_ .b24_ .b25_; -.b24_: - v26_: int = id c2_; - v13_: int = id v26_; +.b23_: + v25_: bool = eq c2_ c2_; + br v25_ .b26_ .b27_; +.b26_: + v28_: int = call @fac c2_; + v29_: int = id c2_; + v21_: int = id v29_; + v24_: int = id c2_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; + jmp .b8_; .b27_: - ret v5_; -.b28_: - ret v5_; - jmp .b17_; -.b25_: - v29_: bool = eq c2_ c2_; - br v29_ .b30_ .b31_; -.b30_: - v32_: int = call @fac c2_; - v33_: int = id c2_; - v23_: int = id v33_; - v26_: int = id c2_; - v13_: int = id v26_; + c30_: int = const -1; + v31_: int = sub c30_ c2_; + v32_: int = call @fac c30_; + v33_: int = call @fac v31_; + v34_: int = add v32_ v33_; + v29_: int = id v34_; + v21_: int = id v29_; + v24_: int = id c2_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; -.b34_: - ret v5_; - jmp .b27_; -.b31_: - c35_: int = const -1; - v36_: int = sub c35_ c2_; - v37_: int = call @fac c35_; - v38_: int = call @fac v36_; - v39_: int = add v37_ v38_; - v33_: int = id v39_; - v23_: int = id v33_; - v26_: int = id c2_; - v13_: int = id v26_; + jmp .b8_; +.b19_: + c35_: int = const -2; + v36_: bool = eq c2_ c35_; + c37_: int = const -1; + v38_: bool = eq c2_ c37_; + v39_: int = id v0; + br v38_ .b40_ .b41_; +.b40_: + v42_: int = id v0; +.b43_: + br v36_ .b44_ .b45_; +.b44_: + v46_: int = add v39_ v42_; + v24_: int = id v46_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; - jmp .b34_; -.b21_: - c40_: int = const -2; - v41_: bool = eq c2_ c40_; - c42_: int = const -1; - v43_: bool = eq c2_ c42_; - v44_: int = id v0; - br v43_ .b45_ .b46_; + jmp .b8_; .b45_: - v47_: int = id v0; + v47_: bool = eq c35_ v0; + br v47_ .b48_ .b49_; .b48_: - br v41_ .b49_ .b50_; -.b49_: - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; + v50_: int = call @fac c2_; + v51_: int = id v0; + v42_: int = id v51_; + v46_: int = add v39_ v42_; + v24_: int = id v46_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; -.b52_: - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; - v16_: int = id v0; - v5_: int = id v16_; - ret v5_; - jmp .b28_; -.b50_: - v53_: bool = eq c40_ v0; - br v53_ .b54_ .b55_; -.b54_: - v56_: int = call @fac c2_; - v57_: int = id v0; - v47_: int = id v57_; - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; + jmp .b8_; +.b49_: + c52_: int = const -4; + c53_: int = const -3; + v54_: int = call @fac c53_; + v55_: int = call @fac c52_; + v56_: int = add v54_ v55_; + v51_: int = id v56_; + v42_: int = id v51_; + v46_: int = add v39_ v42_; + v24_: int = id v46_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; + jmp .b8_; +.b41_: + v57_: bool = eq c37_ v0; + br v57_ .b58_ .b59_; .b58_: - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; - v16_: int = id v0; - v5_: int = id v16_; - ret v5_; - jmp .b52_; -.b55_: - c59_: int = const -4; - c60_: int = const -3; - v61_: int = call @fac c60_; - v62_: int = call @fac c59_; - v63_: int = add v61_ v62_; - v57_: int = id v63_; - v47_: int = id v57_; - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; - v16_: int = id v0; - v5_: int = id v16_; - ret v5_; - jmp .b58_; -.b46_: - v64_: bool = eq c42_ v0; - br v64_ .b65_ .b66_; -.b65_: - v67_: int = call @fac c2_; - v68_: int = id c42_; - v44_: int = id v68_; - v47_: int = id v0; - jmp .b48_; -.b66_: - c69_: int = const -3; - c70_: int = const -2; - v71_: int = call @fac c70_; - v72_: int = call @fac c69_; - v73_: int = add v71_ v72_; - v68_: int = id v73_; - v44_: int = id v68_; - v47_: int = id v0; - jmp .b48_; + v60_: int = call @fac c2_; + v61_: int = id c37_; + v39_: int = id v61_; + v42_: int = id v0; + jmp .b43_; +.b59_: + c62_: int = const -3; + c63_: int = const -2; + v64_: int = call @fac c63_; + v65_: int = call @fac c62_; + v66_: int = add v64_ v65_; + v61_: int = id v66_; + v39_: int = id v61_; + v42_: int = id v0; + jmp .b43_; .b11_: - v74_: int = sub v0 c4_; - v75_: int = sub v74_ c4_; - v76_: bool = eq c2_ v75_; - v77_: bool = eq c2_ v74_; - v78_: int = id c4_; - br v77_ .b79_ .b80_; -.b79_: - v81_: int = id c4_; -.b82_: - br v76_ .b83_ .b84_; -.b83_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + v67_: int = sub v0 c4_; + v68_: int = sub v67_ c4_; + v69_: bool = eq c2_ v68_; + v70_: bool = eq c2_ v67_; + v71_: int = id c4_; + br v70_ .b72_ .b73_; +.b72_: + v74_: int = id c4_; +.b75_: + br v69_ .b76_ .b77_; +.b76_: + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; -.b86_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b77_: + v79_: bool = eq c4_ v68_; + br v79_ .b80_ .b81_; +.b80_: + v82_: bool = eq c2_ c2_; + v83_: int = id c4_; + br v82_ .b84_ .b85_; +.b84_: + v86_: int = id c4_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b18_; -.b84_: - v87_: bool = eq c4_ v75_; + jmp .b8_; +.b85_: + v87_: bool = eq c2_ c4_; br v87_ .b88_ .b89_; .b88_: - v90_: bool = eq c2_ c2_; + v90_: int = call @fac c2_; v91_: int = id c4_; - br v90_ .b92_ .b93_; -.b92_: - v94_: int = id c4_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; -.b95_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + v83_: int = id v91_; + v86_: int = id c4_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; -.b96_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b89_: + c92_: int = const -2; + c93_: int = const -1; + v94_: int = call @fac c93_; + v95_: int = call @fac c92_; + v96_: int = add v94_ v95_; + v91_: int = id v96_; + v83_: int = id v91_; + v86_: int = id c4_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b86_; -.b93_: - v97_: bool = eq c2_ c4_; - br v97_ .b98_ .b99_; -.b98_: - v100_: int = call @fac c2_; + jmp .b8_; +.b81_: + v97_: int = sub v68_ c4_; + v98_: int = sub v97_ c4_; + v99_: bool = eq c2_ v98_; + v100_: bool = eq c2_ v97_; v101_: int = id c4_; - v91_: int = id v101_; - v94_: int = id c4_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; + br v100_ .b102_ .b103_; .b102_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + v104_: int = id c4_; +.b105_: + br v99_ .b106_ .b107_; +.b106_: + v108_: int = add v101_ v104_; + v86_: int = id v108_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b95_; -.b99_: - c103_: int = const -2; - c104_: int = const -1; - v105_: int = call @fac c104_; - v106_: int = call @fac c103_; - v107_: int = add v105_ v106_; - v101_: int = id v107_; - v91_: int = id v101_; - v94_: int = id c4_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b107_: + v109_: bool = eq c4_ v98_; + br v109_ .b110_ .b111_; +.b110_: + v112_: int = call @fac c2_; + v113_: int = id c4_; + v104_: int = id v113_; + v108_: int = add v101_ v104_; + v86_: int = id v108_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b102_; -.b89_: - v108_: int = sub v75_ c4_; - v109_: int = sub v108_ c4_; - v110_: bool = eq c2_ v109_; - v111_: bool = eq c2_ v108_; - v112_: int = id c4_; - br v111_ .b113_ .b114_; -.b113_: - v115_: int = id c4_; -.b116_: - br v110_ .b117_ .b118_; -.b117_: - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b111_: + v114_: int = sub v98_ c4_; + v115_: int = sub v114_ c4_; + v116_: int = call @fac v114_; + v117_: int = call @fac v115_; + v118_: int = add v116_ v117_; + v113_: int = id v118_; + v104_: int = id v113_; + v108_: int = add v101_ v104_; + v86_: int = id v108_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; + jmp .b8_; +.b103_: + v119_: bool = eq c4_ v97_; + br v119_ .b120_ .b121_; .b120_: - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; - jmp .b96_; -.b118_: - v121_: bool = eq c4_ v109_; - br v121_ .b122_ .b123_; -.b122_: - v124_: int = call @fac c2_; - v125_: int = id c4_; - v115_: int = id v125_; - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; -.b126_: - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; - jmp .b120_; -.b123_: - v127_: int = sub v109_ c4_; - v128_: int = sub v127_ c4_; - v129_: int = call @fac v127_; - v130_: int = call @fac v128_; - v131_: int = add v129_ v130_; - v125_: int = id v131_; - v115_: int = id v125_; - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; - jmp .b126_; -.b114_: - v132_: bool = eq c4_ v108_; - br v132_ .b133_ .b134_; -.b133_: - v135_: int = call @fac c2_; - v136_: int = id c4_; - v112_: int = id v136_; - v115_: int = id c4_; - jmp .b116_; + v122_: int = call @fac c2_; + v123_: int = id c4_; + v101_: int = id v123_; + v104_: int = id c4_; + jmp .b105_; +.b121_: + v124_: int = sub v97_ c4_; + v125_: int = sub v124_ c4_; + v126_: int = call @fac v124_; + v127_: int = call @fac v125_; + v128_: int = add v126_ v127_; + v123_: int = id v128_; + v101_: int = id v123_; + v104_: int = id c4_; + jmp .b105_; +.b73_: + v129_: bool = eq c4_ v67_; + br v129_ .b130_ .b131_; +.b130_: + v132_: bool = eq c2_ c2_; + v133_: int = id v67_; + br v132_ .b134_ .b135_; .b134_: - v137_: int = sub v108_ c4_; - v138_: int = sub v137_ c4_; - v139_: int = call @fac v137_; - v140_: int = call @fac v138_; - v141_: int = add v139_ v140_; - v136_: int = id v141_; - v112_: int = id v136_; - v115_: int = id c4_; - jmp .b116_; -.b80_: - v142_: bool = eq c4_ v74_; - br v142_ .b143_ .b144_; -.b143_: - v145_: bool = eq c2_ c2_; - v146_: int = id v74_; - br v145_ .b147_ .b148_; -.b147_: - v149_: int = id v74_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; -.b148_: - v150_: bool = eq c2_ v74_; - br v150_ .b151_ .b152_; -.b151_: - v153_: int = call @fac c2_; - v154_: int = id c2_; - v146_: int = id v154_; - v149_: int = id v74_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; + v136_: int = id v67_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b135_: + v137_: bool = eq c2_ v67_; + br v137_ .b138_ .b139_; +.b138_: + v140_: int = call @fac c2_; + v141_: int = id c2_; + v133_: int = id v141_; + v136_: int = id v67_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b139_: + c142_: int = const -2; + c143_: int = const -1; + v144_: int = call @fac c143_; + v145_: int = call @fac c142_; + v146_: int = add v144_ v145_; + v141_: int = id v146_; + v133_: int = id v141_; + v136_: int = id v67_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b131_: + v147_: int = sub v67_ c4_; + v148_: int = sub v147_ c4_; + v149_: bool = eq c2_ v148_; + v150_: bool = eq c2_ v147_; + v151_: int = id c4_; + br v150_ .b152_ .b153_; .b152_: - c155_: int = const -2; - c156_: int = const -1; - v157_: int = call @fac c156_; - v158_: int = call @fac c155_; - v159_: int = add v157_ v158_; - v154_: int = id v159_; - v146_: int = id v154_; - v149_: int = id v74_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; -.b144_: - v160_: int = sub v74_ c4_; - v161_: int = sub v160_ c4_; - v162_: bool = eq c2_ v161_; - v163_: bool = eq c2_ v160_; - v164_: int = id c4_; - br v163_ .b165_ .b166_; -.b165_: - v167_: int = id c4_; -.b168_: - br v162_ .b169_ .b170_; + v154_: int = id c4_; +.b155_: + br v149_ .b156_ .b157_; +.b157_: + v158_: bool = eq c4_ v148_; + br v158_ .b159_ .b160_; +.b159_: + v161_: int = call @fac c2_; + v162_: int = id c4_; + v154_: int = id v162_; +.b156_: + v163_: int = add v151_ v154_; + v136_: int = id v163_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b160_: + v164_: int = sub v148_ c4_; + v165_: int = sub v164_ c4_; + v166_: int = call @fac v164_; + v167_: int = call @fac v165_; + v168_: int = add v166_ v167_; + v162_: int = id v168_; + v154_: int = id v162_; + jmp .b156_; +.b153_: + v169_: bool = eq c4_ v147_; + br v169_ .b170_ .b171_; .b170_: - v171_: bool = eq c4_ v161_; - br v171_ .b172_ .b173_; -.b172_: - v174_: int = call @fac c2_; - v175_: int = id c4_; - v167_: int = id v175_; -.b169_: - v176_: int = add v164_ v167_; - v149_: int = id v176_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; -.b173_: - v177_: int = sub v161_ c4_; - v178_: int = sub v177_ c4_; - v179_: int = call @fac v177_; - v180_: int = call @fac v178_; - v181_: int = add v179_ v180_; - v175_: int = id v181_; - v167_: int = id v175_; - jmp .b169_; -.b166_: - v182_: bool = eq c4_ v160_; - br v182_ .b183_ .b184_; -.b183_: - v185_: int = call @fac c2_; - v186_: int = id v160_; - v164_: int = id v186_; - v167_: int = id c4_; - jmp .b168_; -.b184_: - v187_: int = sub v160_ c4_; - v188_: int = sub v187_ c4_; - v189_: int = call @fac v187_; - v190_: int = call @fac v188_; - v191_: int = add v189_ v190_; - v186_: int = id v191_; - v164_: int = id v186_; - v167_: int = id c4_; - jmp .b168_; + v172_: int = call @fac c2_; + v173_: int = id v147_; + v151_: int = id v173_; + v154_: int = id c4_; + jmp .b155_; +.b171_: + v174_: int = sub v147_ c4_; + v175_: int = sub v174_ c4_; + v176_: int = call @fac v174_; + v177_: int = call @fac v175_; + v178_: int = add v176_ v177_; + v173_: int = id v178_; + v151_: int = id v173_; + v154_: int = id c4_; + jmp .b155_; .b8_: - ret v5_; } @main { .b0_: @@ -437,115 +376,92 @@ expression: visualization.result v5_: int = id v16_; print v5_; ret; -.b17_: - print v5_; - ret; -.b18_: - print v5_; - ret; jmp .b8_; .b15_: - v19_: bool = eq c1_ c2_; - br v19_ .b20_ .b21_; -.b20_: - v22_: int = call @fac c2_; - v23_: int = id c2_; - v13_: int = id v23_; + v17_: bool = eq c1_ c2_; + br v17_ .b18_ .b19_; +.b18_: + v20_: int = call @fac c2_; + v21_: int = id c2_; + v13_: int = id v21_; v16_: int = id c1_; v5_: int = id v16_; print v5_; ret; -.b24_: - print v5_; - ret; - jmp .b17_; -.b21_: - c25_: int = const -1; - v26_: int = sub c25_ c1_; - v27_: int = call @fac c25_; - v28_: int = call @fac v26_; - v29_: int = add v27_ v28_; - v23_: int = id v29_; - v13_: int = id v23_; + jmp .b8_; +.b19_: + c22_: int = const -1; + v23_: int = sub c22_ c1_; + v24_: int = call @fac c22_; + v25_: int = call @fac v23_; + v26_: int = add v24_ v25_; + v21_: int = id v26_; + v13_: int = id v21_; v16_: int = id c1_; v5_: int = id v16_; print v5_; ret; - jmp .b24_; + jmp .b8_; .b11_: - v30_: bool = eq c2_ c2_; - v31_: bool = eq c2_ c4_; + v27_: bool = eq c2_ c2_; + v28_: bool = eq c2_ c4_; + v29_: int = id c4_; + br v28_ .b30_ .b31_; +.b30_: v32_: int = id c4_; - br v31_ .b33_ .b34_; .b33_: - v35_: int = id c4_; -.b36_: - br v30_ .b37_ .b38_; -.b37_: - v39_: int = add v32_ v35_; - v16_: int = id v39_; - v5_: int = id v16_; - print v5_; - ret; -.b40_: - v39_: int = add v32_ v35_; - v16_: int = id v39_; + br v27_ .b34_ .b35_; +.b34_: + v36_: int = add v29_ v32_; + v16_: int = id v36_; v5_: int = id v16_; print v5_; ret; - jmp .b18_; + jmp .b8_; +.b35_: + v37_: bool = eq c2_ c4_; + br v37_ .b38_ .b39_; .b38_: - v41_: bool = eq c2_ c4_; - br v41_ .b42_ .b43_; -.b42_: - v44_: int = call @fac c2_; - v45_: int = id c4_; - v35_: int = id v45_; - v39_: int = add v32_ v35_; - v16_: int = id v39_; + v40_: int = call @fac c2_; + v41_: int = id c4_; + v32_: int = id v41_; + v36_: int = add v29_ v32_; + v16_: int = id v36_; v5_: int = id v16_; print v5_; ret; -.b46_: - v39_: int = add v32_ v35_; - v16_: int = id v39_; - v5_: int = id v16_; - print v5_; - ret; - jmp .b40_; -.b43_: - c47_: int = const -2; - c48_: int = const -1; - v49_: int = call @fac c48_; - v50_: int = call @fac c47_; - v51_: int = add v49_ v50_; - v45_: int = id v51_; - v35_: int = id v45_; - v39_: int = add v32_ v35_; - v16_: int = id v39_; + jmp .b8_; +.b39_: + c42_: int = const -2; + c43_: int = const -1; + v44_: int = call @fac c43_; + v45_: int = call @fac c42_; + v46_: int = add v44_ v45_; + v41_: int = id v46_; + v32_: int = id v41_; + v36_: int = add v29_ v32_; + v16_: int = id v36_; v5_: int = id v16_; print v5_; ret; - jmp .b46_; -.b34_: - v52_: bool = eq c4_ c4_; - br v52_ .b53_ .b54_; -.b53_: - v55_: int = call @fac c2_; - v56_: int = id c4_; - v32_: int = id v56_; - v35_: int = id c4_; - jmp .b36_; -.b54_: - c57_: int = const -1; - v58_: int = call @fac c2_; - v59_: int = call @fac c57_; - v60_: int = add v58_ v59_; - v56_: int = id v60_; - v32_: int = id v56_; - v35_: int = id c4_; - jmp .b36_; + jmp .b8_; +.b31_: + v47_: bool = eq c4_ c4_; + br v47_ .b48_ .b49_; +.b48_: + v50_: int = call @fac c2_; + v51_: int = id c4_; + v29_: int = id v51_; + v32_: int = id c4_; + jmp .b33_; +.b49_: + c52_: int = const -1; + v53_: int = call @fac c2_; + v54_: int = call @fac c52_; + v55_: int = add v53_ v54_; + v51_: int = id v55_; + v29_: int = id v51_; + v32_: int = id c4_; + jmp .b33_; .b8_: - print v5_; - ret; } diff --git a/tests/snapshots/files__fib_recursive-optimize.snap b/tests/snapshots/files__fib_recursive-optimize.snap index 26b7c4e6..1b84dc9c 100644 --- a/tests/snapshots/files__fib_recursive-optimize.snap +++ b/tests/snapshots/files__fib_recursive-optimize.snap @@ -23,395 +23,334 @@ expression: visualization.result v16_: int = id v0; v5_: int = id v16_; ret v5_; -.b17_: - ret v5_; + jmp .b8_; +.b15_: + v17_: bool = eq c2_ v0; + br v17_ .b18_ .b19_; .b18_: + v20_: bool = eq c2_ c2_; + v21_: int = id c2_; + br v20_ .b22_ .b23_; +.b22_: + v24_: int = id c2_; + v13_: int = id v24_; + v16_: int = id v0; + v5_: int = id v16_; ret v5_; jmp .b8_; -.b15_: - v19_: bool = eq c2_ v0; - br v19_ .b20_ .b21_; -.b20_: - v22_: bool = eq c2_ c2_; - v23_: int = id c2_; - br v22_ .b24_ .b25_; -.b24_: - v26_: int = id c2_; - v13_: int = id v26_; +.b23_: + v25_: bool = eq c2_ c2_; + br v25_ .b26_ .b27_; +.b26_: + v28_: int = call @fac c2_; + v29_: int = id c2_; + v21_: int = id v29_; + v24_: int = id c2_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; + jmp .b8_; .b27_: - ret v5_; -.b28_: - ret v5_; - jmp .b17_; -.b25_: - v29_: bool = eq c2_ c2_; - br v29_ .b30_ .b31_; -.b30_: - v32_: int = call @fac c2_; - v33_: int = id c2_; - v23_: int = id v33_; - v26_: int = id c2_; - v13_: int = id v26_; + c30_: int = const -1; + v31_: int = sub c30_ c2_; + v32_: int = call @fac c30_; + v33_: int = call @fac v31_; + v34_: int = add v32_ v33_; + v29_: int = id v34_; + v21_: int = id v29_; + v24_: int = id c2_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; -.b34_: - ret v5_; - jmp .b27_; -.b31_: - c35_: int = const -1; - v36_: int = sub c35_ c2_; - v37_: int = call @fac c35_; - v38_: int = call @fac v36_; - v39_: int = add v37_ v38_; - v33_: int = id v39_; - v23_: int = id v33_; - v26_: int = id c2_; - v13_: int = id v26_; + jmp .b8_; +.b19_: + c35_: int = const -2; + v36_: bool = eq c2_ c35_; + c37_: int = const -1; + v38_: bool = eq c2_ c37_; + v39_: int = id v0; + br v38_ .b40_ .b41_; +.b40_: + v42_: int = id v0; +.b43_: + br v36_ .b44_ .b45_; +.b44_: + v46_: int = add v39_ v42_; + v24_: int = id v46_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; - jmp .b34_; -.b21_: - c40_: int = const -2; - v41_: bool = eq c2_ c40_; - c42_: int = const -1; - v43_: bool = eq c2_ c42_; - v44_: int = id v0; - br v43_ .b45_ .b46_; + jmp .b8_; .b45_: - v47_: int = id v0; + v47_: bool = eq c35_ v0; + br v47_ .b48_ .b49_; .b48_: - br v41_ .b49_ .b50_; -.b49_: - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; + v50_: int = call @fac c2_; + v51_: int = id v0; + v42_: int = id v51_; + v46_: int = add v39_ v42_; + v24_: int = id v46_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; -.b52_: - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; - v16_: int = id v0; - v5_: int = id v16_; - ret v5_; - jmp .b28_; -.b50_: - v53_: bool = eq c40_ v0; - br v53_ .b54_ .b55_; -.b54_: - v56_: int = call @fac c2_; - v57_: int = id v0; - v47_: int = id v57_; - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; + jmp .b8_; +.b49_: + c52_: int = const -4; + c53_: int = const -3; + v54_: int = call @fac c53_; + v55_: int = call @fac c52_; + v56_: int = add v54_ v55_; + v51_: int = id v56_; + v42_: int = id v51_; + v46_: int = add v39_ v42_; + v24_: int = id v46_; + v13_: int = id v24_; v16_: int = id v0; v5_: int = id v16_; ret v5_; + jmp .b8_; +.b41_: + v57_: bool = eq c37_ v0; + br v57_ .b58_ .b59_; .b58_: - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; - v16_: int = id v0; - v5_: int = id v16_; - ret v5_; - jmp .b52_; -.b55_: - c59_: int = const -4; - c60_: int = const -3; - v61_: int = call @fac c60_; - v62_: int = call @fac c59_; - v63_: int = add v61_ v62_; - v57_: int = id v63_; - v47_: int = id v57_; - v51_: int = add v44_ v47_; - v26_: int = id v51_; - v13_: int = id v26_; - v16_: int = id v0; - v5_: int = id v16_; - ret v5_; - jmp .b58_; -.b46_: - v64_: bool = eq c42_ v0; - br v64_ .b65_ .b66_; -.b65_: - v67_: int = call @fac c2_; - v68_: int = id c42_; - v44_: int = id v68_; - v47_: int = id v0; - jmp .b48_; -.b66_: - c69_: int = const -3; - c70_: int = const -2; - v71_: int = call @fac c70_; - v72_: int = call @fac c69_; - v73_: int = add v71_ v72_; - v68_: int = id v73_; - v44_: int = id v68_; - v47_: int = id v0; - jmp .b48_; + v60_: int = call @fac c2_; + v61_: int = id c37_; + v39_: int = id v61_; + v42_: int = id v0; + jmp .b43_; +.b59_: + c62_: int = const -3; + c63_: int = const -2; + v64_: int = call @fac c63_; + v65_: int = call @fac c62_; + v66_: int = add v64_ v65_; + v61_: int = id v66_; + v39_: int = id v61_; + v42_: int = id v0; + jmp .b43_; .b11_: - v74_: int = sub v0 c4_; - v75_: int = sub v74_ c4_; - v76_: bool = eq c2_ v75_; - v77_: bool = eq c2_ v74_; - v78_: int = id c4_; - br v77_ .b79_ .b80_; -.b79_: - v81_: int = id c4_; -.b82_: - br v76_ .b83_ .b84_; -.b83_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + v67_: int = sub v0 c4_; + v68_: int = sub v67_ c4_; + v69_: bool = eq c2_ v68_; + v70_: bool = eq c2_ v67_; + v71_: int = id c4_; + br v70_ .b72_ .b73_; +.b72_: + v74_: int = id c4_; +.b75_: + br v69_ .b76_ .b77_; +.b76_: + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; -.b86_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b77_: + v79_: bool = eq c4_ v68_; + br v79_ .b80_ .b81_; +.b80_: + v82_: bool = eq c2_ c2_; + v83_: int = id c4_; + br v82_ .b84_ .b85_; +.b84_: + v86_: int = id c4_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b18_; -.b84_: - v87_: bool = eq c4_ v75_; + jmp .b8_; +.b85_: + v87_: bool = eq c2_ c4_; br v87_ .b88_ .b89_; .b88_: - v90_: bool = eq c2_ c2_; + v90_: int = call @fac c2_; v91_: int = id c4_; - br v90_ .b92_ .b93_; -.b92_: - v94_: int = id c4_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; -.b95_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + v83_: int = id v91_; + v86_: int = id c4_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; -.b96_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b89_: + c92_: int = const -2; + c93_: int = const -1; + v94_: int = call @fac c93_; + v95_: int = call @fac c92_; + v96_: int = add v94_ v95_; + v91_: int = id v96_; + v83_: int = id v91_; + v86_: int = id c4_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b86_; -.b93_: - v97_: bool = eq c2_ c4_; - br v97_ .b98_ .b99_; -.b98_: - v100_: int = call @fac c2_; + jmp .b8_; +.b81_: + v97_: int = sub v68_ c4_; + v98_: int = sub v97_ c4_; + v99_: bool = eq c2_ v98_; + v100_: bool = eq c2_ v97_; v101_: int = id c4_; - v91_: int = id v101_; - v94_: int = id c4_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; + br v100_ .b102_ .b103_; .b102_: - v85_: int = add v78_ v81_; - v16_: int = id v85_; + v104_: int = id c4_; +.b105_: + br v99_ .b106_ .b107_; +.b106_: + v108_: int = add v101_ v104_; + v86_: int = id v108_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b95_; -.b99_: - c103_: int = const -2; - c104_: int = const -1; - v105_: int = call @fac c104_; - v106_: int = call @fac c103_; - v107_: int = add v105_ v106_; - v101_: int = id v107_; - v91_: int = id v101_; - v94_: int = id c4_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b107_: + v109_: bool = eq c4_ v98_; + br v109_ .b110_ .b111_; +.b110_: + v112_: int = call @fac c2_; + v113_: int = id c4_; + v104_: int = id v113_; + v108_: int = add v101_ v104_; + v86_: int = id v108_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; - jmp .b102_; -.b89_: - v108_: int = sub v75_ c4_; - v109_: int = sub v108_ c4_; - v110_: bool = eq c2_ v109_; - v111_: bool = eq c2_ v108_; - v112_: int = id c4_; - br v111_ .b113_ .b114_; -.b113_: - v115_: int = id c4_; -.b116_: - br v110_ .b117_ .b118_; -.b117_: - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; + jmp .b8_; +.b111_: + v114_: int = sub v98_ c4_; + v115_: int = sub v114_ c4_; + v116_: int = call @fac v114_; + v117_: int = call @fac v115_; + v118_: int = add v116_ v117_; + v113_: int = id v118_; + v104_: int = id v113_; + v108_: int = add v101_ v104_; + v86_: int = id v108_; + v74_: int = id v86_; + v78_: int = add v71_ v74_; + v16_: int = id v78_; v5_: int = id v16_; ret v5_; + jmp .b8_; +.b103_: + v119_: bool = eq c4_ v97_; + br v119_ .b120_ .b121_; .b120_: - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; - jmp .b96_; -.b118_: - v121_: bool = eq c4_ v109_; - br v121_ .b122_ .b123_; -.b122_: - v124_: int = call @fac c2_; - v125_: int = id c4_; - v115_: int = id v125_; - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; -.b126_: - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; - jmp .b120_; -.b123_: - v127_: int = sub v109_ c4_; - v128_: int = sub v127_ c4_; - v129_: int = call @fac v127_; - v130_: int = call @fac v128_; - v131_: int = add v129_ v130_; - v125_: int = id v131_; - v115_: int = id v125_; - v119_: int = add v112_ v115_; - v94_: int = id v119_; - v81_: int = id v94_; - v85_: int = add v78_ v81_; - v16_: int = id v85_; - v5_: int = id v16_; - ret v5_; - jmp .b126_; -.b114_: - v132_: bool = eq c4_ v108_; - br v132_ .b133_ .b134_; -.b133_: - v135_: int = call @fac c2_; - v136_: int = id c4_; - v112_: int = id v136_; - v115_: int = id c4_; - jmp .b116_; + v122_: int = call @fac c2_; + v123_: int = id c4_; + v101_: int = id v123_; + v104_: int = id c4_; + jmp .b105_; +.b121_: + v124_: int = sub v97_ c4_; + v125_: int = sub v124_ c4_; + v126_: int = call @fac v124_; + v127_: int = call @fac v125_; + v128_: int = add v126_ v127_; + v123_: int = id v128_; + v101_: int = id v123_; + v104_: int = id c4_; + jmp .b105_; +.b73_: + v129_: bool = eq c4_ v67_; + br v129_ .b130_ .b131_; +.b130_: + v132_: bool = eq c2_ c2_; + v133_: int = id v67_; + br v132_ .b134_ .b135_; .b134_: - v137_: int = sub v108_ c4_; - v138_: int = sub v137_ c4_; - v139_: int = call @fac v137_; - v140_: int = call @fac v138_; - v141_: int = add v139_ v140_; - v136_: int = id v141_; - v112_: int = id v136_; - v115_: int = id c4_; - jmp .b116_; -.b80_: - v142_: bool = eq c4_ v74_; - br v142_ .b143_ .b144_; -.b143_: - v145_: bool = eq c2_ c2_; - v146_: int = id v74_; - br v145_ .b147_ .b148_; -.b147_: - v149_: int = id v74_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; -.b148_: - v150_: bool = eq c2_ v74_; - br v150_ .b151_ .b152_; -.b151_: - v153_: int = call @fac c2_; - v154_: int = id c2_; - v146_: int = id v154_; - v149_: int = id v74_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; + v136_: int = id v67_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b135_: + v137_: bool = eq c2_ v67_; + br v137_ .b138_ .b139_; +.b138_: + v140_: int = call @fac c2_; + v141_: int = id c2_; + v133_: int = id v141_; + v136_: int = id v67_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b139_: + c142_: int = const -2; + c143_: int = const -1; + v144_: int = call @fac c143_; + v145_: int = call @fac c142_; + v146_: int = add v144_ v145_; + v141_: int = id v146_; + v133_: int = id v141_; + v136_: int = id v67_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b131_: + v147_: int = sub v67_ c4_; + v148_: int = sub v147_ c4_; + v149_: bool = eq c2_ v148_; + v150_: bool = eq c2_ v147_; + v151_: int = id c4_; + br v150_ .b152_ .b153_; .b152_: - c155_: int = const -2; - c156_: int = const -1; - v157_: int = call @fac c156_; - v158_: int = call @fac c155_; - v159_: int = add v157_ v158_; - v154_: int = id v159_; - v146_: int = id v154_; - v149_: int = id v74_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; -.b144_: - v160_: int = sub v74_ c4_; - v161_: int = sub v160_ c4_; - v162_: bool = eq c2_ v161_; - v163_: bool = eq c2_ v160_; - v164_: int = id c4_; - br v163_ .b165_ .b166_; -.b165_: - v167_: int = id c4_; -.b168_: - br v162_ .b169_ .b170_; + v154_: int = id c4_; +.b155_: + br v149_ .b156_ .b157_; +.b157_: + v158_: bool = eq c4_ v148_; + br v158_ .b159_ .b160_; +.b159_: + v161_: int = call @fac c2_; + v162_: int = id c4_; + v154_: int = id v162_; +.b156_: + v163_: int = add v151_ v154_; + v136_: int = id v163_; + v71_: int = id v136_; + v74_: int = id c4_; + jmp .b75_; +.b160_: + v164_: int = sub v148_ c4_; + v165_: int = sub v164_ c4_; + v166_: int = call @fac v164_; + v167_: int = call @fac v165_; + v168_: int = add v166_ v167_; + v162_: int = id v168_; + v154_: int = id v162_; + jmp .b156_; +.b153_: + v169_: bool = eq c4_ v147_; + br v169_ .b170_ .b171_; .b170_: - v171_: bool = eq c4_ v161_; - br v171_ .b172_ .b173_; -.b172_: - v174_: int = call @fac c2_; - v175_: int = id c4_; - v167_: int = id v175_; -.b169_: - v176_: int = add v164_ v167_; - v149_: int = id v176_; - v78_: int = id v149_; - v81_: int = id c4_; - jmp .b82_; -.b173_: - v177_: int = sub v161_ c4_; - v178_: int = sub v177_ c4_; - v179_: int = call @fac v177_; - v180_: int = call @fac v178_; - v181_: int = add v179_ v180_; - v175_: int = id v181_; - v167_: int = id v175_; - jmp .b169_; -.b166_: - v182_: bool = eq c4_ v160_; - br v182_ .b183_ .b184_; -.b183_: - v185_: int = call @fac c2_; - v186_: int = id v160_; - v164_: int = id v186_; - v167_: int = id c4_; - jmp .b168_; -.b184_: - v187_: int = sub v160_ c4_; - v188_: int = sub v187_ c4_; - v189_: int = call @fac v187_; - v190_: int = call @fac v188_; - v191_: int = add v189_ v190_; - v186_: int = id v191_; - v164_: int = id v186_; - v167_: int = id c4_; - jmp .b168_; + v172_: int = call @fac c2_; + v173_: int = id v147_; + v151_: int = id v173_; + v154_: int = id c4_; + jmp .b155_; +.b171_: + v174_: int = sub v147_ c4_; + v175_: int = sub v174_ c4_; + v176_: int = call @fac v174_; + v177_: int = call @fac v175_; + v178_: int = add v176_ v177_; + v173_: int = id v178_; + v151_: int = id v173_; + v154_: int = id c4_; + jmp .b155_; .b8_: - ret v5_; } @main { .b0_: @@ -437,115 +376,92 @@ expression: visualization.result v5_: int = id v16_; print v5_; ret; -.b17_: - print v5_; - ret; -.b18_: - print v5_; - ret; jmp .b8_; .b15_: - v19_: bool = eq c1_ c2_; - br v19_ .b20_ .b21_; -.b20_: - v22_: int = call @fac c2_; - v23_: int = id c2_; - v13_: int = id v23_; + v17_: bool = eq c1_ c2_; + br v17_ .b18_ .b19_; +.b18_: + v20_: int = call @fac c2_; + v21_: int = id c2_; + v13_: int = id v21_; v16_: int = id c1_; v5_: int = id v16_; print v5_; ret; -.b24_: - print v5_; - ret; - jmp .b17_; -.b21_: - c25_: int = const -1; - v26_: int = sub c25_ c1_; - v27_: int = call @fac c25_; - v28_: int = call @fac v26_; - v29_: int = add v27_ v28_; - v23_: int = id v29_; - v13_: int = id v23_; + jmp .b8_; +.b19_: + c22_: int = const -1; + v23_: int = sub c22_ c1_; + v24_: int = call @fac c22_; + v25_: int = call @fac v23_; + v26_: int = add v24_ v25_; + v21_: int = id v26_; + v13_: int = id v21_; v16_: int = id c1_; v5_: int = id v16_; print v5_; ret; - jmp .b24_; + jmp .b8_; .b11_: - v30_: bool = eq c2_ c2_; - v31_: bool = eq c2_ c4_; + v27_: bool = eq c2_ c2_; + v28_: bool = eq c2_ c4_; + v29_: int = id c4_; + br v28_ .b30_ .b31_; +.b30_: v32_: int = id c4_; - br v31_ .b33_ .b34_; .b33_: - v35_: int = id c4_; -.b36_: - br v30_ .b37_ .b38_; -.b37_: - v39_: int = add v32_ v35_; - v16_: int = id v39_; - v5_: int = id v16_; - print v5_; - ret; -.b40_: - v39_: int = add v32_ v35_; - v16_: int = id v39_; + br v27_ .b34_ .b35_; +.b34_: + v36_: int = add v29_ v32_; + v16_: int = id v36_; v5_: int = id v16_; print v5_; ret; - jmp .b18_; + jmp .b8_; +.b35_: + v37_: bool = eq c2_ c4_; + br v37_ .b38_ .b39_; .b38_: - v41_: bool = eq c2_ c4_; - br v41_ .b42_ .b43_; -.b42_: - v44_: int = call @fac c2_; - v45_: int = id c4_; - v35_: int = id v45_; - v39_: int = add v32_ v35_; - v16_: int = id v39_; + v40_: int = call @fac c2_; + v41_: int = id c4_; + v32_: int = id v41_; + v36_: int = add v29_ v32_; + v16_: int = id v36_; v5_: int = id v16_; print v5_; ret; -.b46_: - v39_: int = add v32_ v35_; - v16_: int = id v39_; - v5_: int = id v16_; - print v5_; - ret; - jmp .b40_; -.b43_: - c47_: int = const -2; - c48_: int = const -1; - v49_: int = call @fac c48_; - v50_: int = call @fac c47_; - v51_: int = add v49_ v50_; - v45_: int = id v51_; - v35_: int = id v45_; - v39_: int = add v32_ v35_; - v16_: int = id v39_; + jmp .b8_; +.b39_: + c42_: int = const -2; + c43_: int = const -1; + v44_: int = call @fac c43_; + v45_: int = call @fac c42_; + v46_: int = add v44_ v45_; + v41_: int = id v46_; + v32_: int = id v41_; + v36_: int = add v29_ v32_; + v16_: int = id v36_; v5_: int = id v16_; print v5_; ret; - jmp .b46_; -.b34_: - v52_: bool = eq c4_ c4_; - br v52_ .b53_ .b54_; -.b53_: - v55_: int = call @fac c2_; - v56_: int = id c4_; - v32_: int = id v56_; - v35_: int = id c4_; - jmp .b36_; -.b54_: - c57_: int = const -1; - v58_: int = call @fac c2_; - v59_: int = call @fac c57_; - v60_: int = add v58_ v59_; - v56_: int = id v60_; - v32_: int = id v56_; - v35_: int = id c4_; - jmp .b36_; + jmp .b8_; +.b31_: + v47_: bool = eq c4_ c4_; + br v47_ .b48_ .b49_; +.b48_: + v50_: int = call @fac c2_; + v51_: int = id c4_; + v29_: int = id v51_; + v32_: int = id c4_; + jmp .b33_; +.b49_: + c52_: int = const -1; + v53_: int = call @fac c2_; + v54_: int = call @fac c52_; + v55_: int = add v53_ v54_; + v51_: int = id v55_; + v29_: int = id v51_; + v32_: int = id c4_; + jmp .b33_; .b8_: - print v5_; - ret; } diff --git a/tests/snapshots/files__gamma_condition_and-optimize-sequential.snap b/tests/snapshots/files__gamma_condition_and-optimize-sequential.snap index 1eb7a087..b93967d5 100644 --- a/tests/snapshots/files__gamma_condition_and-optimize-sequential.snap +++ b/tests/snapshots/files__gamma_condition_and-optimize-sequential.snap @@ -20,10 +20,7 @@ expression: visualization.result v7_: int = id v11_; print v7_; ret; -.b14_: - print v7_; - ret; - jmp .b15_; + jmp .b14_; .b13_: v7_: int = id v11_; print v7_; @@ -32,7 +29,5 @@ expression: visualization.result .b9_: print v7_; ret; -.b15_: - print v7_; - ret; +.b14_: } diff --git a/tests/snapshots/files__gamma_condition_and-optimize.snap b/tests/snapshots/files__gamma_condition_and-optimize.snap index 1eb7a087..b93967d5 100644 --- a/tests/snapshots/files__gamma_condition_and-optimize.snap +++ b/tests/snapshots/files__gamma_condition_and-optimize.snap @@ -20,10 +20,7 @@ expression: visualization.result v7_: int = id v11_; print v7_; ret; -.b14_: - print v7_; - ret; - jmp .b15_; + jmp .b14_; .b13_: v7_: int = id v11_; print v7_; @@ -32,7 +29,5 @@ expression: visualization.result .b9_: print v7_; ret; -.b15_: - print v7_; - ret; +.b14_: } diff --git a/tests/snapshots/files__gamma_pull_in-optimize-sequential.snap b/tests/snapshots/files__gamma_pull_in-optimize-sequential.snap index 6b6e3c3a..29a1a6f5 100644 --- a/tests/snapshots/files__gamma_pull_in-optimize-sequential.snap +++ b/tests/snapshots/files__gamma_pull_in-optimize-sequential.snap @@ -21,7 +21,4 @@ expression: visualization.result print v9_; ret; .b10_: - v9_: int = add v5_ v5_; - print v9_; - ret; } diff --git a/tests/snapshots/files__gamma_pull_in-optimize.snap b/tests/snapshots/files__gamma_pull_in-optimize.snap index 6b6e3c3a..29a1a6f5 100644 --- a/tests/snapshots/files__gamma_pull_in-optimize.snap +++ b/tests/snapshots/files__gamma_pull_in-optimize.snap @@ -21,7 +21,4 @@ expression: visualization.result print v9_; ret; .b10_: - v9_: int = add v5_ v5_; - print v9_; - ret; } diff --git a/tests/snapshots/files__if_dead_code-optimize-sequential.snap b/tests/snapshots/files__if_dead_code-optimize-sequential.snap index db119ea1..57ae3855 100644 --- a/tests/snapshots/files__if_dead_code-optimize-sequential.snap +++ b/tests/snapshots/files__if_dead_code-optimize-sequential.snap @@ -21,7 +21,4 @@ expression: visualization.result print v3_; ret; .b9_: - print v5_; - print v3_; - ret; } diff --git a/tests/snapshots/files__if_dead_code-optimize.snap b/tests/snapshots/files__if_dead_code-optimize.snap index db119ea1..57ae3855 100644 --- a/tests/snapshots/files__if_dead_code-optimize.snap +++ b/tests/snapshots/files__if_dead_code-optimize.snap @@ -21,7 +21,4 @@ expression: visualization.result print v3_; ret; .b9_: - print v5_; - print v3_; - ret; } diff --git a/tests/snapshots/files__if_dead_code_nested-optimize-sequential.snap b/tests/snapshots/files__if_dead_code_nested-optimize-sequential.snap index 8cbae8d8..ba5e0acc 100644 --- a/tests/snapshots/files__if_dead_code_nested-optimize-sequential.snap +++ b/tests/snapshots/files__if_dead_code_nested-optimize-sequential.snap @@ -29,12 +29,7 @@ expression: visualization.result print v3_; print v18_; ret; -.b20_: - print v19_; - print v3_; - print v18_; - ret; - jmp .b21_; + jmp .b20_; .b17_: v18_: int = id v13_; v19_: int = id c11_; @@ -44,67 +39,52 @@ expression: visualization.result ret; jmp .b20_; .b8_: - v22_: bool = gt v0 c6_; - c23_: bool = const false; - c24_: int = const 2; - v25_: int = id c24_; - v26_: bool = id c23_; - v27_: int = id c4_; - br v22_ .b28_ .b29_; -.b28_: - v30_: bool = gt v0 c5_; - c31_: int = const 4; - v32_: int = id c31_; - v33_: bool = id c23_; - v34_: int = id c4_; - br v30_ .b35_ .b36_; -.b35_: - c37_: int = const 3; - v32_: int = id c37_; - v33_: bool = id c23_; - v34_: int = id c4_; - v25_: int = id v32_; - v26_: bool = id v33_; - v27_: int = id v34_; - v18_: int = id v25_; + v21_: bool = gt v0 c6_; + c22_: bool = const false; + c23_: int = const 2; + v24_: int = id c23_; + v25_: bool = id c22_; + v26_: int = id c4_; + br v21_ .b27_ .b28_; +.b27_: + v29_: bool = gt v0 c5_; + c30_: int = const 4; + v31_: int = id c30_; + v32_: bool = id c22_; + v33_: int = id c4_; + br v29_ .b34_ .b35_; +.b34_: + c36_: int = const 3; + v31_: int = id c36_; + v32_: bool = id c22_; + v33_: int = id c4_; + v24_: int = id v31_; + v25_: bool = id v32_; + v26_: int = id v33_; + v18_: int = id v24_; v19_: int = id c4_; print v19_; print v3_; print v18_; ret; -.b38_: - print v19_; - print v3_; - print v18_; - ret; -.b39_: - print v19_; - print v3_; - print v18_; - ret; - jmp .b21_; -.b36_: - v25_: int = id v32_; - v26_: bool = id v33_; - v27_: int = id v34_; - v18_: int = id v25_; + jmp .b20_; +.b35_: + v24_: int = id v31_; + v25_: bool = id v32_; + v26_: int = id v33_; + v18_: int = id v24_; v19_: int = id c4_; print v19_; print v3_; print v18_; ret; - jmp .b38_; -.b29_: - v18_: int = id v25_; + jmp .b20_; +.b28_: + v18_: int = id v24_; v19_: int = id c4_; print v19_; print v3_; print v18_; ret; - jmp .b39_; -.b21_: - print v19_; - print v3_; - print v18_; - ret; +.b20_: } diff --git a/tests/snapshots/files__if_dead_code_nested-optimize.snap b/tests/snapshots/files__if_dead_code_nested-optimize.snap index df11688f..b2158cd1 100644 --- a/tests/snapshots/files__if_dead_code_nested-optimize.snap +++ b/tests/snapshots/files__if_dead_code_nested-optimize.snap @@ -28,12 +28,7 @@ expression: visualization.result print v3_; print v17_; ret; -.b19_: - print v18_; - print v3_; - print v17_; - ret; - jmp .b20_; + jmp .b19_; .b16_: v17_: int = id v12_; v18_: int = id c10_; @@ -43,67 +38,52 @@ expression: visualization.result ret; jmp .b19_; .b7_: - v21_: bool = gt v0 c5_; - c22_: bool = const false; - c23_: int = const 2; - v24_: int = id c23_; - v25_: bool = id c22_; - v26_: int = id c2_; - br v21_ .b27_ .b28_; -.b27_: - v29_: bool = gt v0 c4_; - c30_: int = const 4; - v31_: int = id c30_; - v32_: bool = id c22_; - v33_: int = id c2_; - br v29_ .b34_ .b35_; -.b34_: - c36_: int = const 3; - v31_: int = id c36_; - v32_: bool = id c22_; - v33_: int = id c2_; - v24_: int = id v31_; - v25_: bool = id v32_; - v26_: int = id v33_; - v17_: int = id v24_; + v20_: bool = gt v0 c5_; + c21_: bool = const false; + c22_: int = const 2; + v23_: int = id c22_; + v24_: bool = id c21_; + v25_: int = id c2_; + br v20_ .b26_ .b27_; +.b26_: + v28_: bool = gt v0 c4_; + c29_: int = const 4; + v30_: int = id c29_; + v31_: bool = id c21_; + v32_: int = id c2_; + br v28_ .b33_ .b34_; +.b33_: + c35_: int = const 3; + v30_: int = id c35_; + v31_: bool = id c21_; + v32_: int = id c2_; + v23_: int = id v30_; + v24_: bool = id v31_; + v25_: int = id v32_; + v17_: int = id v23_; v18_: int = id c2_; print v18_; print v3_; print v17_; ret; -.b37_: - print v18_; - print v3_; - print v17_; - ret; -.b38_: - print v18_; - print v3_; - print v17_; - ret; - jmp .b20_; -.b35_: - v24_: int = id v31_; - v25_: bool = id v32_; - v26_: int = id v33_; - v17_: int = id v24_; + jmp .b19_; +.b34_: + v23_: int = id v30_; + v24_: bool = id v31_; + v25_: int = id v32_; + v17_: int = id v23_; v18_: int = id c2_; print v18_; print v3_; print v17_; ret; - jmp .b37_; -.b28_: - v17_: int = id v24_; + jmp .b19_; +.b27_: + v17_: int = id v23_; v18_: int = id c2_; print v18_; print v3_; print v17_; ret; - jmp .b38_; -.b20_: - print v18_; - print v3_; - print v17_; - ret; +.b19_: } diff --git a/tests/snapshots/files__impossible_if-optimize-sequential.snap b/tests/snapshots/files__impossible_if-optimize-sequential.snap index 1c680908..625c3ed1 100644 --- a/tests/snapshots/files__impossible_if-optimize-sequential.snap +++ b/tests/snapshots/files__impossible_if-optimize-sequential.snap @@ -20,6 +20,4 @@ expression: visualization.result print c2_; ret; .b8_: - print c2_; - ret; } diff --git a/tests/snapshots/files__impossible_if-optimize.snap b/tests/snapshots/files__impossible_if-optimize.snap index 1c680908..625c3ed1 100644 --- a/tests/snapshots/files__impossible_if-optimize.snap +++ b/tests/snapshots/files__impossible_if-optimize.snap @@ -20,6 +20,4 @@ expression: visualization.result print c2_; ret; .b8_: - print c2_; - ret; } diff --git a/tests/snapshots/files__max-optimize-sequential.snap b/tests/snapshots/files__max-optimize-sequential.snap index 1869609e..1453213e 100644 --- a/tests/snapshots/files__max-optimize-sequential.snap +++ b/tests/snapshots/files__max-optimize-sequential.snap @@ -16,6 +16,4 @@ expression: visualization.result print v4_; ret; .b7_: - print v4_; - ret; } diff --git a/tests/snapshots/files__mem_simple_redundant_load-optimize-sequential.snap b/tests/snapshots/files__mem_simple_redundant_load-optimize-sequential.snap index bf838e65..d2e30a86 100644 --- a/tests/snapshots/files__mem_simple_redundant_load-optimize-sequential.snap +++ b/tests/snapshots/files__mem_simple_redundant_load-optimize-sequential.snap @@ -27,9 +27,4 @@ expression: visualization.result free v3_; ret; .b10_: - v8_: int = load v3_; - v9_: int = load v3_; - print v8_; - free v3_; - ret; } diff --git a/tests/snapshots/files__mem_simple_redundant_load-optimize.snap b/tests/snapshots/files__mem_simple_redundant_load-optimize.snap index bf838e65..d2e30a86 100644 --- a/tests/snapshots/files__mem_simple_redundant_load-optimize.snap +++ b/tests/snapshots/files__mem_simple_redundant_load-optimize.snap @@ -27,9 +27,4 @@ expression: visualization.result free v3_; ret; .b10_: - v8_: int = load v3_; - v9_: int = load v3_; - print v8_; - free v3_; - ret; } diff --git a/tests/snapshots/files__min-optimize-sequential.snap b/tests/snapshots/files__min-optimize-sequential.snap index 6548d179..dd20cfb2 100644 --- a/tests/snapshots/files__min-optimize-sequential.snap +++ b/tests/snapshots/files__min-optimize-sequential.snap @@ -16,6 +16,4 @@ expression: visualization.result print v4_; ret; .b7_: - print v4_; - ret; } diff --git a/tests/snapshots/files__recurse_once-optimize-sequential.snap b/tests/snapshots/files__recurse_once-optimize-sequential.snap index 3a0ae837..11b4ba7e 100644 --- a/tests/snapshots/files__recurse_once-optimize-sequential.snap +++ b/tests/snapshots/files__recurse_once-optimize-sequential.snap @@ -30,11 +30,7 @@ expression: visualization.result v11_: int = id v18_; v4_: int = id v11_; ret v4_; -.b24_: - ret v4_; -.b25_: - ret v4_; - jmp .b26_; + jmp .b24_; .b20_: v11_: int = id v18_; v4_: int = id v11_; @@ -43,11 +39,10 @@ expression: visualization.result .b13_: v4_: int = id v11_; ret v4_; - jmp .b25_; + jmp .b24_; .b6_: ret v4_; -.b26_: - ret v4_; +.b24_: } @main { .b0_: diff --git a/tests/snapshots/files__recurse_once-optimize.snap b/tests/snapshots/files__recurse_once-optimize.snap index 3a0ae837..11b4ba7e 100644 --- a/tests/snapshots/files__recurse_once-optimize.snap +++ b/tests/snapshots/files__recurse_once-optimize.snap @@ -30,11 +30,7 @@ expression: visualization.result v11_: int = id v18_; v4_: int = id v11_; ret v4_; -.b24_: - ret v4_; -.b25_: - ret v4_; - jmp .b26_; + jmp .b24_; .b20_: v11_: int = id v18_; v4_: int = id v11_; @@ -43,11 +39,10 @@ expression: visualization.result .b13_: v4_: int = id v11_; ret v4_; - jmp .b25_; + jmp .b24_; .b6_: ret v4_; -.b26_: - ret v4_; +.b24_: } @main { .b0_: diff --git a/tests/snapshots/files__simple_branch-optimize-sequential.snap b/tests/snapshots/files__simple_branch-optimize-sequential.snap index d599f2f0..ec2249c6 100644 --- a/tests/snapshots/files__simple_branch-optimize-sequential.snap +++ b/tests/snapshots/files__simple_branch-optimize-sequential.snap @@ -19,6 +19,4 @@ expression: visualization.result print v5_; ret; .b9_: - print v5_; - ret; } diff --git a/tests/snapshots/files__simple_branch-optimize.snap b/tests/snapshots/files__simple_branch-optimize.snap index d599f2f0..ec2249c6 100644 --- a/tests/snapshots/files__simple_branch-optimize.snap +++ b/tests/snapshots/files__simple_branch-optimize.snap @@ -19,6 +19,4 @@ expression: visualization.result print v5_; ret; .b9_: - print v5_; - ret; } diff --git a/tests/snapshots/files__simple_recursive-optimize-sequential.snap b/tests/snapshots/files__simple_recursive-optimize-sequential.snap index d1ff2a5a..6567792c 100644 --- a/tests/snapshots/files__simple_recursive-optimize-sequential.snap +++ b/tests/snapshots/files__simple_recursive-optimize-sequential.snap @@ -33,11 +33,7 @@ expression: visualization.result v11_: int = id v18_; v4_: int = id v11_; ret v4_; -.b24_: - ret v4_; -.b25_: - ret v4_; - jmp .b26_; + jmp .b24_; .b20_: v11_: int = id v18_; v4_: int = id v11_; @@ -46,11 +42,10 @@ expression: visualization.result .b13_: v4_: int = id v11_; ret v4_; - jmp .b25_; + jmp .b24_; .b6_: ret v4_; -.b26_: - ret v4_; +.b24_: } @main { .b0_: diff --git a/tests/snapshots/files__simple_recursive-optimize.snap b/tests/snapshots/files__simple_recursive-optimize.snap index d1ff2a5a..6567792c 100644 --- a/tests/snapshots/files__simple_recursive-optimize.snap +++ b/tests/snapshots/files__simple_recursive-optimize.snap @@ -33,11 +33,7 @@ expression: visualization.result v11_: int = id v18_; v4_: int = id v11_; ret v4_; -.b24_: - ret v4_; -.b25_: - ret v4_; - jmp .b26_; + jmp .b24_; .b20_: v11_: int = id v18_; v4_: int = id v11_; @@ -46,11 +42,10 @@ expression: visualization.result .b13_: v4_: int = id v11_; ret v4_; - jmp .b25_; + jmp .b24_; .b6_: ret v4_; -.b26_: - ret v4_; +.b24_: } @main { .b0_: diff --git a/tests/snapshots/files__small-fib-optimize-sequential.snap b/tests/snapshots/files__small-fib-optimize-sequential.snap index d8648d05..cdf8f2e9 100644 --- a/tests/snapshots/files__small-fib-optimize-sequential.snap +++ b/tests/snapshots/files__small-fib-optimize-sequential.snap @@ -46,5 +46,4 @@ expression: visualization.result v11_: int = id v17_; ret; .b7_: - ret; } diff --git a/tests/snapshots/files__small-fib-optimize.snap b/tests/snapshots/files__small-fib-optimize.snap index d8648d05..cdf8f2e9 100644 --- a/tests/snapshots/files__small-fib-optimize.snap +++ b/tests/snapshots/files__small-fib-optimize.snap @@ -46,5 +46,4 @@ expression: visualization.result v11_: int = id v17_; ret; .b7_: - ret; } diff --git a/tests/snapshots/files__sqrt_small-optimize-sequential.snap b/tests/snapshots/files__sqrt_small-optimize-sequential.snap index 834ba911..76b7fcf6 100644 --- a/tests/snapshots/files__sqrt_small-optimize-sequential.snap +++ b/tests/snapshots/files__sqrt_small-optimize-sequential.snap @@ -58,23 +58,15 @@ expression: visualization.result br v10_ .b38_ .b39_; .b38_: ret; -.b40_: - ret; jmp .b6_; .b39_: - v41_: float = fdiv v9_ v9_; - print v41_; - ret; -.b42_: - v41_: float = fdiv v9_ v9_; - print v41_; + v40_: float = fdiv v9_ v9_; + print v40_; ret; - jmp .b40_; + jmp .b6_; .b12_: - v41_: float = fdiv v9_ v9_; - print v41_; + v40_: float = fdiv v9_ v9_; + print v40_; ret; - jmp .b42_; .b6_: - ret; } diff --git a/tests/snapshots/files__sqrt_small-optimize.snap b/tests/snapshots/files__sqrt_small-optimize.snap index 834ba911..76b7fcf6 100644 --- a/tests/snapshots/files__sqrt_small-optimize.snap +++ b/tests/snapshots/files__sqrt_small-optimize.snap @@ -58,23 +58,15 @@ expression: visualization.result br v10_ .b38_ .b39_; .b38_: ret; -.b40_: - ret; jmp .b6_; .b39_: - v41_: float = fdiv v9_ v9_; - print v41_; - ret; -.b42_: - v41_: float = fdiv v9_ v9_; - print v41_; + v40_: float = fdiv v9_ v9_; + print v40_; ret; - jmp .b40_; + jmp .b6_; .b12_: - v41_: float = fdiv v9_ v9_; - print v41_; + v40_: float = fdiv v9_ v9_; + print v40_; ret; - jmp .b42_; .b6_: - ret; }