Skip to content

Commit

Permalink
Add snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
kirstenmg committed Oct 31, 2024
1 parent ef8ea4b commit 197f291
Show file tree
Hide file tree
Showing 33 changed files with 972 additions and 0 deletions.
File renamed without changes.
64 changes: 64 additions & 0 deletions tests/snapshots/files__branch_hoisting-optimize-sequential.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 0
@main(v0: int) {
.b1_:
c2_: int = const 0;
c3_: int = const 500;
v4_: int = id c2_;
v5_: int = id c2_;
v6_: int = id v0;
v7_: int = id c2_;
v8_: int = id c3_;
.b9_:
v10_: bool = lt v5_ v8_;
v11_: int = id v4_;
v12_: int = id v5_;
v13_: int = id v6_;
v14_: int = id v7_;
v15_: int = id v8_;
br v10_ .b16_ .b17_;
.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_;
v11_: int = id v23_;
v12_: int = id v30_;
v13_: int = id v6_;
v14_: int = id v7_;
v15_: int = id v8_;
v4_: int = id v11_;
v5_: int = id v12_;
v6_: int = id v13_;
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_;
}
64 changes: 64 additions & 0 deletions tests/snapshots/files__branch_hoisting-optimize.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 0
@main(v0: int) {
.b1_:
c2_: int = const 0;
c3_: int = const 500;
v4_: int = id c2_;
v5_: int = id c2_;
v6_: int = id v0;
v7_: int = id c2_;
v8_: int = id c3_;
.b9_:
v10_: bool = lt v5_ v8_;
v11_: int = id v4_;
v12_: int = id v5_;
v13_: int = id v6_;
v14_: int = id v7_;
v15_: int = id v8_;
br v10_ .b16_ .b17_;
.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_;
v11_: int = id v23_;
v12_: int = id v30_;
v13_: int = id v6_;
v14_: int = id v7_;
v15_: int = id v8_;
v4_: int = id v11_;
v5_: int = id v12_;
v6_: int = id v13_;
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_;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 4
@main(v0: int) {
.b1_:
c2_: int = const 20;
print c2_;
}
10 changes: 10 additions & 0 deletions tests/snapshots/files__conditional_constant_folding-optimize.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 4
@main(v0: int) {
.b1_:
c2_: int = const 20;
print c2_;
}
42 changes: 42 additions & 0 deletions tests/snapshots/files__dead_loop_deletion-optimize-sequential.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS:
@main {
.b0_:
c1_: int = const 2;
c2_: int = const 3;
c3_: int = const 0;
c4_: int = const 1;
c5_: int = const 40;
v6_: int = id c2_;
v7_: int = id c3_;
v8_: int = id c4_;
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_;
.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_;
}
42 changes: 42 additions & 0 deletions tests/snapshots/files__dead_loop_deletion-optimize.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS:
@main {
.b0_:
c1_: int = const 2;
c2_: int = const 3;
c3_: int = const 0;
c4_: int = const 1;
c5_: int = const 40;
v6_: int = id c2_;
v7_: int = id c3_;
v8_: int = id c4_;
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_;
.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_;
}
12 changes: 12 additions & 0 deletions tests/snapshots/files__if_true-optimize-sequential.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 20
@main(v0: int) {
.b1_:
c2_: int = const 1;
v3_: int = sub v0 c2_;
print v0;
print v3_;
}
12 changes: 12 additions & 0 deletions tests/snapshots/files__if_true-optimize.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 20
@main(v0: int) {
.b1_:
c2_: int = const 1;
v3_: int = sub v0 c2_;
print v0;
print v3_;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS:
@main {
.b0_:
c1_: int = const 0;
c2_: int = const 3;
v3_: int = id c1_;
v4_: int = id c2_;
.b5_:
v6_: bool = lt v3_ v4_;
v7_: int = id v3_;
v8_: int = id v4_;
br v6_ .b9_ .b10_;
.b9_:
c11_: int = const 1;
v12_: int = add c11_ v3_;
v7_: int = id v12_;
v8_: int = id v4_;
v3_: int = id v7_;
v4_: int = id v8_;
jmp .b5_;
.b10_:
v3_: int = id v7_;
v4_: int = id v8_;
c13_: int = const 5;
v14_: int = mul c13_ v3_;
print v14_;
}
31 changes: 31 additions & 0 deletions tests/snapshots/files__loop_based_code_motion-optimize.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS:
@main {
.b0_:
c1_: int = const 0;
c2_: int = const 3;
v3_: int = id c1_;
v4_: int = id c2_;
.b5_:
v6_: bool = lt v3_ v4_;
v7_: int = id v3_;
v8_: int = id v4_;
br v6_ .b9_ .b10_;
.b9_:
c11_: int = const 1;
v12_: int = add c11_ v3_;
v7_: int = id v12_;
v8_: int = id v4_;
v3_: int = id v7_;
v4_: int = id v8_;
jmp .b5_;
.b10_:
v3_: int = id v7_;
v4_: int = id v8_;
c13_: int = const 5;
v14_: int = mul c13_ v3_;
print v14_;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
source: tests/files.rs
expression: visualization.result
---
# ARGS: 30 10
@main(v0: int, v1: int) {
.b2_:
c3_: int = const 0;
c4_: int = const 1;
c5_: int = const 20;
v6_: int = id c3_;
v7_: int = id c4_;
v8_: int = id v1;
v9_: int = id v0;
v10_: int = id c5_;
.b11_:
v12_: bool = lt v6_ v10_;
v13_: int = id v6_;
v14_: int = id v7_;
v15_: int = id v8_;
v16_: int = id v9_;
v17_: int = id v10_;
br v12_ .b18_ .b19_;
.b18_:
v20_: int = mul v10_ v9_;
v21_: bool = lt v20_ v8_;
v22_: int = id v6_;
v23_: int = id v7_;
v24_: int = id v20_;
v25_: int = id v8_;
v26_: int = id v9_;
v27_: int = id v10_;
br v21_ .b28_ .b29_;
.b28_:
v30_: int = add v20_ v7_;
v22_: int = id v6_;
v23_: int = id v7_;
v24_: int = id v30_;
v25_: int = id v8_;
v26_: int = id v9_;
v27_: int = id v10_;
.b29_:
v31_: int = mul v24_ v6_;
print v31_;
v32_: int = add v6_ v7_;
v13_: int = id v32_;
v14_: int = id v7_;
v15_: int = id v8_;
v16_: int = id v9_;
v17_: int = id v10_;
v6_: int = id v13_;
v7_: int = id v14_;
v8_: int = id v15_;
v9_: int = id v16_;
v10_: int = id v17_;
jmp .b11_;
.b19_:
v6_: int = id v13_;
v7_: int = id v14_;
v8_: int = id v15_;
v9_: int = id v16_;
v10_: int = id v17_;
}
Loading

0 comments on commit 197f291

Please sign in to comment.