-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make if then show as tail recursive in can
- Loading branch information
Showing
5 changed files
with
110 additions
and
7 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
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
31 changes: 31 additions & 0 deletions
31
crates/compiler/test_mono/generated/tail_call_elimination_if_else.txt
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,31 @@ | ||
procedure Bool.11 (#Attr.2, #Attr.3): | ||
let Bool.23 : Int1 = lowlevel Eq #Attr.2 #Attr.3; | ||
ret Bool.23; | ||
|
||
procedure Num.19 (#Attr.2, #Attr.3): | ||
let Num.297 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; | ||
ret Num.297; | ||
|
||
procedure Num.20 (#Attr.2, #Attr.3): | ||
let Num.298 : I64 = lowlevel NumSub #Attr.2 #Attr.3; | ||
ret Num.298; | ||
|
||
procedure Test.1 (#Derived_gen.0, #Derived_gen.1): | ||
joinpoint Test.7 Test.2 Test.3: | ||
let Test.14 : I64 = 0i64; | ||
let Test.12 : Int1 = CallByName Bool.11 Test.2 Test.14; | ||
if Test.12 then | ||
ret Test.3; | ||
else | ||
let Test.11 : I64 = 1i64; | ||
let Test.9 : I64 = CallByName Num.20 Test.2 Test.11; | ||
let Test.10 : I64 = CallByName Num.19 Test.2 Test.3; | ||
jump Test.7 Test.9 Test.10; | ||
in | ||
jump Test.7 #Derived_gen.0 #Derived_gen.1; | ||
|
||
procedure Test.0 (): | ||
let Test.5 : I64 = 1000000i64; | ||
let Test.6 : I64 = 0i64; | ||
let Test.4 : I64 = CallByName Test.1 Test.5 Test.6; | ||
ret Test.4; |
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