-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
101 additions
and
8 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
49 changes: 49 additions & 0 deletions
49
tests/snapshots/files__if_invariant_dont_pull_out-optimize-sequential.snap
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,49 @@ | ||
--- | ||
source: tests/files.rs | ||
expression: visualization.result | ||
--- | ||
# ARGS: 20 | ||
@unrelated_fn(v0: int, v1: int): int { | ||
.b2_: | ||
c3_: int = const 3; | ||
v4_: int = div v1 c3_; | ||
v5_: int = div v0 v4_; | ||
ret v5_; | ||
} | ||
@other_unrelated_fn(v0: int, v1: int): int { | ||
.b2_: | ||
c3_: int = const 5; | ||
v4_: int = div v0 c3_; | ||
v5_: int = div v1 v4_; | ||
ret v5_; | ||
} | ||
@main(v0: int) { | ||
.b1_: | ||
c2_: int = const 0; | ||
v3_: bool = gt v0 c2_; | ||
v4_: int = abs v0; | ||
c5_: int = const 2; | ||
v6_: int = mul c5_ v4_; | ||
br v3_ .b7_ .b8_; | ||
.b7_: | ||
v9_: int = sub v6_ v0; | ||
v10_: int = add v0 v9_; | ||
c11_: int = const 3; | ||
v12_: int = div v10_ c11_; | ||
v13_: int = div v0 v12_; | ||
v14_: int = id v13_; | ||
print v14_; | ||
ret; | ||
jmp .b15_; | ||
.b8_: | ||
v16_: int = abs v0; | ||
v17_: int = add v16_ v6_; | ||
v18_: int = add v0 v17_; | ||
c19_: int = const 5; | ||
v20_: int = div v0 c19_; | ||
v21_: int = div v18_ v20_; | ||
v14_: int = id v21_; | ||
print v14_; | ||
ret; | ||
.b15_: | ||
} |
44 changes: 44 additions & 0 deletions
44
tests/snapshots/files__if_invariant_dont_pull_out-optimize.snap
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,44 @@ | ||
--- | ||
source: tests/files.rs | ||
expression: visualization.result | ||
--- | ||
# ARGS: 20 | ||
@unrelated_fn(v0: int, v1: int): int { | ||
.b2_: | ||
c3_: int = const 3; | ||
v4_: int = div v1 c3_; | ||
v5_: int = div v0 v4_; | ||
ret v5_; | ||
} | ||
@other_unrelated_fn(v0: int, v1: int): int { | ||
.b2_: | ||
c3_: int = const 5; | ||
v4_: int = div v0 c3_; | ||
v5_: int = div v1 v4_; | ||
ret v5_; | ||
} | ||
@main(v0: int) { | ||
.b1_: | ||
c2_: int = const 0; | ||
v3_: bool = gt v0 c2_; | ||
v4_: int = abs v0; | ||
c5_: int = const 2; | ||
v6_: int = mul c5_ v4_; | ||
br v3_ .b7_ .b8_; | ||
.b7_: | ||
c9_: int = const 3; | ||
v10_: int = div v6_ c9_; | ||
v11_: int = div v0 v10_; | ||
v12_: int = id v11_; | ||
print v12_; | ||
ret; | ||
jmp .b13_; | ||
.b8_: | ||
c14_: int = const 5; | ||
v15_: int = div v0 c14_; | ||
v16_: int = div v6_ v15_; | ||
v12_: int = id v16_; | ||
print v12_; | ||
ret; | ||
.b13_: | ||
} |