Skip to content

Commit

Permalink
snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpal committed Nov 1, 2024
1 parent 96eea07 commit ccdd674
Show file tree
Hide file tree
Showing 28 changed files with 216 additions and 528 deletions.
32 changes: 6 additions & 26 deletions tests/snapshots/files__block-diamond-optimize-sequential.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,11 @@ expression: visualization.result
c2_: int = const 1;
c3_: int = const 2;
v4_: bool = lt v0 c3_;
c5_: int = const 0;
c6_: int = const 5;
v7_: int = id c2_;
v8_: int = id c2_;
v9_: int = id c3_;
br v4_ .b10_ .b11_;
.b10_:
c12_: int = const 4;
v7_: int = id c12_;
v8_: int = id c2_;
v9_: int = id c3_;
v13_: int = id v7_;
v14_: int = id v8_;
v15_: int = add c2_ v13_;
print v15_;
c5_: int = const 4;
v6_: int = select v4_ c5_ c2_;
v7_: int = add c3_ v6_;
v8_: int = select v4_ v6_ v7_;
v9_: int = add c2_ v8_;
print v9_;
ret;
jmp .b16_;
.b11_:
v13_: int = id v7_;
v14_: int = id v8_;
v17_: int = add v7_ v9_;
v13_: int = id v17_;
v14_: int = id v8_;
v15_: int = add c2_ v13_;
print v15_;
ret;
.b16_:
}
29 changes: 9 additions & 20 deletions tests/snapshots/files__block-diamond-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,14 @@ expression: visualization.result
# ARGS: 1
@main(v0: int) {
.b1_:
c2_: int = const 1;
c3_: int = const 2;
v4_: bool = lt v0 c3_;
c5_: int = const 4;
v6_: int = select v4_ c5_ c2_;
v7_: int = id v6_;
v8_: int = id c2_;
br v4_ .b9_ .b10_;
.b9_:
v11_: int = add c2_ v7_;
print v11_;
c2_: int = const 2;
v3_: bool = lt v0 c2_;
c4_: int = const 4;
c5_: int = const 1;
v6_: int = select v3_ c4_ c5_;
v7_: int = add c2_ v6_;
v8_: int = select v3_ v6_ v7_;
v9_: int = add c5_ v8_;
print v9_;
ret;
jmp .b12_;
.b10_:
v13_: int = add c3_ v6_;
v7_: int = id v13_;
v8_: int = id c2_;
v11_: int = add c2_ v7_;
print v11_;
ret;
.b12_:
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@ expression: visualization.result
.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_;
v4_: int = add v0 v0;
v5_: int = mul c2_ v4_;
v6_: int = select v3_ v4_ v5_;
print v6_;
ret;
jmp .b8_;
.b5_:
v9_: int = add v0 v0;
v10_: int = mul c2_ v9_;
v7_: int = id v10_;
print v7_;
ret;
.b8_:
}
17 changes: 4 additions & 13 deletions tests/snapshots/files__branch_duplicate_work-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@ expression: visualization.result
.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_;
v4_: int = add v0 v0;
v5_: int = mul c2_ v4_;
v6_: int = select v3_ v4_ v5_;
print v6_;
ret;
jmp .b8_;
.b5_:
v9_: int = add v0 v0;
v10_: int = mul c2_ v9_;
v7_: int = id v10_;
print v7_;
ret;
.b8_:
}
29 changes: 8 additions & 21 deletions tests/snapshots/files__branch_hoisting-optimize-sequential.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,14 @@ expression: visualization.result
.b16_:
v18_: bool = eq v6_ v7_;
c19_: int = const 2;
br v18_ .b20_ .b21_;
.b20_:
v22_: int = mul c19_ v5_;
v23_: int = id v22_;
v24_: int = id v5_;
v25_: int = id v6_;
v26_: int = id v6_;
v27_: int = id v8_;
.b28_:
c29_: int = const 1;
v30_: int = add c29_ v5_;
v20_: int = mul c19_ v5_;
c21_: int = const 3;
v22_: int = mul c21_ v5_;
v23_: int = select v18_ v20_ v22_;
c24_: int = const 1;
v25_: int = add c24_ v5_;
v11_: int = id v23_;
v12_: int = id v30_;
v12_: int = id v25_;
v13_: int = id v6_;
v14_: int = id v7_;
v15_: int = id v8_;
Expand All @@ -45,20 +40,12 @@ expression: visualization.result
v7_: int = id v14_;
v8_: int = id v15_;
jmp .b9_;
.b21_:
c31_: int = const 3;
v32_: int = mul c31_ v5_;
v23_: int = id v32_;
v24_: int = id v5_;
v25_: int = id v6_;
v26_: int = id v7_;
v27_: int = id v8_;
jmp .b28_;
.b17_:
v4_: int = id v11_;
v5_: int = id v12_;
v6_: int = id v13_;
v7_: int = id v14_;
v8_: int = id v15_;
print v4_;
ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,48 +32,23 @@ expression: visualization.result
v25_: bool = eq v11_ v24_;
v26_: int = mul v7_ v9_;
v27_: int = add v26_ v8_;
c28_: bool = const true;
v29_: int = id v6_;
v30_: bool = id c28_;
v31_: int = id v27_;
v32_: int = id v8_;
v33_: int = id v9_;
v34_: int = id v10_;
v35_: int = id v11_;
br v25_ .b36_ .b37_;
.b36_:
c38_: bool = const true;
v29_: int = id v6_;
v30_: bool = id c38_;
v31_: int = id v22_;
v32_: int = id v8_;
v33_: int = id v9_;
v34_: int = id v10_;
v35_: int = id v11_;
v28_: int = select v25_ v22_ v27_;
v14_: int = id v6_;
v15_: int = id v31_;
v15_: int = id v28_;
v16_: int = id v8_;
v17_: int = id v9_;
v18_: int = id v10_;
v19_: int = id v11_;
.b20_:
v39_: bool = not v13_;
v29_: bool = not v13_;
v6_: int = id v14_;
v7_: int = id v15_;
v8_: int = id v16_;
v9_: int = id v17_;
v10_: int = id v18_;
v11_: int = id v19_;
br v39_ .b12_ .b40_;
.b37_:
v14_: int = id v6_;
v15_: int = id v31_;
v16_: int = id v8_;
v17_: int = id v9_;
v18_: int = id v10_;
v19_: int = id v11_;
jmp .b20_;
.b40_:
br v29_ .b12_ .b30_;
.b30_:
print v0;
ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ expression: visualization.result
.b1_:
c2_: int = const 20;
print c2_;
ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ expression: visualization.result
.b1_:
c2_: int = const 20;
print c2_;
ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ expression: visualization.result
v8_: int = id v14_;
v9_: int = id v15_;
print c1_;
ret;
}
31 changes: 10 additions & 21 deletions tests/snapshots/files__dead_loop_deletion-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,16 @@ expression: visualization.result
v9_: int = id c5_;
.b10_:
v11_: bool = lt v7_ v9_;
v12_: int = id v6_;
v13_: int = id v7_;
v14_: int = id v8_;
v15_: int = id v9_;
br v11_ .b16_ .b17_;
v12_: int = add v6_ v8_;
v13_: int = select v11_ v12_ v6_;
v14_: int = add v7_ v8_;
v15_: int = select v11_ v14_ v7_;
v6_: int = id v13_;
v7_: int = id v15_;
v8_: int = id v8_;
v9_: int = id v9_;
br v11_ .b10_ .b16_;
.b16_:
v18_: int = add v6_ v8_;
v19_: int = add v7_ v8_;
v12_: int = id v18_;
v13_: int = id v19_;
v14_: int = id v8_;
v15_: int = id v9_;
v6_: int = id v12_;
v7_: int = id v13_;
v8_: int = id v14_;
v9_: int = id v15_;
jmp .b10_;
.b17_:
v6_: int = id v12_;
v7_: int = id v13_;
v8_: int = id v14_;
v9_: int = id v15_;
print c1_;
ret;
}
24 changes: 7 additions & 17 deletions tests/snapshots/files__fib_shape-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,13 @@ expression: visualization.result
v6_: int = id v0;
.b7_:
v8_: bool = lt v4_ v6_;
v9_: int = id v4_;
v10_: int = id v5_;
v11_: int = id v6_;
br v8_ .b12_ .b13_;
.b12_:
v14_: int = add v4_ v5_;
v9_: int = id v14_;
v10_: int = id v5_;
v11_: int = id v6_;
v4_: int = id v9_;
v5_: int = id v10_;
v6_: int = id v11_;
jmp .b7_;
.b13_:
v4_: int = id v9_;
v5_: int = id v10_;
v6_: int = id v11_;
v9_: int = add v4_ v5_;
v10_: int = select v8_ v9_ v4_;
v4_: int = id v10_;
v5_: int = id v5_;
v6_: int = id v6_;
br v8_ .b7_ .b11_;
.b11_:
print v4_;
ret;
}
23 changes: 3 additions & 20 deletions tests/snapshots/files__gamma_condition_and-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,8 @@ expression: visualization.result
v4_: bool = lt c2_ v0;
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_;
v7_: int = id v11_;
print v7_;
v7_: int = select v4_ c5_ c6_;
v8_: int = select v3_ v7_ c6_;
print v8_;
ret;
jmp .b14_;
.b13_:
v7_: int = id v11_;
print v7_;
ret;
jmp .b14_;
.b9_:
print v7_;
ret;
.b14_:
}
19 changes: 5 additions & 14 deletions tests/snapshots/files__gamma_pull_in-optimize-sequential.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,10 @@ expression: visualization.result
.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_;
v9_: int = add v5_ v5_;
print v9_;
c4_: int = const 2;
c5_: int = const 3;
v6_: int = select v3_ c4_ c5_;
v7_: int = add v6_ v6_;
print v7_;
ret;
jmp .b10_;
.b7_:
v9_: int = add v5_ v5_;
print v9_;
ret;
.b10_:
}
14 changes: 2 additions & 12 deletions tests/snapshots/files__if_dead_code-optimize-sequential.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,9 @@ expression: visualization.result
.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_;
c4_: int = const 1;
v5_: int = select v3_ c4_ c2_;
print v5_;
print v3_;
ret;
jmp .b9_;
.b7_:
print v5_;
print v3_;
ret;
.b9_:
}
Loading

0 comments on commit ccdd674

Please sign in to comment.