diff options
Diffstat (limited to 'test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul')
-rw-r--r-- | test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul | 153 |
1 files changed, 76 insertions, 77 deletions
diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index c909d39e..a8cac6c6 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -458,13 +458,14 @@ // ---- // fullSuite // { +// let _1 := 0x20 // let _2 := 0 -// let _485 := mload(_2) -// let abi_encode_pos := 0x20 -// let abi_encode_length_68 := mload(_485) -// mstore(0x20, abi_encode_length_68) +// let _268 := mload(_2) +// let abi_encode_pos := _1 +// let abi_encode_length_68 := mload(_268) +// mstore(_1, abi_encode_length_68) // abi_encode_pos := 64 -// let abi_encode_srcPtr := add(_485, 0x20) +// let abi_encode_srcPtr := add(_268, _1) // let abi_encode_i_69 := _2 // for { // } @@ -473,31 +474,45 @@ // abi_encode_i_69 := add(abi_encode_i_69, 1) // } // { -// abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(mload(abi_encode_srcPtr), abi_encode_pos) -// abi_encode_srcPtr := add(abi_encode_srcPtr, 0x20) +// let _668 := mload(abi_encode_srcPtr) +// let abi_encode_pos_71_760 := abi_encode_pos +// let abi_encode_srcPtr_73_762 := _668 +// let abi_encode_i_74_763 := _2 +// for { +// } +// lt(abi_encode_i_74_763, 0x3) +// { +// abi_encode_i_74_763 := add(abi_encode_i_74_763, 1) +// } +// { +// mstore(abi_encode_pos_71_760, and(mload(abi_encode_srcPtr_73_762), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) +// abi_encode_srcPtr_73_762 := add(abi_encode_srcPtr_73_762, _1) +// abi_encode_pos_71_760 := add(abi_encode_pos_71_760, _1) +// } +// abi_encode_srcPtr := add(abi_encode_srcPtr, _1) // abi_encode_pos := add(abi_encode_pos, 0x60) // } -// let _487 := mload(0x40) -// let _488 := mload(0x20) -// if slt(sub(_487, _488), 128) +// let _270 := mload(64) +// let _271 := mload(_1) +// if slt(sub(_270, _271), 128) // { // revert(_2, _2) // } -// let abi_decode_offset_64 := calldataload(add(_488, 64)) -// let abi_decode__165 := 0xffffffffffffffff -// if gt(abi_decode_offset_64, abi_decode__165) +// let abi_decode_offset_64 := calldataload(add(_271, 64)) +// let abi_decode__74 := 0xffffffffffffffff +// if gt(abi_decode_offset_64, abi_decode__74) // { // revert(_2, _2) // } -// let abi_decode_value2_587 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(_488, abi_decode_offset_64), _487) -// let abi_decode_offset_65 := calldataload(add(_488, 96)) -// if gt(abi_decode_offset_65, abi_decode__165) +// let abi_decode_value2_367 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(_271, abi_decode_offset_64), _270) +// let abi_decode_offset_65 := calldataload(add(_271, 96)) +// if gt(abi_decode_offset_65, abi_decode__74) // { // revert(_2, _2) // } -// let abi_decode_value3_588 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_488, abi_decode_offset_65), _487) -// sstore(calldataload(_488), calldataload(add(_488, 32))) -// sstore(abi_decode_value2_587, abi_decode_value3_588) +// let abi_decode_value3_368 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_271, abi_decode_offset_65), _270) +// sstore(calldataload(_271), calldataload(add(_271, _1))) +// sstore(abi_decode_value2_367, abi_decode_value3_368) // sstore(_2, abi_encode_pos) // function abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(offset_3, end_4) -> array_5 // { @@ -506,23 +521,19 @@ // revert(0, 0) // } // let length_6 := calldataload(offset_3) -// if gt(length_6, 0xffffffffffffffff) +// let array_5_115 := allocateMemory(array_allocation_size_t_array$_t_address_$dyn_memory(length_6)) +// array_5 := array_5_115 +// let dst_7 := array_5_115 +// mstore(array_5_115, length_6) +// let _16 := 0x20 +// dst_7 := add(array_5_115, _16) +// let src_8 := add(offset_3, _16) +// if gt(add(add(offset_3, mul(length_6, 0x40)), _16), end_4) // { // revert(0, 0) // } -// let array_allo__217 := 0x20 -// let array_5_254 := allocateMemory(add(mul(length_6, array_allo__217), array_allo__217)) -// array_5 := array_5_254 -// let dst_7 := array_5_254 -// mstore(array_5_254, length_6) -// dst_7 := add(array_5_254, array_allo__217) -// let src_8 := add(offset_3, array_allo__217) -// if gt(add(add(offset_3, mul(length_6, 0x40)), array_allo__217), end_4) -// { -// revert(0, 0) -// } -// let i_9_566 := 0 -// let i_9 := i_9_566 +// let i_9_346 := 0 +// let i_9 := i_9_346 // for { // } // lt(i_9, length_6) @@ -532,16 +543,17 @@ // { // if iszero(slt(add(src_8, 0x1f), end_4)) // { -// revert(i_9_566, i_9_566) +// revert(i_9_346, i_9_346) // } -// let abi_decode_array_13_263 := allocateMemory(array_allocation_size_t_array$_t_uint256_$2_memory(0x2)) -// let abi_decode_dst_15 := abi_decode_array_13_263 +// let abi_decode_array_13_124 := allocateMemory(array_allocation_size_t_array$_t_uint256_$2_memory(0x2)) +// let abi_decode_dst_15 := abi_decode_array_13_124 // let abi_decode_src_16 := src_8 -// if gt(add(src_8, 64), end_4) +// let abi_decode__289 := add(src_8, 0x40) +// if gt(abi_decode__289, end_4) // { -// revert(i_9_566, i_9_566) +// revert(i_9_346, i_9_346) // } -// let abi_decode_i_17 := i_9_566 +// let abi_decode_i_17 := i_9_346 // for { // } // lt(abi_decode_i_17, 0x2) @@ -550,12 +562,12 @@ // } // { // mstore(abi_decode_dst_15, calldataload(abi_decode_src_16)) -// abi_decode_dst_15 := add(abi_decode_dst_15, array_allo__217) -// abi_decode_src_16 := add(abi_decode_src_16, array_allo__217) +// abi_decode_dst_15 := add(abi_decode_dst_15, _16) +// abi_decode_src_16 := add(abi_decode_src_16, _16) // } -// mstore(dst_7, abi_decode_array_13_263) -// dst_7 := add(dst_7, array_allo__217) -// src_8 := add(src_8, 0x40) +// mstore(dst_7, abi_decode_array_13_124) +// dst_7 := add(dst_7, _16) +// src_8 := abi_decode__289 // } // } // function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset_27, end_28) -> array_29 @@ -565,19 +577,14 @@ // revert(0, 0) // } // let length_30 := calldataload(offset_27) -// if gt(length_30, 0xffffffffffffffff) -// { -// revert(0, 0) -// } -// let array_allo__234 := 0x20 -// let array_allo__560 := mul(length_30, array_allo__234) -// let array_29_279 := allocateMemory(add(array_allo__560, array_allo__234)) -// array_29 := array_29_279 -// let dst_31 := array_29_279 -// mstore(array_29_279, length_30) -// dst_31 := add(array_29_279, array_allo__234) -// let src_32 := add(offset_27, array_allo__234) -// if gt(add(add(offset_27, array_allo__560), array_allo__234), end_28) +// let array_29_131 := allocateMemory(array_allocation_size_t_array$_t_address_$dyn_memory(length_30)) +// array_29 := array_29_131 +// let dst_31 := array_29_131 +// mstore(array_29_131, length_30) +// let _52 := 0x20 +// dst_31 := add(array_29_131, _52) +// let src_32 := add(offset_27, _52) +// if gt(add(add(offset_27, mul(length_30, _52)), _52), end_28) // { // revert(0, 0) // } @@ -590,36 +597,28 @@ // } // { // mstore(dst_31, calldataload(src_32)) -// dst_31 := add(dst_31, array_allo__234) -// src_32 := add(src_32, array_allo__234) +// dst_31 := add(dst_31, _52) +// src_32 := add(src_32, _52) // } // } -// function abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(value_70, pos_71) +// function allocateMemory(size) -> memPtr // { -// let srcPtr_73 := value_70 -// let i_74 := 0 -// for { -// } -// lt(i_74, 0x3) -// { -// i_74 := add(i_74, 1) -// } +// let memPtr_157 := mload(64) +// memPtr := memPtr_157 +// let newFreePtr := add(memPtr_157, size) +// if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_157)) // { -// mstore(pos_71, and(mload(srcPtr_73), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) -// srcPtr_73 := add(srcPtr_73, 0x20) -// pos_71 := add(pos_71, 0x20) +// revert(0, 0) // } +// mstore(64, newFreePtr) // } -// function allocateMemory(size) -> memPtr +// function array_allocation_size_t_array$_t_address_$dyn_memory(length_90) -> size_91 // { -// let memPtr_315 := mload(64) -// memPtr := memPtr_315 -// let newFreePtr := add(memPtr_315, size) -// if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_315)) +// if gt(length_90, 0xffffffffffffffff) // { // revert(0, 0) // } -// mstore(64, newFreePtr) +// size_91 := add(mul(length_90, 0x20), 0x20) // } // function array_allocation_size_t_array$_t_uint256_$2_memory(length_94) -> size_95 // { |