mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move AND with constant inside OR.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
--optimize --asm --metadata-hash none
|
||||
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
|
||||
contract OptimizeFullSlotWrite {
|
||||
uint64[4] nums;
|
||||
function f() public {
|
||||
nums[0] = 11111;
|
||||
nums[1] = 22222;
|
||||
nums[2] = 33333;
|
||||
nums[3] = 44444;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
======= optimize_full_storage_write/input.sol:OptimizeFullSlotWrite =======
|
||||
EVM assembly:
|
||||
/* "optimize_full_storage_write/input.sol":60:213 contract OptimizeFullSlotWrite {... */
|
||||
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 {
|
||||
/* "optimize_full_storage_write/input.sol":60:213 contract OptimizeFullSlotWrite {... */
|
||||
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
|
||||
/* "optimize_full_storage_write/input.sol":111:211 function f() public {... */
|
||||
tag_3:
|
||||
tag_4
|
||||
/* "optimize_full_storage_write/input.sol":192:207 nums[3] = 44444 */
|
||||
0xad9c000000000000823500000000000056ce0000000000002b67
|
||||
/* "optimize_full_storage_write/input.sol":135:139 nums */
|
||||
0x00
|
||||
/* "optimize_full_storage_write/input.sol":192:207 nums[3] = 44444 */
|
||||
sstore
|
||||
/* "optimize_full_storage_write/input.sol":111:211 function f() public {... */
|
||||
jump
|
||||
tag_4:
|
||||
stop
|
||||
|
||||
auxdata: <AUXDATA REMOVED>
|
||||
}
|
||||
Reference in New Issue
Block a user