mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add inlining for old optimizer.
This commit is contained in:
@@ -66,12 +66,12 @@ sub_0: assembly {
|
||||
dup1
|
||||
0x2e1fb2bc
|
||||
eq
|
||||
tag_3
|
||||
tag_4
|
||||
jumpi
|
||||
dup1
|
||||
0x4753a67d
|
||||
eq
|
||||
tag_3
|
||||
tag_4
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
@@ -79,11 +79,11 @@ sub_0: assembly {
|
||||
revert
|
||||
/* "optimizer_BlockDeDuplicator/input.sol":138:174 function f() public { true ? 1 : 3;} */
|
||||
tag_3:
|
||||
tag_6
|
||||
tag_7
|
||||
jump // in
|
||||
tag_6:
|
||||
stop
|
||||
/* "optimizer_BlockDeDuplicator/input.sol":108:133 function fun_() public {} */
|
||||
tag_4:
|
||||
jump(tag_3)
|
||||
/* "optimizer_BlockDeDuplicator/input.sol":138:174 function f() public { true ? 1 : 3;} */
|
||||
tag_7:
|
||||
jump // out
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
function unsafe_add(uint x, uint y) pure returns (uint)
|
||||
{
|
||||
unchecked {
|
||||
return x + y;
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
for(uint x = 0; x < 10; x = unsafe_add(x, unsafe_add(x, 1)))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
======= optimizer_inliner_add/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_add/input.sol":165:305 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_add/input.sol":165:305 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x26121ff0
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_add/input.sol":182:303 function f() public pure {... */
|
||||
tag_3:
|
||||
tag_4
|
||||
tag_5
|
||||
jump // in
|
||||
tag_4:
|
||||
stop
|
||||
tag_5:
|
||||
/* "optimizer_inliner_add/input.sol":221:227 uint x */
|
||||
0x00
|
||||
/* "optimizer_inliner_add/input.sol":217:297 for(uint x = 0; x < 10; x = unsafe_add(x, unsafe_add(x, 1)))... */
|
||||
tag_7:
|
||||
/* "optimizer_inliner_add/input.sol":237:239 10 */
|
||||
0x0a
|
||||
/* "optimizer_inliner_add/input.sol":233:234 x */
|
||||
dup2
|
||||
/* "optimizer_inliner_add/input.sol":233:239 x < 10 */
|
||||
lt
|
||||
/* "optimizer_inliner_add/input.sol":217:297 for(uint x = 0; x < 10; x = unsafe_add(x, unsafe_add(x, 1)))... */
|
||||
iszero
|
||||
tag_8
|
||||
jumpi
|
||||
/* "optimizer_inliner_add/input.sol":149:154 x + y */
|
||||
dup1
|
||||
add
|
||||
/* "optimizer_inliner_add/input.sol":273:274 1 */
|
||||
0x01
|
||||
/* "optimizer_inliner_add/input.sol":149:154 x + y */
|
||||
add
|
||||
/* "optimizer_inliner_add/input.sol":217:297 for(uint x = 0; x < 10; x = unsafe_add(x, unsafe_add(x, 1)))... */
|
||||
jump(tag_7)
|
||||
tag_8:
|
||||
pop
|
||||
/* "optimizer_inliner_add/input.sol":182:303 function f() public pure {... */
|
||||
jump // out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
contract C {
|
||||
uint x;
|
||||
constructor() { x = a(); }
|
||||
function a() public pure returns (uint) { return f(); } // this should be inlined
|
||||
function f() internal pure returns (uint) { return 6; }
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
======= optimizer_inliner_call_from_constructor/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":60:263 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":89:115 constructor() { x = a(); } */
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":257:258 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":105:106 x */
|
||||
0x00
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":105:112 x = a() */
|
||||
sstore
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":60:263 contract C {... */
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":60:263 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x0dbe671f
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":120:175 function a() public pure returns (uint) { return f(); } */
|
||||
tag_3:
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":257:258 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":120:175 function a() public pure returns (uint) { return f(); } */
|
||||
mload(0x40)
|
||||
/* "#utility.yul":160:185 */
|
||||
swap1
|
||||
dup2
|
||||
mstore
|
||||
/* "#utility.yul":148:150 */
|
||||
0x20
|
||||
/* "#utility.yul":133:151 */
|
||||
add
|
||||
/* "optimizer_inliner_call_from_constructor/input.sol":120:175 function a() public pure returns (uint) { return f(); } */
|
||||
mload(0x40)
|
||||
dup1
|
||||
swap2
|
||||
sub
|
||||
swap1
|
||||
return
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
contract C {
|
||||
function() internal view returns (uint) x;
|
||||
|
||||
function g() public { x = f; }
|
||||
function a() public pure returns (uint) { return f(); } // this should be inlined
|
||||
function h() public view returns (uint) { return x() + 1; }
|
||||
function f() internal pure returns (uint) { return 6; }
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
|
||||
======= optimizer_inliner_dynamic_reference/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":60:367 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":60:367 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x0dbe671f
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
dup1
|
||||
0xb8c9d365
|
||||
eq
|
||||
tag_4
|
||||
jumpi
|
||||
dup1
|
||||
0xe2179b8e
|
||||
eq
|
||||
tag_5
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":160:215 function a() public pure returns (uint) { return f(); } */
|
||||
tag_3:
|
||||
tag_6
|
||||
tag_7
|
||||
jump // in
|
||||
tag_6:
|
||||
mload(0x40)
|
||||
/* "#utility.yul":160:185 */
|
||||
swap1
|
||||
dup2
|
||||
mstore
|
||||
/* "#utility.yul":148:150 */
|
||||
0x20
|
||||
/* "#utility.yul":133:151 */
|
||||
add
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":160:215 function a() public pure returns (uint) { return f(); } */
|
||||
mload(0x40)
|
||||
dup1
|
||||
swap2
|
||||
sub
|
||||
swap1
|
||||
return
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":246:305 function h() public view returns (uint) { return x() + 1; } */
|
||||
tag_4:
|
||||
tag_6
|
||||
tag_11
|
||||
jump // in
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":125:155 function g() public { x = f; } */
|
||||
tag_5:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":147:148 x */
|
||||
0x00
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":147:152 x = f */
|
||||
dup1
|
||||
sload
|
||||
not(0xffffffffffffffff)
|
||||
and
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":151:152 f */
|
||||
tag_17
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":147:152 x = f */
|
||||
or
|
||||
swap1
|
||||
sstore
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":125:155 function g() public { x = f; } */
|
||||
stop
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":160:215 function a() public pure returns (uint) { return f(); } */
|
||||
tag_7:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":194:198 uint */
|
||||
0x00
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":361:362 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":209:212 f() */
|
||||
tag_16:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":202:212 return f() */
|
||||
swap1
|
||||
pop
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":160:215 function a() public pure returns (uint) { return f(); } */
|
||||
swap1
|
||||
jump // out
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":246:305 function h() public view returns (uint) { return x() + 1; } */
|
||||
tag_11:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":280:284 uint */
|
||||
0x00
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":295:296 x */
|
||||
dup1
|
||||
sload
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":295:298 x() */
|
||||
tag_19
|
||||
swap1
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":295:296 x */
|
||||
dup1
|
||||
iszero
|
||||
tag_20
|
||||
mul
|
||||
or
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":295:298 x() */
|
||||
0xffffffff
|
||||
and
|
||||
jump // in
|
||||
tag_19:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":295:302 x() + 1 */
|
||||
tag_16
|
||||
swap1
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":301:302 1 */
|
||||
0x01
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":295:302 x() + 1 */
|
||||
tag_22
|
||||
jump // in
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":310:365 function f() internal pure returns (uint) { return 6; } */
|
||||
tag_17:
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":361:362 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_dynamic_reference/input.sol":310:365 function f() internal pure returns (uint) { return 6; } */
|
||||
swap1
|
||||
jump // out
|
||||
tag_20:
|
||||
mstore(0x00, shl(0xe0, 0x4e487b71))
|
||||
mstore(0x04, 0x51)
|
||||
revert(0x00, 0x24)
|
||||
/* "#utility.yul":196:425 */
|
||||
tag_22:
|
||||
0x00
|
||||
/* "#utility.yul":267:268 */
|
||||
dup3
|
||||
/* "#utility.yul":263:269 */
|
||||
not
|
||||
/* "#utility.yul":260:261 */
|
||||
dup3
|
||||
/* "#utility.yul":257:270 */
|
||||
gt
|
||||
/* "#utility.yul":254:256 */
|
||||
iszero
|
||||
tag_28
|
||||
jumpi
|
||||
shl(0xe0, 0x4e487b71)
|
||||
/* "#utility.yul":293:326 */
|
||||
dup2
|
||||
mstore
|
||||
/* "#utility.yul":349:353 */
|
||||
0x11
|
||||
/* "#utility.yul":346:347 */
|
||||
0x04
|
||||
/* "#utility.yul":339:354 */
|
||||
mstore
|
||||
/* "#utility.yul":379:383 */
|
||||
0x24
|
||||
/* "#utility.yul":300:303 */
|
||||
dup2
|
||||
/* "#utility.yul":367:384 */
|
||||
revert
|
||||
/* "#utility.yul":254:256 */
|
||||
tag_28:
|
||||
pop
|
||||
/* "#utility.yul":410:419 */
|
||||
add
|
||||
swap1
|
||||
/* "#utility.yul":244:425 */
|
||||
jump // out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
contract C {
|
||||
constructor() { x = f; }
|
||||
function() internal view returns (uint) x;
|
||||
|
||||
function a() public pure returns (uint) { return f(); } // this should be inlined
|
||||
function h() public view returns (uint) { return x() + 1; }
|
||||
function f() internal pure returns (uint) { return 6; }
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
|
||||
======= optimizer_inliner_dynamic_reference_constructor/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":60:361 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":77:101 constructor() { x = f; } */
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":93:94 x */
|
||||
0x00
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":93:98 x = f */
|
||||
dup1
|
||||
sload
|
||||
not(sub(shl(0x40, 0x01), 0x01))
|
||||
and
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":97:98 f */
|
||||
or(tag_0_12, shl(0x20, tag_4))
|
||||
sub(shl(0x40, 0x01), 0x01)
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":93:98 x = f */
|
||||
and
|
||||
or
|
||||
swap1
|
||||
sstore
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":60:361 contract C {... */
|
||||
jump(tag_5)
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":304:359 function f() internal pure returns (uint) { return 6; } */
|
||||
tag_4:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":355:356 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":304:359 function f() internal pure returns (uint) { return 6; } */
|
||||
swap1
|
||||
jump // out
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":60:361 contract C {... */
|
||||
tag_5:
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":60:361 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x0dbe671f
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
dup1
|
||||
0xb8c9d365
|
||||
eq
|
||||
tag_4
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":154:209 function a() public pure returns (uint) { return f(); } */
|
||||
tag_3:
|
||||
tag_5
|
||||
tag_6
|
||||
jump // in
|
||||
tag_5:
|
||||
mload(0x40)
|
||||
/* "#utility.yul":160:185 */
|
||||
swap1
|
||||
dup2
|
||||
mstore
|
||||
/* "#utility.yul":148:150 */
|
||||
0x20
|
||||
/* "#utility.yul":133:151 */
|
||||
add
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":154:209 function a() public pure returns (uint) { return f(); } */
|
||||
mload(0x40)
|
||||
dup1
|
||||
swap2
|
||||
sub
|
||||
swap1
|
||||
return
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":240:299 function h() public view returns (uint) { return x() + 1; } */
|
||||
tag_4:
|
||||
tag_5
|
||||
tag_10
|
||||
jump // in
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":154:209 function a() public pure returns (uint) { return f(); } */
|
||||
tag_6:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":188:192 uint */
|
||||
0x00
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":355:356 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":203:206 f() */
|
||||
tag_14:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":196:206 return f() */
|
||||
swap1
|
||||
pop
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":154:209 function a() public pure returns (uint) { return f(); } */
|
||||
swap1
|
||||
jump // out
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":240:299 function h() public view returns (uint) { return x() + 1; } */
|
||||
tag_10:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":274:278 uint */
|
||||
0x00
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":289:290 x */
|
||||
dup1
|
||||
sload
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":289:292 x() */
|
||||
tag_16
|
||||
swap1
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":289:290 x */
|
||||
dup1
|
||||
iszero
|
||||
tag_17
|
||||
mul
|
||||
or
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":289:292 x() */
|
||||
0xffffffff
|
||||
and
|
||||
jump // in
|
||||
tag_16:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":289:296 x() + 1 */
|
||||
tag_14
|
||||
swap1
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":295:296 1 */
|
||||
0x01
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":289:296 x() + 1 */
|
||||
tag_19
|
||||
jump // in
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":304:359 function f() internal pure returns (uint) { return 6; } */
|
||||
tag_12:
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":355:356 6 */
|
||||
0x06
|
||||
/* "optimizer_inliner_dynamic_reference_constructor/input.sol":304:359 function f() internal pure returns (uint) { return 6; } */
|
||||
swap1
|
||||
jump // out
|
||||
tag_17:
|
||||
mstore(0x00, shl(0xe0, 0x4e487b71))
|
||||
mstore(0x04, 0x51)
|
||||
revert(0x00, 0x24)
|
||||
/* "#utility.yul":196:425 */
|
||||
tag_19:
|
||||
0x00
|
||||
/* "#utility.yul":267:268 */
|
||||
dup3
|
||||
/* "#utility.yul":263:269 */
|
||||
not
|
||||
/* "#utility.yul":260:261 */
|
||||
dup3
|
||||
/* "#utility.yul":257:270 */
|
||||
gt
|
||||
/* "#utility.yul":254:256 */
|
||||
iszero
|
||||
tag_24
|
||||
jumpi
|
||||
shl(0xe0, 0x4e487b71)
|
||||
/* "#utility.yul":293:326 */
|
||||
dup2
|
||||
mstore
|
||||
/* "#utility.yul":349:353 */
|
||||
0x11
|
||||
/* "#utility.yul":346:347 */
|
||||
0x04
|
||||
/* "#utility.yul":339:354 */
|
||||
mstore
|
||||
/* "#utility.yul":379:383 */
|
||||
0x24
|
||||
/* "#utility.yul":300:303 */
|
||||
dup2
|
||||
/* "#utility.yul":367:384 */
|
||||
revert
|
||||
/* "#utility.yul":254:256 */
|
||||
tag_24:
|
||||
pop
|
||||
/* "#utility.yul":410:419 */
|
||||
add
|
||||
swap1
|
||||
/* "#utility.yul":244:425 */
|
||||
jump // out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
function unsafe_inc(uint x) pure returns (uint)
|
||||
{
|
||||
unchecked {
|
||||
return x + 1;
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
for(uint x = 0; x < 10; x = unsafe_inc(x))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
|
||||
======= optimizer_inliner_inc/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_inc/input.sol":157:279 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_inc/input.sol":157:279 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x26121ff0
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_inc/input.sol":174:277 function f() public pure {... */
|
||||
tag_3:
|
||||
tag_4
|
||||
tag_5
|
||||
jump // in
|
||||
tag_4:
|
||||
stop
|
||||
tag_5:
|
||||
/* "optimizer_inliner_inc/input.sol":213:219 uint x */
|
||||
0x00
|
||||
/* "optimizer_inliner_inc/input.sol":209:271 for(uint x = 0; x < 10; x = unsafe_inc(x))... */
|
||||
tag_7:
|
||||
/* "optimizer_inliner_inc/input.sol":229:231 10 */
|
||||
0x0a
|
||||
/* "optimizer_inliner_inc/input.sol":225:226 x */
|
||||
dup2
|
||||
/* "optimizer_inliner_inc/input.sol":225:231 x < 10 */
|
||||
lt
|
||||
/* "optimizer_inliner_inc/input.sol":209:271 for(uint x = 0; x < 10; x = unsafe_inc(x))... */
|
||||
iszero
|
||||
tag_8
|
||||
jumpi
|
||||
/* "optimizer_inliner_inc/input.sol":145:146 1 */
|
||||
0x01
|
||||
/* "optimizer_inliner_inc/input.sol":141:146 x + 1 */
|
||||
add
|
||||
/* "optimizer_inliner_inc/input.sol":209:271 for(uint x = 0; x < 10; x = unsafe_inc(x))... */
|
||||
jump(tag_7)
|
||||
tag_8:
|
||||
pop
|
||||
/* "optimizer_inliner_inc/input.sol":174:277 function f() public pure {... */
|
||||
jump // out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
function test(uint x) pure returns (uint, uint)
|
||||
{
|
||||
unchecked {
|
||||
return (x + 1, x);
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
for((uint x, uint y) = (0, 1); x < 10; (x, y) = test(x))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
|
||||
======= optimizer_inliner_multireturn/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_inliner_multireturn/input.sol":162:298 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
0x00
|
||||
codecopy
|
||||
0x00
|
||||
return
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_inliner_multireturn/input.sol":162:298 contract C {... */
|
||||
mstore(0x40, 0x80)
|
||||
callvalue
|
||||
dup1
|
||||
iszero
|
||||
tag_1
|
||||
jumpi
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
tag_1:
|
||||
pop
|
||||
jumpi(tag_2, lt(calldatasize, 0x04))
|
||||
shr(0xe0, calldataload(0x00))
|
||||
dup1
|
||||
0x26121ff0
|
||||
eq
|
||||
tag_3
|
||||
jumpi
|
||||
tag_2:
|
||||
0x00
|
||||
dup1
|
||||
revert
|
||||
/* "optimizer_inliner_multireturn/input.sol":179:296 function f() public pure {... */
|
||||
tag_3:
|
||||
tag_4
|
||||
tag_5
|
||||
jump // in
|
||||
tag_4:
|
||||
stop
|
||||
tag_5:
|
||||
/* "optimizer_inliner_multireturn/input.sol":219:225 uint x */
|
||||
0x00
|
||||
/* "optimizer_inliner_multireturn/input.sol":241:242 1 */
|
||||
0x01
|
||||
/* "optimizer_inliner_multireturn/input.sol":214:290 for((uint x, uint y) = (0, 1); x < 10; (x, y) = test(x))... */
|
||||
tag_7:
|
||||
/* "optimizer_inliner_multireturn/input.sol":249:251 10 */
|
||||
0x0a
|
||||
/* "optimizer_inliner_multireturn/input.sol":245:246 x */
|
||||
dup3
|
||||
/* "optimizer_inliner_multireturn/input.sol":245:251 x < 10 */
|
||||
lt
|
||||
/* "optimizer_inliner_multireturn/input.sol":214:290 for((uint x, uint y) = (0, 1); x < 10; (x, y) = test(x))... */
|
||||
iszero
|
||||
tag_8
|
||||
jumpi
|
||||
pop
|
||||
/* "optimizer_inliner_multireturn/input.sol":146:147 1 */
|
||||
0x01
|
||||
/* "optimizer_inliner_multireturn/input.sol":142:147 x + 1 */
|
||||
dup2
|
||||
add
|
||||
swap1
|
||||
/* "optimizer_inliner_multireturn/input.sol":214:290 for((uint x, uint y) = (0, 1); x < 10; (x, y) = test(x))... */
|
||||
jump(tag_7)
|
||||
tag_8:
|
||||
pop
|
||||
pop
|
||||
/* "optimizer_inliner_multireturn/input.sol":179:296 function f() public pure {... */
|
||||
jump // out
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <libevmasm/CommonSubexpressionEliminator.h>
|
||||
#include <libevmasm/PeepholeOptimiser.h>
|
||||
#include <libevmasm/Inliner.h>
|
||||
#include <libevmasm/JumpdestRemover.h>
|
||||
#include <libevmasm/ControlFlowGraph.h>
|
||||
#include <libevmasm/BlockDeduplicator.h>
|
||||
@@ -1233,7 +1234,17 @@ BOOST_AUTO_TEST_CASE(jumpdest_removal_subassemblies)
|
||||
main.append(t1.toSubAssemblyTag(subId));
|
||||
main.append(u256(8));
|
||||
|
||||
main.optimise(true, solidity::test::CommonOptions::get().evmVersion(), false, 200);
|
||||
Assembly::OptimiserSettings settings;
|
||||
settings.isCreation = false;
|
||||
settings.runInliner = false;
|
||||
settings.runJumpdestRemover = true;
|
||||
settings.runPeephole = true;
|
||||
settings.runDeduplicate = true;
|
||||
settings.runCSE = true;
|
||||
settings.runConstantOptimiser = true;
|
||||
settings.evmVersion = solidity::test::CommonOptions::get().evmVersion();
|
||||
settings.expectedExecutionsPerDeployment = 200;
|
||||
main.optimise(settings);
|
||||
|
||||
AssemblyItems expectationMain{
|
||||
AssemblyItem(PushSubSize, 0),
|
||||
@@ -1467,6 +1478,165 @@ BOOST_AUTO_TEST_CASE(cse_replace_too_large_shift)
|
||||
});
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inliner)
|
||||
{
|
||||
AssemblyItem jumpInto{Instruction::JUMP};
|
||||
jumpInto.setJumpType(AssemblyItem::JumpType::IntoFunction);
|
||||
AssemblyItem jumpOutOf{Instruction::JUMP};
|
||||
jumpOutOf.setJumpType(AssemblyItem::JumpType::OutOfFunction);
|
||||
AssemblyItems items{
|
||||
AssemblyItem(PushTag, 1),
|
||||
AssemblyItem(PushTag, 2),
|
||||
jumpInto,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
Instruction::CALLVALUE,
|
||||
Instruction::SWAP1,
|
||||
jumpOutOf,
|
||||
};
|
||||
AssemblyItems expectation{
|
||||
AssemblyItem(PushTag, 1),
|
||||
Instruction::CALLVALUE,
|
||||
Instruction::SWAP1,
|
||||
Instruction::JUMP,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
Instruction::CALLVALUE,
|
||||
Instruction::SWAP1,
|
||||
jumpOutOf,
|
||||
};
|
||||
Inliner{items, {}, 200, false, {}}.optimise();
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
items.begin(), items.end(),
|
||||
expectation.begin(), expectation.end()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inliner_no_inline_type)
|
||||
{
|
||||
// Will not inline due to jump types.
|
||||
AssemblyItems items{
|
||||
AssemblyItem(PushTag, 1),
|
||||
AssemblyItem(PushTag, 2),
|
||||
Instruction::JUMP,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
Instruction::CALLVALUE,
|
||||
Instruction::SWAP1,
|
||||
Instruction::JUMP,
|
||||
};
|
||||
Inliner{items, {}, 200, false, {}}.optimise();
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
items.begin(), items.end(),
|
||||
items.begin(), items.end()
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inliner_no_inline)
|
||||
{
|
||||
AssemblyItems items{
|
||||
AssemblyItem(PushTag, 1),
|
||||
Instruction::JUMP,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::CALLVALUE,
|
||||
Instruction::JUMPI,
|
||||
Instruction::JUMP,
|
||||
};
|
||||
AssemblyItems expectation{
|
||||
AssemblyItem(PushTag, 1),
|
||||
Instruction::JUMP,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::CALLVALUE,
|
||||
Instruction::JUMPI,
|
||||
Instruction::JUMP,
|
||||
};
|
||||
Inliner{items, {}, 200, false, {}}.optimise();
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
items.begin(), items.end(),
|
||||
expectation.begin(), expectation.end()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inliner_single_jump)
|
||||
{
|
||||
AssemblyItem jumpInto{Instruction::JUMP};
|
||||
jumpInto.setJumpType(AssemblyItem::JumpType::IntoFunction);
|
||||
AssemblyItem jumpOutOf{Instruction::JUMP};
|
||||
jumpOutOf.setJumpType(AssemblyItem::JumpType::OutOfFunction);
|
||||
AssemblyItems items{
|
||||
AssemblyItem(PushTag, 1),
|
||||
AssemblyItem(PushTag, 2),
|
||||
jumpInto,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
jumpOutOf,
|
||||
};
|
||||
AssemblyItems expectation{
|
||||
AssemblyItem(PushTag, 1),
|
||||
Instruction::JUMP,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
jumpOutOf,
|
||||
};
|
||||
Inliner{items, {}, 200, false, {}}.optimise();
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
items.begin(), items.end(),
|
||||
expectation.begin(), expectation.end()
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inliner_end_of_bytecode)
|
||||
{
|
||||
AssemblyItem jumpInto{Instruction::JUMP};
|
||||
jumpInto.setJumpType(AssemblyItem::JumpType::IntoFunction);
|
||||
// Cannot inline, since the block at Tag_2 does not end in a jump.
|
||||
AssemblyItems items{
|
||||
AssemblyItem(PushTag, 1),
|
||||
AssemblyItem(PushTag, 2),
|
||||
jumpInto,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
};
|
||||
Inliner{items, {}, 200, false, {}}.optimise();
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
items.begin(), items.end(),
|
||||
items.begin(), items.end()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inliner_cse_break)
|
||||
{
|
||||
AssemblyItem jumpInto{Instruction::JUMP};
|
||||
jumpInto.setJumpType(AssemblyItem::JumpType::IntoFunction);
|
||||
AssemblyItem jumpOutOf{Instruction::JUMP};
|
||||
jumpOutOf.setJumpType(AssemblyItem::JumpType::OutOfFunction);
|
||||
// Could be inlined, but we only consider non-CSE-breaking blocks ending in JUMP so far.
|
||||
AssemblyItems items{
|
||||
AssemblyItem(PushTag, 1),
|
||||
AssemblyItem(PushTag, 2),
|
||||
jumpInto,
|
||||
AssemblyItem(Tag, 1),
|
||||
Instruction::STOP,
|
||||
AssemblyItem(Tag, 2),
|
||||
Instruction::STOP, // CSE breaking instruction
|
||||
jumpOutOf
|
||||
};
|
||||
Inliner{items, {}, 200, false, {}}.optimise();
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
items.begin(), items.end(),
|
||||
items.begin(), items.end()
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
} // end namespaces
|
||||
|
||||
@@ -174,9 +174,9 @@ BOOST_AUTO_TEST_CASE(location_test)
|
||||
if (solidity::test::CommonOptions::get().optimize)
|
||||
locations =
|
||||
vector<SourceLocation>(31, SourceLocation{23, 103, sourceCode}) +
|
||||
vector<SourceLocation>(21, SourceLocation{41, 100, sourceCode}) +
|
||||
vector<SourceLocation>(1, SourceLocation{41, 100, sourceCode}) +
|
||||
vector<SourceLocation>(1, SourceLocation{93, 95, sourceCode}) +
|
||||
vector<SourceLocation>(2, SourceLocation{41, 100, sourceCode});
|
||||
vector<SourceLocation>(15, SourceLocation{41, 100, sourceCode});
|
||||
else
|
||||
locations =
|
||||
vector<SourceLocation>(hasShifts ? 31 : 32, SourceLocation{23, 103, sourceCode}) +
|
||||
@@ -209,7 +209,10 @@ BOOST_AUTO_TEST_CASE(jump_type)
|
||||
if (item.getJumpType() != AssemblyItem::JumpType::Ordinary)
|
||||
jumpTypes += item.getJumpTypeAsString() + "\n";
|
||||
|
||||
BOOST_CHECK_EQUAL(jumpTypes, "[in]\n[out]\n[in]\n[out]\n");
|
||||
if (solidity::test::CommonOptions::get().optimize)
|
||||
BOOST_CHECK_EQUAL(jumpTypes, "[in]\n[out]\n[in]\n[out]\n");
|
||||
else
|
||||
BOOST_CHECK_EQUAL(jumpTypes, "[in]\n[out]\n[in]\n[out]\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
||||
if (CommonOptions::get().useABIEncoderV1)
|
||||
CHECK_DEPLOY_GAS(133045, 129731, evmVersion);
|
||||
else
|
||||
CHECK_DEPLOY_GAS(155553, 135201, evmVersion);
|
||||
CHECK_DEPLOY_GAS(155553, 132103, evmVersion);
|
||||
}
|
||||
// This is only correct on >=Constantinople.
|
||||
else if (!CommonOptions::get().useABIEncoderV1)
|
||||
@@ -110,9 +110,9 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
||||
{
|
||||
// Costs with 0 are cases which cannot be triggered in tests.
|
||||
if (evmVersion < EVMVersion::istanbul())
|
||||
CHECK_DEPLOY_GAS(0, 122869, evmVersion);
|
||||
CHECK_DEPLOY_GAS(0, 120189, evmVersion);
|
||||
else
|
||||
CHECK_DEPLOY_GAS(0, 110701, evmVersion);
|
||||
CHECK_DEPLOY_GAS(0, 108541, evmVersion);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -131,16 +131,16 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
||||
{
|
||||
callContractFunction("f()");
|
||||
if (evmVersion == EVMVersion::byzantium())
|
||||
CHECK_GAS(21741, 21555, 20);
|
||||
CHECK_GAS(21741, 21522, 20);
|
||||
// This is only correct on >=Constantinople.
|
||||
else if (!CommonOptions::get().useABIEncoderV1)
|
||||
{
|
||||
if (CommonOptions::get().optimize)
|
||||
{
|
||||
if (evmVersion < EVMVersion::istanbul())
|
||||
CHECK_GAS(0, 21567, 20);
|
||||
CHECK_GAS(0, 21526, 20);
|
||||
else
|
||||
CHECK_GAS(0, 21351, 20);
|
||||
CHECK_GAS(0, 21318, 20);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -170,8 +170,8 @@ BOOST_AUTO_TEST_CASE(branches)
|
||||
}
|
||||
}
|
||||
)";
|
||||
testCreationTimeGas(sourceCode);
|
||||
testRunTimeGas("f(uint256)", vector<bytes>{encodeArgs(2), encodeArgs(8)});
|
||||
testCreationTimeGas(sourceCode, 1);
|
||||
testRunTimeGas("f(uint256)", vector<bytes>{encodeArgs(2), encodeArgs(8)}, 1);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(function_calls)
|
||||
|
||||
@@ -1230,7 +1230,7 @@ BOOST_AUTO_TEST_CASE(optimizer_settings_details_different)
|
||||
);
|
||||
BOOST_CHECK(optimizer["details"]["yulDetails"]["stackAllocation"].asBool() == true);
|
||||
BOOST_CHECK(optimizer["details"]["yulDetails"]["optimizerSteps"].asString() == OptimiserSettings::DefaultYulOptimiserSteps);
|
||||
BOOST_CHECK_EQUAL(optimizer["details"].getMemberNames().size(), 8);
|
||||
BOOST_CHECK_EQUAL(optimizer["details"].getMemberNames().size(), 9);
|
||||
BOOST_CHECK(optimizer["runs"].asUInt() == 600);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ contract C {
|
||||
// optimize-yul: true
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 588800
|
||||
// codeDepositCost: 583400
|
||||
// executionCost: 619
|
||||
// totalCost: 589419
|
||||
// totalCost: 584019
|
||||
// external:
|
||||
// a(): 1029
|
||||
// b(uint256): 2084
|
||||
// f1(uint256): 351
|
||||
// a(): 985
|
||||
// b(uint256): 2052
|
||||
// f1(uint256): 307
|
||||
// f2(uint256[],string[],uint16,address): infinite
|
||||
// f3(uint16[],string[],uint16,address): infinite
|
||||
// f4(uint32[],string[12],bytes[2][],address): infinite
|
||||
|
||||
@@ -27,29 +27,29 @@ contract Large {
|
||||
// optimize-runs: 2
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 270600
|
||||
// executionCost: 312
|
||||
// totalCost: 270912
|
||||
// codeDepositCost: 267000
|
||||
// executionCost: 306
|
||||
// totalCost: 267306
|
||||
// external:
|
||||
// a(): 1028
|
||||
// b(uint256): 2370
|
||||
// f0(uint256): 399
|
||||
// f1(uint256): 41539
|
||||
// f2(uint256): 21605
|
||||
// f3(uint256): 21693
|
||||
// f4(uint256): 21671
|
||||
// f5(uint256): 21649
|
||||
// f6(uint256): 21561
|
||||
// f7(uint256): 21341
|
||||
// f8(uint256): 21473
|
||||
// f9(uint256): 21495
|
||||
// g0(uint256): 639
|
||||
// g1(uint256): 41251
|
||||
// g2(uint256): 21339
|
||||
// g3(uint256): 21427
|
||||
// g4(uint256): 21405
|
||||
// g5(uint256): 21493
|
||||
// g6(uint256): 21273
|
||||
// g7(uint256): 21383
|
||||
// g8(uint256): 21361
|
||||
// g9(uint256): 21207
|
||||
// a(): 983
|
||||
// b(uint256): 2337
|
||||
// f0(uint256): 366
|
||||
// f1(uint256): 41506
|
||||
// f2(uint256): 21572
|
||||
// f3(uint256): 21660
|
||||
// f4(uint256): 21638
|
||||
// f5(uint256): 21616
|
||||
// f6(uint256): 21528
|
||||
// f7(uint256): 21308
|
||||
// f8(uint256): 21440
|
||||
// f9(uint256): 21462
|
||||
// g0(uint256): 606
|
||||
// g1(uint256): 41218
|
||||
// g2(uint256): 21306
|
||||
// g3(uint256): 21394
|
||||
// g4(uint256): 21372
|
||||
// g5(uint256): 21460
|
||||
// g6(uint256): 21240
|
||||
// g7(uint256): 21350
|
||||
// g8(uint256): 21328
|
||||
// g9(uint256): 21174
|
||||
|
||||
@@ -14,16 +14,16 @@ contract Medium {
|
||||
// optimize-runs: 2
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 161000
|
||||
// executionCost: 208
|
||||
// totalCost: 161208
|
||||
// codeDepositCost: 157400
|
||||
// executionCost: 202
|
||||
// totalCost: 157602
|
||||
// external:
|
||||
// a(): 1028
|
||||
// b(uint256): 2128
|
||||
// f1(uint256): 41319
|
||||
// f2(uint256): 21363
|
||||
// f3(uint256): 21407
|
||||
// g0(uint256): 397
|
||||
// g7(uint256): 21273
|
||||
// g8(uint256): 21251
|
||||
// g9(uint256): 21207
|
||||
// a(): 983
|
||||
// b(uint256): 2095
|
||||
// f1(uint256): 41286
|
||||
// f2(uint256): 21330
|
||||
// f3(uint256): 21374
|
||||
// g0(uint256): 364
|
||||
// g7(uint256): 21240
|
||||
// g8(uint256): 21218
|
||||
// g9(uint256): 21174
|
||||
|
||||
@@ -9,11 +9,11 @@ contract Small {
|
||||
// optimize-runs: 2
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 76200
|
||||
// codeDepositCost: 72600
|
||||
// executionCost: 123
|
||||
// totalCost: 76323
|
||||
// totalCost: 72723
|
||||
// external:
|
||||
// fallback: 118
|
||||
// a(): 1006
|
||||
// b(uint256): 2018
|
||||
// f1(uint256): 41253
|
||||
// a(): 961
|
||||
// b(uint256): 1985
|
||||
// f1(uint256): 41220
|
||||
|
||||
@@ -19,11 +19,11 @@ contract C {
|
||||
// optimize-yul: true
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 53200
|
||||
// executionCost: 105
|
||||
// totalCost: 53305
|
||||
// codeDepositCost: 47800
|
||||
// executionCost: 99
|
||||
// totalCost: 47899
|
||||
// external:
|
||||
// exp_neg_one(uint256): 1962
|
||||
// exp_one(uint256): 1915
|
||||
// exp_two(uint256): 1893
|
||||
// exp_zero(uint256): 1937
|
||||
// exp_neg_one(uint256): 1917
|
||||
// exp_one(uint256): 1870
|
||||
// exp_two(uint256): 1848
|
||||
// exp_zero(uint256): 1892
|
||||
|
||||
Reference in New Issue
Block a user