-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more tests. Updated chromosome. Remove unused header
- Loading branch information
Showing
5 changed files
with
64 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
test/libyul/yulOptimizerTests/equalStoreEliminator/branching.yul
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,23 @@ | ||
{ | ||
let a := calldataload(0) | ||
let b := 20 | ||
sstore(a, b) | ||
if calldataload(32) { | ||
sstore(a, b) | ||
pop(staticcall(0, 0, 0, 0, 0, 0)) | ||
sstore(a, b) | ||
} | ||
sstore(a, b) | ||
} | ||
// ---- | ||
// step: equalStoreEliminator | ||
// | ||
// { | ||
// let a := calldataload(0) | ||
// let b := 20 | ||
// sstore(a, b) | ||
// if calldataload(32) | ||
// { | ||
// pop(staticcall(0, 0, 0, 0, 0, 0)) | ||
// } | ||
// } |
22 changes: 22 additions & 0 deletions
22
test/libyul/yulOptimizerTests/equalStoreEliminator/indirect_inferrence.yul
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,22 @@ | ||
{ | ||
let x := calldataload(0) | ||
let y := sload(x) | ||
// both of these can be removed | ||
sstore(x, y) | ||
sstore(x, y) | ||
|
||
let a := x | ||
let b := mload(a) | ||
// both of these can be removed | ||
mstore(a, b) | ||
mstore(a, b) | ||
} | ||
// ---- | ||
// step: equalStoreEliminator | ||
// | ||
// { | ||
// let x := calldataload(0) | ||
// let y := sload(x) | ||
// let a := x | ||
// let b := mload(a) | ||
// } |
18 changes: 18 additions & 0 deletions
18
test/libyul/yulOptimizerTests/equalStoreEliminator/value_change.yul
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,18 @@ | ||
{ | ||
let x := calldataload(0) | ||
let y := calldataload(32) | ||
sstore(x, y) | ||
y := calldataload(64) | ||
// cannot be removed | ||
sstore(x, y) | ||
} | ||
// ---- | ||
// step: equalStoreEliminator | ||
// | ||
// { | ||
// let x := calldataload(0) | ||
// let y := calldataload(32) | ||
// sstore(x, y) | ||
// y := calldataload(64) | ||
// sstore(x, y) | ||
// } |
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