Skip to content

Commit

Permalink
snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpal committed Oct 31, 2024
1 parent c6a63be commit 9037b8b
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 30 deletions.
16 changes: 11 additions & 5 deletions tests/snapshots/files__block-diamond-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ expression: visualization.result
v7_: int = id v6_;
v8_: int = id c2_;
br v4_ .b9_ .b10_;
.b9_:
v11_: int = add c2_ v7_;
print v11_;
ret;
jmp .b12_;
.b10_:
v11_: int = add c3_ v6_;
v7_: int = id v11_;
v13_: int = add c3_ v6_;
v7_: int = id v13_;
v8_: int = id c2_;
.b9_:
v12_: int = add c2_ v7_;
print v12_;
v11_: int = add c2_ v7_;
print v11_;
ret;
.b12_:
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 8888
@main(v0: int) {
.b1_:
c2_: int = const 1;
Expand Down Expand Up @@ -49,4 +50,5 @@ expression: visualization.result
br v29_ .b12_ .b30_;
.b30_:
print v0;
ret;
}
2 changes: 2 additions & 0 deletions tests/snapshots/files__gamma_pull_in-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 1
@main(v0: int) {
.b1_:
c2_: int = const 10;
Expand All @@ -11,4 +12,5 @@ expression: visualization.result
v6_: int = select v3_ c4_ c5_;
v7_: int = add v6_ v6_;
print v7_;
ret;
}
2 changes: 2 additions & 0 deletions tests/snapshots/files__if_dead_code-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 1
@main(v0: int) {
.b1_:
c2_: int = const 0;
Expand All @@ -10,4 +11,5 @@ expression: visualization.result
v5_: int = select v3_ c4_ c2_;
print v5_;
print v3_;
ret;
}
83 changes: 58 additions & 25 deletions tests/snapshots/files__if_dead_code_nested-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 1
@main(v0: int) {
.b1_:
c2_: int = const 0;
Expand All @@ -22,6 +23,15 @@ expression: visualization.result
v12_: int = id c10_;
v13_: bool = id c9_;
v14_: int = id c10_;
v17_: int = id v12_;
v18_: int = id c10_;
c19_: int = const 1;
v20_: int = select v3_ c19_ c2_;
print v20_;
print v3_;
print v17_;
ret;
jmp .b21_;
.b16_:
v17_: int = id v12_;
v18_: int = id c10_;
Expand All @@ -31,37 +41,60 @@ expression: visualization.result
print v3_;
print v17_;
ret;
jmp .b21_;
.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_;
.b35_:
v24_: int = id v31_;
v25_: bool = id v32_;
v26_: int = id v33_;
v22_: bool = gt v0 c5_;
c23_: bool = const false;
c24_: int = const 2;
v25_: int = id c24_;
v26_: bool = id c23_;
v27_: int = id c2_;
br v22_ .b28_ .b29_;
.b28_:
v17_: int = id v24_;
v30_: bool = gt v0 c4_;
c31_: int = const 4;
v32_: int = id c31_;
v33_: bool = id c23_;
v34_: int = id c2_;
br v30_ .b35_ .b36_;
.b35_:
c37_: int = const 3;
v32_: int = id c37_;
v33_: bool = id c23_;
v34_: int = id c2_;
v25_: int = id v32_;
v26_: bool = id v33_;
v27_: int = id v34_;
v17_: int = id v25_;
v18_: int = id c2_;
.b37_:
c19_: int = const 1;
v20_: int = select v3_ c19_ c2_;
print v20_;
print v3_;
print v17_;
ret;
jmp .b21_;
.b36_:
v25_: int = id v32_;
v26_: bool = id v33_;
v27_: int = id v34_;
v17_: int = id v25_;
v18_: int = id c2_;
c19_: int = const 1;
v20_: int = select v3_ c19_ c2_;
print v20_;
print v3_;
print v17_;
ret;
jmp .b21_;
.b29_:
v17_: int = id v25_;
v18_: int = id c2_;
c19_: int = const 1;
v20_: int = select v3_ c19_ c2_;
print v20_;
print v3_;
print v17_;
ret;
.b21_:
}
2 changes: 2 additions & 0 deletions tests/snapshots/files__if_in_loop-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 1
@main(v0: int) {
.b1_:
c2_: int = const 0;
Expand Down Expand Up @@ -30,4 +31,5 @@ expression: visualization.result
v13_: int = id v13_;
br v16_ .b14_ .b17_;
.b17_:
ret;
}
65 changes: 65 additions & 0 deletions tests/snapshots/files__select-optimize-sequential.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 20
@main(v0: int) {
.b1_:
c2_: int = const 0;
c3_: int = const 10;
v4_: int = id c2_;
v5_: int = id c3_;
v6_: int = id c2_;
v7_: int = id v0;
.b8_:
c9_: int = const 5;
v10_: bool = eq c9_ v5_;
v11_: bool = not v10_;
v12_: int = id v4_;
v13_: int = id v5_;
v14_: int = id v6_;
v15_: int = id v7_;
br v11_ .b16_ .b17_;
.b16_:
c18_: int = const 1;
v19_: int = add c18_ v6_;
v20_: bool = eq v19_ v7_;
v21_: int = add v19_ v4_;
v22_: int = id v21_;
v23_: int = id v5_;
v24_: int = id v19_;
v25_: int = id v7_;
br v20_ .b26_ .b27_;
.b26_:
c28_: int = const 5;
v22_: int = id v21_;
v23_: int = id c28_;
v24_: int = id v19_;
v25_: int = id v7_;
v12_: int = id v22_;
v13_: int = id v23_;
v14_: int = id v24_;
v15_: int = id v25_;
v4_: int = id v12_;
v5_: int = id v13_;
v6_: int = id v14_;
v7_: int = id v15_;
jmp .b8_;
.b27_:
v12_: int = id v22_;
v13_: int = id v23_;
v14_: int = id v24_;
v15_: int = id v25_;
v4_: int = id v12_;
v5_: int = id v13_;
v6_: int = id v14_;
v7_: int = id v15_;
jmp .b8_;
.b17_:
v4_: int = id v12_;
v5_: int = id v13_;
v6_: int = id v14_;
v7_: int = id v15_;
print v4_;
ret;
}
2 changes: 2 additions & 0 deletions tests/snapshots/files__select-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 20
@main(v0: int) {
.b1_:
c2_: int = const 0;
Expand Down Expand Up @@ -41,4 +42,5 @@ expression: visualization.result
v6_: int = id v14_;
v7_: int = id v15_;
print v4_;
ret;
}
22 changes: 22 additions & 0 deletions tests/snapshots/files__select_simple-optimize-sequential.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 20 30
@main(v0: int, v1: int) {
.b2_:
v3_: int = mul v0 v1;
c4_: int = const 20;
v5_: bool = lt v3_ c4_;
v6_: int = id v1;
br v5_ .b7_ .b8_;
.b7_:
v6_: int = id v0;
print v6_;
ret;
jmp .b9_;
.b8_:
print v6_;
ret;
.b9_:
}
2 changes: 2 additions & 0 deletions tests/snapshots/files__select_simple-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 20 30
@main(v0: int, v1: int) {
.b2_:
v3_: int = mul v0 v1;
c4_: int = const 20;
v5_: bool = lt v3_ c4_;
v6_: int = select v5_ v0 v1;
print v6_;
ret;
}
2 changes: 2 additions & 0 deletions tests/snapshots/files__simple_branch-optimize.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
source: tests/files.rs
expression: visualization.result
---
# ARGS: 1
@main(v0: int) {
.b1_:
c2_: int = const 0;
v3_: bool = lt v0 c2_;
c4_: int = const 1;
v5_: int = select v3_ c4_ c2_;
print v5_;
ret;
}

0 comments on commit 9037b8b

Please sign in to comment.