yul: Add new optimizer rules for create and create2 builtins

This commit is contained in:
Bhargava Shastry
2019-09-09 17:06:56 +02:00
parent 96b6b45658
commit 09fa31ccc5
5 changed files with 92 additions and 19 deletions
@@ -0,0 +1,12 @@
{
let a := and(create2(0, 0, 0x20, 0), 0xffffffffffffffffffffffffffffffffffffffff)
let b := and(0xffffffffffffffffffffffffffffffffffffffff, create2(0, 0, 0x20, 0))
}
// ====
// step: expressionSimplifier
// EVMVersion: >=constantinople
// ----
// {
// let a := create2(0, 0, 0x20, 0)
// let b := create2(0, 0, 0x20, 0)
// }
@@ -0,0 +1,11 @@
{
let a := and(create(0, 0, 0x20), 0xffffffffffffffffffffffffffffffffffffffff)
let b := and(0xffffffffffffffffffffffffffffffffffffffff, create(0, 0, 0x20))
}
// ====
// step: expressionSimplifier
// ----
// {
// let a := create(0, 0, 0x20)
// let b := create(0, 0, 0x20)
// }