-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from egraphs-good/apal-minmax2
Rewrite if a </> b then a else b to min/max
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ARGS: 20 30 | ||
@main(x: int, y: int) { | ||
cmp: bool = gt x y; | ||
one: int = const 1; | ||
br cmp .then .else; | ||
.then: | ||
res: int = id x; | ||
jmp .done; | ||
.else: | ||
res: int = id y; | ||
jmp .done; | ||
.done: | ||
print res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ARGS: 20 30 | ||
@main(x: int, y: int) { | ||
cmp: bool = lt x y; | ||
res: int = id y; | ||
br cmp .then .else; | ||
.then: | ||
res: int = id x; | ||
.else: | ||
.done: | ||
print res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
source: tests/files.rs | ||
expression: visualization.result | ||
--- | ||
@main(v0: int, v1: int) { | ||
.b2_: | ||
v3_: int = smax v1 v0; | ||
v4_: bool = lt v1 v0; | ||
v5_: int = id v1; | ||
br v4_ .b6_ .b7_; | ||
.b6_: | ||
v5_: int = id v0; | ||
.b7_: | ||
print v3_; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
source: tests/files.rs | ||
expression: visualization.result | ||
--- | ||
@main(v0: int, v1: int) { | ||
.b2_: | ||
v3_: int = smin v0 v1; | ||
v4_: bool = lt v0 v1; | ||
v5_: int = id v1; | ||
br v4_ .b6_ .b7_; | ||
.b6_: | ||
v5_: int = id v0; | ||
.b7_: | ||
print v3_; | ||
} |