Skip to content

Commit

Permalink
test: run IR transformation passes (SplitCriticalEdges, Treeify, Inli…
Browse files Browse the repository at this point in the history
…neBlocks)

when producing IR for the integration tests.
  • Loading branch information
greenhat committed Nov 16, 2023
1 parent 810a88d commit d23b995
Show file tree
Hide file tree
Showing 55 changed files with 82 additions and 222 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ edition.workspace = true
[dependencies]
miden-frontend-wasm.workspace = true
miden-hir.workspace = true
miden-hir-transform.workspace = true
miden-codegen-masm.workspace = true
miden-assembly.workspace = true
miden-core.workspace = true
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/expected/and_bool.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v0, v1 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/and_i16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/and_i32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/and_i8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/and_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/and_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/and_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = band v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_i16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_i32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_i64.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i64, i64) -> i32 {
block0(v0: i64, v1: i64):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_i8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_u64.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i64, i64) -> i32 {
block0(v0: i64, v1: i64):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/eq_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = eq v0, v1 : i1;
v4 = cast v3 : i32;
br block1(v4);

block1(v2: i32):
ret v2;
ret v4;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/fib.hir
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@ block0(v0: i32):
v4 = cast v2 : u32;
v5 = lt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v1: i32):
ret v1;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/ge_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = gte v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/ge_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = gte v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/ge_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = gte v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/gt_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = gt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/gt_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = gt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/gt_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = gt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/le_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = lte v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/le_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = lte v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/le_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = lte v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/lt_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = lt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/lt_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = lt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/lt_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ block0(v0: i32, v1: i32):
v4 = cast v1 : u32;
v5 = lt v3, v4 : i1;
v6 = cast v5 : i32;
br block1(v6);

block1(v2: i32):
ret v2;
ret v6;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_bool.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 1 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_i16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 -1 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_i32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 -1 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_i8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 -1 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_u16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 65535 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_u32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 -1 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/not_u8.hir
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ pub fn entrypoint(i32) -> i32 {
block0(v0: i32):
v2 = const.i32 255 : i32;
v3 = bxor v0, v2 : i32;
br block1(v3);

block1(v1: i32):
ret v1;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/or_bool.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = bor v0, v1 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/or_i16.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = bor v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
5 changes: 1 addition & 4 deletions tests/integration/expected/or_i32.hir
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ global external @gv2 : i32 = $0 { id = 2 };
pub fn entrypoint(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v3 = bor v1, v0 : i32;
br block1(v3);

block1(v2: i32):
ret v2;
ret v3;
}
Loading

0 comments on commit d23b995

Please sign in to comment.