-
Notifications
You must be signed in to change notification settings - Fork 237
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 #302 from 2b3o4o/dead-branch
add dead-branch benchmark
- Loading branch information
Showing
4 changed files
with
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@main { | ||
v1: int = const 1; | ||
v2: int = const 0; | ||
counter: int = const 0; | ||
|
||
.loop_start: | ||
v7: int = id counter; | ||
v8: int = const 99; | ||
v9: bool = lt v7 v8; | ||
br v9 .loop_body .loop_end; | ||
|
||
.loop_body: | ||
v3: bool = eq v1 v2; # Always false | ||
br v3 .then .else; # .then is a dead branch - this br instruction can be optimized out by a smart compiler | ||
|
||
.then: | ||
v4: int = const 100; | ||
print v4; | ||
|
||
.else: | ||
v4: int = const 50; | ||
|
||
v10: int = id counter; | ||
v11: int = const 1; | ||
v12: int = add v10 v11; | ||
counter: int = id v12; | ||
|
||
jmp .loop_start; | ||
|
||
.loop_end: | ||
print v4; | ||
} |
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 @@ | ||
50 |
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 @@ | ||
total_dyn_inst: 1196 |
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