diff --git a/libsolidity/interface/OptimiserSettings.h b/libsolidity/interface/OptimiserSettings.h index 46683088a042..0ecbeab1002a 100644 --- a/libsolidity/interface/OptimiserSettings.h +++ b/libsolidity/interface/OptimiserSettings.h @@ -43,20 +43,20 @@ struct OptimiserSettings { static char constexpr DefaultYulOptimiserSteps[] = "dhfoDgvulfnTUtnIf" // None of these can make stack problems worse - "[" - "xa[r]EscLM" // Turn into SSA and simplify - "cCTUtTOntnfDIul" // Perform structural simplification - "Lcul" // Simplify again - "Vcul [j]" // Reverse SSA - - // should have good "compilability" property here. - - "Tpeul" // Run functional expression inliner - "xa[rul]" // Prune a bit more in SSA - "xa[r]cL" // Turn into SSA again and simplify - "gvif" // Run full inliner - "CTUca[r]LSsTFOtfDnca[r]Iulc" // SSA plus simplify - "]" + + "xa[r]EscLM" // Turn into SSA and simplify + "cCTUtTOntnfDIul" // Perform structural simplification + "Lcul" // Simplify again + "Vcul [j]" // Reverse SSA + + // should have good "compilability" property here. + + "Tpeul" // Run functional expression inliner + "xa[rul]" // Prune a bit more in SSA + "xa[r]cL" // Turn into SSA again and simplify + "gvif" // Run full inliner + "CTUca[r]LSsTFOtfDnca[r]Iulc" // SSA plus simplify + "jmul[jul] VcTOcul jmul"; // Make source short and pretty static char constexpr DefaultYulOptimiserCleanupSteps[] = "fDnTOcmu"; diff --git a/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output b/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output index 4c90d9054d2a..e4aa4277ddbe 100644 --- a/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output +++ b/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output @@ -443,8 +443,7 @@ object "D_27" { /// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." let _3 := datasize("C_2") let _4 := add(_1, _3) - let _5 := 0xffffffffffffffff - if or(gt(_4, _5), lt(_4, _1)) + if or(gt(_4, 0xffffffffffffffff), lt(_4, _1)) { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." mstore(0, shl(224, 0x4e487b71)) @@ -460,45 +459,71 @@ object "D_27" { returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } - let memPtr := mload(_2) - let newFreePtr := add(memPtr, _2) - if or(gt(newFreePtr, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _5), /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ lt(newFreePtr, memPtr)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(4, 0x41) - revert(0, 0x24) - } - mstore(_2, newFreePtr) - mstore(memPtr, 2) - let _6 := 32 - mstore(add(memPtr, _6), "/*") - let memPtr_1 := mload(_2) - let newFreePtr_1 := add(memPtr_1, 96) - if or(gt(newFreePtr_1, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _5), /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ lt(newFreePtr_1, memPtr_1)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(4, 0x41) - revert(0, 0x24) - } - mstore(_2, newFreePtr_1) - mstore(memPtr_1, 39) - mstore(add(memPtr_1, _6), 0x2f2a2a204073726320303a39363a313635202022636f6e74726163742044207b) + let memPtr := allocate_memory_array_string() + let _5 := 32 + mstore(add(memPtr, _5), "/*") + let memPtr_1 := allocate_memory_array_string_710() + mstore(add(memPtr_1, _5), 0x2f2a2a204073726320303a39363a313635202022636f6e74726163742044207b) mstore(add(memPtr_1, _2), shl(200, 0x2e2e2e22202a2f)) let memPos := mload(_2) - mstore(memPos, _6) + mstore(memPos, _5) let length := mload(memPtr_1) - mstore(add(memPos, _6), length) + mstore(add(memPos, _5), length) let i := 0 - for { } lt(i, length) { i := add(i, _6) } + for { } lt(i, length) { i := add(i, _5) } { - mstore(add(add(memPos, i), _2), mload(add(add(memPtr_1, i), _6))) + mstore(add(add(memPos, i), _2), mload(add(add(memPtr_1, i), _5))) } mstore(add(add(memPos, length), _2), 0) - return(memPos, add(sub(add(memPos, and(add(length, 31), not(31))), memPos), _2)) + return(memPos, sub(add(add(memPos, and(add(length, 31), not(31))), _2), memPos)) } } revert(0, 0) } + function allocate_memory_array_string() -> memPtr + { + let _1 := 0xffffffffffffffff + if gt(2, _1) + { + mstore(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 0x24) + } + let _2 := not(31) + let memPtr_1 := mload(64) + let newFreePtr := add(memPtr_1, and(add(and(add(2, 31), _2), 63), _2)) + if or(gt(newFreePtr, _1), lt(newFreePtr, memPtr_1)) + { + mstore(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 0x24) + } + mstore(64, newFreePtr) + memPtr := memPtr_1 + mstore(memPtr_1, 2) + } + function allocate_memory_array_string_710() -> memPtr + { + let _1 := 0xffffffffffffffff + if gt(39, _1) + { + mstore(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 0x24) + } + let _2 := not(31) + let memPtr_1 := mload(64) + let newFreePtr := add(memPtr_1, and(add(and(add(39, 31), _2), 63), _2)) + if or(gt(newFreePtr, _1), lt(newFreePtr, memPtr_1)) + { + mstore(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(/** @src -1:-1:-1 */ 0, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 0x24) + } + mstore(64, newFreePtr) + memPtr := memPtr_1 + mstore(memPtr_1, 39) + } } /// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol" object "C_2" { diff --git a/test/cmdlineTests/mcopy_bytes_array_returned_from_function/output b/test/cmdlineTests/mcopy_bytes_array_returned_from_function/output index 2441357d97fb..33648f4c9064 100644 --- a/test/cmdlineTests/mcopy_bytes_array_returned_from_function/output +++ b/test/cmdlineTests/mcopy_bytes_array_returned_from_function/output @@ -16,13 +16,13 @@ object "C_14" { code { { let _1 := memoryguard(0x80) + let _2 := 64 if iszero(lt(calldatasize(), 4)) { if eq(0xc2985578, shr(224, calldataload(0))) { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let _2 := 64 let newFreePtr := add(_1, _2) if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _1)) { @@ -40,7 +40,7 @@ object "C_14" { mstore(add(memPos, 0x20), length) mcopy(add(memPos, _2), _3, length) mstore(add(add(memPos, length), _2), 0) - return(memPos, add(sub(add(memPos, and(add(length, 31), not(31))), memPos), _2)) + return(memPos, sub(add(add(memPos, and(add(length, 31), not(31))), _2), memPos)) } } revert(0, 0) diff --git a/test/cmdlineTests/mcopy_string_literal_returned_from_function/output b/test/cmdlineTests/mcopy_string_literal_returned_from_function/output index 02740ec0d6cb..118a1f79e9d4 100644 --- a/test/cmdlineTests/mcopy_string_literal_returned_from_function/output +++ b/test/cmdlineTests/mcopy_string_literal_returned_from_function/output @@ -16,13 +16,13 @@ object "C_10" { code { { let _1 := memoryguard(0x80) + let _2 := 64 if iszero(lt(calldatasize(), 4)) { if eq(0xc2985578, shr(224, calldataload(0))) { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let _2 := 64 let newFreePtr := add(_1, _2) if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _1)) { @@ -40,7 +40,7 @@ object "C_10" { mstore(add(memPos, 0x20), length) mcopy(add(memPos, _2), _3, length) mstore(add(add(memPos, length), _2), 0) - return(memPos, add(sub(add(memPos, and(add(length, 31), not(31))), memPos), _2)) + return(memPos, sub(add(add(memPos, and(add(length, 31), not(31))), _2), memPos)) } } revert(0, 0) diff --git a/test/cmdlineTests/name_simplifier/output b/test/cmdlineTests/name_simplifier/output index ed4c6e5c02e9..5dc4ec06858c 100644 --- a/test/cmdlineTests/name_simplifier/output +++ b/test/cmdlineTests/name_simplifier/output @@ -17,108 +17,125 @@ object "C_59" { code { { /// @src 0:346:625 "contract C {..." - let _1 := memoryguard(0x80) - let _2 := 4 - if iszero(lt(calldatasize(), _2)) + mstore(64, memoryguard(0x80)) + if iszero(lt(calldatasize(), 4)) { if eq(0xf8eddcc6, shr(224, calldataload(0))) { if callvalue() { revert(0, 0) } - let _3 := 32 - if slt(add(calldatasize(), not(3)), _3) { revert(0, 0) } - let offset := calldataload(_2) - let _4 := 0xffffffffffffffff - if gt(offset, _4) { revert(0, 0) } + let _1 := 32 + if slt(add(calldatasize(), not(3)), _1) { revert(0, 0) } + let offset := calldataload(4) + let _2 := 0xffffffffffffffff + if gt(offset, _2) { revert(0, 0) } if iszero(slt(add(offset, 35), calldatasize())) { revert(0, 0) } - let _5 := calldataload(add(_2, offset)) - let _6 := 36 - if gt(_5, _4) + let _3 := calldataload(add(4, offset)) + if gt(_3, _2) { mstore(0, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(0, _6) + mstore(4, 0x41) + revert(0, 0x24) } - let _7 := shl(5, _5) - let _8 := not(31) - let newFreePtr := add(_1, and(add(_7, 63), _8)) - if or(gt(newFreePtr, _4), lt(newFreePtr, _1)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(0, _6) - } - let _9 := 64 - mstore(_9, newFreePtr) - let dst := _1 - mstore(_1, _5) - dst := add(_1, _3) - let dst_1 := dst - let srcEnd := add(add(offset, _7), _6) + let _4 := shl(5, _3) + let dst := allocate_memory(add(_4, _1)) + let array := dst + mstore(dst, _3) + dst := add(dst, _1) + let srcEnd := add(add(offset, _4), 36) if gt(srcEnd, calldatasize()) { revert(0, 0) } - let src := add(offset, _6) - for { } lt(src, srcEnd) { src := add(src, _3) } + let src := add(offset, 36) + for { } lt(src, srcEnd) { src := add(src, _1) } { - if slt(sub(calldatasize(), src), _3) { revert(0, 0) } - let memPtr := mload(_9) - let newFreePtr_1 := add(memPtr, _3) - if or(gt(newFreePtr_1, _4), lt(newFreePtr_1, memPtr)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(0, _6) - } - mstore(_9, newFreePtr_1) - mstore(memPtr, calldataload(src)) - mstore(dst, memPtr) - dst := add(dst, _3) + if slt(sub(calldatasize(), src), _1) { revert(0, 0) } + let value := allocate_memory_2026() + mstore(value, calldataload(src)) + mstore(dst, value) + dst := add(dst, _1) } - if iszero(mload(_1)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(_2, 0x32) - revert(0, _6) - } - sstore(0, mload(/** @src 0:469:474 "_s[0]" */ mload(dst_1))) + sstore(0, mload(/** @src 0:469:474 "_s[0]" */ mload(memory_array_index_access_struct_S_dyn(array)))) /// @src 0:346:625 "contract C {..." - if iszero(lt(/** @src 0:492:493 "1" */ 0x01, /** @src 0:346:625 "contract C {..." */ mload(_1))) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(_2, 0x32) - revert(0, _6) - } - let _10 := mload(/** @src 0:489:494 "_s[1]" */ mload(/** @src 0:346:625 "contract C {..." */ add(_1, _9))) - sstore(0x02, _10) - let memPtr_1 := mload(_9) - let newFreePtr_2 := add(memPtr_1, 160) - if or(gt(newFreePtr_2, _4), lt(newFreePtr_2, memPtr_1)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(0, _6) - } - mstore(_9, newFreePtr_2) - mstore(memPtr_1, 100) - mstore(add(memPtr_1, _3), "longstringlongstringlongstringlo") - mstore(add(memPtr_1, _9), "ngstringlongstringlongstringlong") - let _11 := 96 - mstore(add(memPtr_1, 96), "stringlongstringlongstringlongst") - mstore(add(memPtr_1, 128), "ring") - let memPos := mload(_9) - mstore(memPos, _10) - mstore(add(memPos, _3), _9) - let length := mload(memPtr_1) - mstore(add(memPos, _9), length) + let _5 := mload(/** @src 0:489:494 "_s[1]" */ mload(memory_array_index_access_struct_S_dyn_2028(array))) + /// @src 0:346:625 "contract C {..." + sstore(0x02, _5) + let memPtr := allocate_memory_2029() + mstore(memPtr, 100) + mstore(add(memPtr, _1), "longstringlongstringlongstringlo") + mstore(add(memPtr, 64), "ngstringlongstringlongstringlong") + mstore(add(memPtr, 96), "stringlongstringlongstringlongst") + let _6 := 96 + mstore(add(memPtr, 128), "ring") + let memPos := mload(64) + mstore(memPos, _5) + mstore(add(memPos, _1), 64) + let length := mload(memPtr) + mstore(add(memPos, 64), length) let i := 0 - for { } lt(i, length) { i := add(i, _3) } + for { } lt(i, length) { i := add(i, _1) } { - mstore(add(add(memPos, i), _11), mload(add(add(memPtr_1, i), _3))) + mstore(add(add(memPos, i), _6), mload(add(add(memPtr, i), _1))) } mstore(add(add(memPos, length), 96), 0) - return(memPos, add(sub(add(memPos, and(add(length, 31), _8)), memPos), 96)) + return(memPos, sub(add(add(memPos, and(add(length, 0x1f), not(31))), 96), memPos)) } } revert(0, 0) } + function allocate_memory_2026() -> memPtr + { + memPtr := mload(64) + let newFreePtr := add(memPtr, and(add(32, 31), not(31))) + if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(0, 0x24) + } + mstore(64, newFreePtr) + } + function allocate_memory_2029() -> memPtr + { + memPtr := mload(64) + let newFreePtr := add(memPtr, and(add(160, 31), not(31))) + if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(0, 0x24) + } + mstore(64, newFreePtr) + } + function allocate_memory(size) -> memPtr + { + memPtr := mload(64) + let newFreePtr := add(memPtr, and(add(size, 31), not(31))) + if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(0, 0x24) + } + mstore(64, newFreePtr) + } + function memory_array_index_access_struct_S_dyn(baseRef) -> addr + { + if iszero(lt(0, mload(baseRef))) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x32) + revert(0, 0x24) + } + addr := add(add(baseRef, shl(5, 0)), 32) + } + function memory_array_index_access_struct_S_dyn_2028(baseRef) -> addr + { + if iszero(lt(/** @src 0:492:493 "1" */ 0x01, /** @src 0:346:625 "contract C {..." */ mload(baseRef))) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x32) + revert(0, 0x24) + } + addr := add(add(baseRef, shl(5, /** @src 0:492:493 "1" */ 0x01)), /** @src 0:346:625 "contract C {..." */ 32) + } } data ".metadata" hex"" } diff --git a/test/cmdlineTests/optimizer_array_sload/output b/test/cmdlineTests/optimizer_array_sload/output index b32d421d0717..aaabfcce2c35 100644 --- a/test/cmdlineTests/optimizer_array_sload/output +++ b/test/cmdlineTests/optimizer_array_sload/output @@ -26,20 +26,30 @@ object "Arraysum_34" { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } let var_sum := 0 + /// @src 0:175:182 "sum = 0" + var_sum := /** @src 0:80:429 "contract Arraysum {..." */ 0 /// @src 0:368:378 "uint i = 0" let var_i := /** @src 0:80:429 "contract Arraysum {..." */ 0 let _2 := sload(0) /// @src 0:364:423 "for(uint i = 0; i < values.length; i++)..." for { } - /** @src 0:380:397 "i < values.length" */ lt(var_i, _2) - /// @src 0:368:378 "uint i = 0" + /** @src 0:368:378 "uint i = 0" */ 1 { /// @src 0:399:402 "i++" var_i := /** @src 0:80:429 "contract Arraysum {..." */ add(/** @src 0:399:402 "i++" */ var_i, /** @src 0:80:429 "contract Arraysum {..." */ 1) } /// @src 0:399:402 "i++" { + /// @src 0:380:397 "i < values.length" + let _3 := iszero(lt(var_i, _2)) + if _3 { break } /// @src 0:80:429 "contract Arraysum {..." + if _3 + { + mstore(0, shl(224, 0x4e487b71)) + mstore(_1, 0x32) + revert(0, 0x24) + } mstore(0, 0) let sum := add(var_sum, sload(add(18569430475105882587588266137607568536673111973893317399460219858819262702947, var_i))) if gt(var_sum, sum) @@ -54,7 +64,7 @@ object "Arraysum_34" { /// @src 0:80:429 "contract Arraysum {..." let memPos := mload(64) mstore(memPos, var_sum) - return(memPos, 32) + return(memPos, add(sub(memPos, memPos), 32)) } } revert(0, 0) diff --git a/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json b/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json index 143ad92c304a..22b50c0e7ff4 100644 --- a/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json @@ -80,45 +80,41 @@ stop sub_0: assembly { /* \"C\":79:428 contract C... */ - 0x80 0x40 - swap1 - dup1 - dup3 + 0x80 + dup2 mstore - jumpi(tag_2, iszero(lt(calldatasize, 0x04))) + jumpi(tag_3, iszero(lt(calldatasize, 0x04))) 0x00 dup1 revert - tag_2: + tag_3: shr(0xe0, calldataload(0x00)) - swap1 - dup2 + dup1 0x26121ff0 eq - tag_4 + tag_5 jumpi - pop dup1 0x793816ec eq - tag_6 + tag_7 jumpi 0x9942ec6f eq - tag_8 + tag_9 jumpi 0x00 dup1 revert - tag_8: - jumpi(tag_26, callvalue) - jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) + tag_9: + jumpi(tag_27, callvalue) + jumpi(tag_27, slt(add(not(0x03), calldatasize), 0x00)) sload(0x00) sub(shl(0xff, 0x01), 0x01) dup2 eq - tag_14 + tag_15 jumpi 0x01 add @@ -132,13 +128,9 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ dup2 mstore - /* \"C\":79:428 contract C... */ - swap2 - swap1 - /* \"C\":403:411 this.f() */ 0x20 /* \"C\":79:428 contract C... */ - dup4 + dup2 0x04 dup2 /* \"C\":403:407 this */ @@ -146,78 +138,79 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ gas staticcall - swap3 - dup4 + swap1 + dup2 iszero - tag_16 + tag_17 jumpi /* \"C\":79:428 contract C... */ 0x00 /* \"C\":403:411 this.f() */ - swap4 - tag_18 + swap2 + tag_19 jumpi /* \"C\":79:428 contract C... */ - tag_19: + tag_20: /* \"C\":392:411 stateVar + this.f() */ pop - tag_20 - /* \"C\":403:411 this.f() */ - 0x20 - /* \"C\":392:411 stateVar + this.f() */ - swap4 - /* \"C\":392:422 stateVar + this.f() + immutVar */ tag_21 + swap1 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_22 /* \"C\":392:411 stateVar + this.f() */ swap3 - tag_1 + tag_2 jump\t// in - tag_20: + tag_21: /* \"C\":414:422 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":392:422 stateVar + this.f() + immutVar */ swap1 - tag_1 + tag_2 jump\t// in - tag_21: + tag_22: /* \"C\":79:428 contract C... */ swap1 mload swap1 dup2 mstore + /* \"C\":403:411 this.f() */ + 0x20 + swap1 + /* \"C\":79:428 contract C... */ return /* \"C\":403:411 this.f() */ - tag_18: - swap3 + tag_19: + swap1 pop 0x20 - jumpi(tag_22, gt(0x20, returndatasize)) - tag_23: + jumpi(tag_23, gt(0x20, returndatasize)) + tag_24: /* \"C\":79:428 contract C... */ 0x1f dup2 add not(0x1f) and - dup5 + dup3 add 0xffffffffffffffff dup2 gt - dup6 + dup4 dup3 lt or - tag_24 + tag_25 jumpi /* \"C\":403:411 this.f() */ 0x20 /* \"C\":79:428 contract C... */ swap2 - dup6 + dup4 swap2 - dup6 + dup7 mstore /* \"C\":403:411 this.f() */ dup2 @@ -225,21 +218,19 @@ sub_0: assembly { /* \"C\":79:428 contract C... */ sub slt - tag_26 + tag_27 jumpi - swap2 mload - swap2 - /* \"C\":392:411 stateVar + this.f() */ - tag_20 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_22 /* \"C\":403:411 this.f() */ - jump(tag_19) + jump(tag_20) /* \"C\":79:428 contract C... */ - tag_26: + tag_27: 0x00 dup1 revert - tag_24: + tag_25: /* \"C\":117:119 41 */ shl(0xe0, 0x4e487b71) /* \"C\":79:428 contract C... */ @@ -248,13 +239,13 @@ sub_0: assembly { mstore(0x04, 0x41) revert(0x00, 0x24) /* \"C\":403:411 this.f() */ - tag_22: + tag_23: pop returndatasize - jump(tag_23) - tag_16: + jump(tag_24) + tag_17: /* \"C\":79:428 contract C... */ - dup3 + dup4 mload returndatasize 0x00 @@ -263,7 +254,7 @@ sub_0: assembly { returndatasize swap1 revert - tag_14: + tag_15: /* \"C\":117:119 41 */ shl(0xe0, 0x4e487b71) /* \"C\":79:428 contract C... */ @@ -281,44 +272,41 @@ sub_0: assembly { /* \"C\":117:119 41 */ revert /* \"C\":79:428 contract C... */ - tag_6: + tag_7: pop - jumpi(tag_26, callvalue) - jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) - 0x20 - swap1 + jumpi(tag_27, callvalue) + jumpi(tag_27, slt(add(not(0x03), calldatasize), 0x00)) sload(0x00) swap1 mload swap1 dup2 mstore + 0x20 + swap1 return - tag_4: - jumpi(tag_26, callvalue) - jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) + tag_5: + pop + jumpi(tag_27, callvalue) + jumpi(tag_27, slt(add(not(0x03), calldatasize), 0x00)) + /* \"C\":279:298 constVar + immutVar */ + tag_22 /* \"C\":290:298 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":117:119 41 */ - swap1 - dup2 0x29 + dup2 add swap2 + swap1 dup3 slt 0x01 and - tag_14 + tag_15 jumpi - /* \"C\":79:428 contract C... */ - 0x20 - swap2 - dup2 - mstore - return - /* \"C\":117:119 41 */ - tag_1: + jump\t// out + tag_2: swap2 swap1 swap2 @@ -340,7 +328,7 @@ sub_0: assembly { iszero and or - tag_14 + tag_15 jumpi jump\t// out @@ -400,11 +388,10 @@ sub_0: assembly { mload /* \"C\":147:149 42 */ mstore(0x80, 0x2a) - /* \"D\":91:166 contract D is C(3)... */ - dup1 /* \"D\":107:108 3 */ 0x03 /* \"D\":91:166 contract D is C(3)... */ + dup2 add swap1 dup2 @@ -445,45 +432,41 @@ stop sub_0: assembly { /* \"D\":91:166 contract D is C(3)... */ - 0x80 0x40 - swap1 - dup1 - dup3 + 0x80 + dup2 mstore - jumpi(tag_2, iszero(lt(calldatasize, 0x04))) + jumpi(tag_3, iszero(lt(calldatasize, 0x04))) 0x00 dup1 revert - tag_2: + tag_3: shr(0xe0, calldataload(0x00)) - swap1 - dup2 + dup1 0x26121ff0 eq - tag_4 + tag_5 jumpi - pop dup1 0x793816ec eq - tag_6 + tag_7 jumpi 0x9942ec6f eq - tag_8 + tag_9 jumpi 0x00 dup1 revert - tag_8: - jumpi(tag_26, callvalue) - jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) + tag_9: + jumpi(tag_27, callvalue) + jumpi(tag_27, slt(add(not(0x03), calldatasize), 0x00)) sload(0x00) sub(shl(0xff, 0x01), 0x01) dup2 eq - tag_14 + tag_15 jumpi 0x01 add @@ -497,13 +480,9 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ dup2 mstore - /* \"D\":91:166 contract D is C(3)... */ - swap2 - swap1 - /* \"C\":403:411 this.f() */ 0x20 /* \"D\":91:166 contract D is C(3)... */ - dup4 + dup2 0x04 dup2 /* \"C\":403:407 this */ @@ -511,78 +490,79 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ gas staticcall - swap3 - dup4 + swap1 + dup2 iszero - tag_16 + tag_17 jumpi /* \"D\":91:166 contract D is C(3)... */ 0x00 /* \"C\":403:411 this.f() */ - swap4 - tag_18 + swap2 + tag_19 jumpi /* \"D\":91:166 contract D is C(3)... */ - tag_19: + tag_20: /* \"C\":392:411 stateVar + this.f() */ pop - tag_20 - /* \"C\":403:411 this.f() */ - 0x20 - /* \"C\":392:411 stateVar + this.f() */ - swap4 - /* \"C\":392:422 stateVar + this.f() + immutVar */ tag_21 + swap1 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_22 /* \"C\":392:411 stateVar + this.f() */ swap3 - tag_1 + tag_2 jump\t// in - tag_20: + tag_21: /* \"C\":414:422 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":392:422 stateVar + this.f() + immutVar */ swap1 - tag_1 + tag_2 jump\t// in - tag_21: + tag_22: /* \"D\":91:166 contract D is C(3)... */ swap1 mload swap1 dup2 mstore + /* \"C\":403:411 this.f() */ + 0x20 + swap1 + /* \"D\":91:166 contract D is C(3)... */ return /* \"C\":403:411 this.f() */ - tag_18: - swap3 + tag_19: + swap1 pop 0x20 - jumpi(tag_22, gt(0x20, returndatasize)) - tag_23: + jumpi(tag_23, gt(0x20, returndatasize)) + tag_24: /* \"D\":91:166 contract D is C(3)... */ 0x1f dup2 add not(0x1f) and - dup5 + dup3 add 0xffffffffffffffff dup2 gt - dup6 + dup4 dup3 lt or - tag_24 + tag_25 jumpi /* \"C\":403:411 this.f() */ 0x20 /* \"D\":91:166 contract D is C(3)... */ swap2 - dup6 + dup4 swap2 - dup6 + dup7 mstore /* \"C\":403:411 this.f() */ dup2 @@ -590,21 +570,19 @@ sub_0: assembly { /* \"D\":91:166 contract D is C(3)... */ sub slt - tag_26 + tag_27 jumpi - swap2 mload - swap2 - /* \"C\":392:411 stateVar + this.f() */ - tag_20 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_22 /* \"C\":403:411 this.f() */ - jump(tag_19) + jump(tag_20) /* \"D\":91:166 contract D is C(3)... */ - tag_26: + tag_27: 0x00 dup1 revert - tag_24: + tag_25: /* \"C\":117:119 41 */ shl(0xe0, 0x4e487b71) /* \"D\":91:166 contract D is C(3)... */ @@ -613,13 +591,13 @@ sub_0: assembly { mstore(0x04, 0x41) revert(0x00, 0x24) /* \"C\":403:411 this.f() */ - tag_22: + tag_23: pop returndatasize - jump(tag_23) - tag_16: + jump(tag_24) + tag_17: /* \"D\":91:166 contract D is C(3)... */ - dup3 + dup4 mload returndatasize 0x00 @@ -628,7 +606,7 @@ sub_0: assembly { returndatasize swap1 revert - tag_14: + tag_15: /* \"C\":117:119 41 */ shl(0xe0, 0x4e487b71) /* \"D\":91:166 contract D is C(3)... */ @@ -646,44 +624,41 @@ sub_0: assembly { /* \"C\":117:119 41 */ revert /* \"D\":91:166 contract D is C(3)... */ - tag_6: + tag_7: pop - jumpi(tag_26, callvalue) - jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) - 0x20 - swap1 + jumpi(tag_27, callvalue) + jumpi(tag_27, slt(add(not(0x03), calldatasize), 0x00)) sload(0x00) swap1 mload swap1 dup2 mstore + 0x20 + swap1 return - tag_4: - jumpi(tag_26, callvalue) - jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) + tag_5: + pop + jumpi(tag_27, callvalue) + jumpi(tag_27, slt(add(not(0x03), calldatasize), 0x00)) + /* \"C\":279:298 constVar + immutVar */ + tag_22 /* \"C\":290:298 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":117:119 41 */ - swap1 - dup2 0x29 + dup2 add swap2 + swap1 dup3 slt 0x01 and - tag_14 + tag_15 jumpi - /* \"D\":91:166 contract D is C(3)... */ - 0x20 - swap2 - dup2 - mstore - return - /* \"C\":117:119 41 */ - tag_1: + jump\t// out + tag_2: swap2 swap1 swap2 @@ -705,7 +680,7 @@ sub_0: assembly { iszero and or - tag_14 + tag_15 jumpi jump\t// out diff --git a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json index 2671162722e0..31ad3f3133fd 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json @@ -653,103 +653,108 @@ object \"C_54\" { code { { /// @src 0:79:435 \"contract C...\" - let _1 := memoryguard(0x80) - let _2 := 64 - mstore(_2, _1) + let _1 := 64 + mstore(_1, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { switch shr(224, calldataload(0)) case 0x26121ff0 { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - /// @src 0:297:305 \"immutVar\" - let _3 := loadimmutable(\"8\") + /// @src 0:279:305 \"return constVar + immutVar\" + let var := /** @src 0:286:305 \"constVar + immutVar\" */ checked_add_int256_1129(/** @src 0:297:305 \"immutVar\" */ loadimmutable(\"8\")) /// @src 0:79:435 \"contract C...\" - let sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 0:79:435 \"contract C...\" */ _3) - if and(1, slt(sum, _3)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(4, 0x11) - revert(0, 0x24) - } - mstore(_1, sum) - return(_1, 32) + let memPos := mload(_1) + mstore(memPos, var) + return(memPos, add(sub(memPos, memPos), 32)) } case 0x793816ec { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let _4 := sload(0) - let memPos := mload(_2) - mstore(memPos, _4) - return(memPos, 32) + let _2 := sload(0) + let memPos_1 := mload(_1) + mstore(memPos_1, _2) + return(memPos_1, add(sub(memPos_1, memPos_1), 32)) } case 0x9942ec6f { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let _5 := sload(0) - if eq(_5, sub(shl(255, 1), 1)) + let _3 := sload(0) + if eq(_3, sub(shl(255, 1), 1)) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) revert(0, 0x24) } - let ret := add(_5, 1) + let ret := add(_3, 1) sstore(0, ret) /// @src 0:410:418 \"this.f()\" - let _6 := /** @src 0:79:435 \"contract C...\" */ mload(_2) + let _4 := /** @src 0:79:435 \"contract C...\" */ mload(_1) /// @src 0:410:418 \"this.f()\" - mstore(_6, /** @src 0:79:435 \"contract C...\" */ shl(228, 0x026121ff)) + mstore(_4, /** @src 0:79:435 \"contract C...\" */ shl(228, 0x026121ff)) /// @src 0:410:418 \"this.f()\" - let _7 := staticcall(gas(), /** @src 0:410:414 \"this\" */ address(), /** @src 0:410:418 \"this.f()\" */ _6, /** @src 0:79:435 \"contract C...\" */ 4, /** @src 0:410:418 \"this.f()\" */ _6, 32) - if iszero(_7) + let _5 := staticcall(gas(), /** @src 0:410:414 \"this\" */ address(), /** @src 0:410:418 \"this.f()\" */ _4, add(sub(_4, _4), /** @src 0:79:435 \"contract C...\" */ 4), /** @src 0:410:418 \"this.f()\" */ _4, 32) + if iszero(_5) { /// @src 0:79:435 \"contract C...\" - let pos := mload(_2) + let pos := mload(_1) returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } /// @src 0:410:418 \"this.f()\" let expr := /** @src 0:79:435 \"contract C...\" */ 0 /// @src 0:410:418 \"this.f()\" - if _7 + if _5 { - let _8 := 32 - if gt(32, returndatasize()) { _8 := returndatasize() } + let _6 := 32 + if gt(32, returndatasize()) { _6 := returndatasize() } /// @src 0:79:435 \"contract C...\" - let newFreePtr := add(_6, and(add(_8, 31), not(31))) - if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _6)) + let newFreePtr := add(_4, and(add(_6, 31), not(31))) + if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _4)) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) revert(0, 0x24) } - mstore(_2, newFreePtr) - if slt(sub(/** @src 0:410:418 \"this.f()\" */ add(_6, _8), /** @src 0:79:435 \"contract C...\" */ _6), /** @src 0:410:418 \"this.f()\" */ 32) + mstore(_1, newFreePtr) + if slt(sub(/** @src 0:410:418 \"this.f()\" */ add(_4, _6), /** @src 0:79:435 \"contract C...\" */ _4), /** @src 0:410:418 \"this.f()\" */ 32) /// @src 0:79:435 \"contract C...\" { revert(0, 0) } /// @src 0:410:418 \"this.f()\" - expr := /** @src 0:79:435 \"contract C...\" */ mload(_6) + expr := /** @src 0:79:435 \"contract C...\" */ mload(_4) } /// @src 0:399:418 \"stateVar + this.f()\" let expr_1 := checked_add_int256(ret, expr) /// @src 0:392:429 \"return stateVar + this.f() + immutVar\" - let var := /** @src 0:399:429 \"stateVar + this.f() + immutVar\" */ checked_add_int256(expr_1, /** @src 0:421:429 \"immutVar\" */ loadimmutable(\"8\")) + let var_1 := /** @src 0:399:429 \"stateVar + this.f() + immutVar\" */ checked_add_int256(expr_1, /** @src 0:421:429 \"immutVar\" */ loadimmutable(\"8\")) /// @src 0:79:435 \"contract C...\" - let memPos_1 := mload(_2) - mstore(memPos_1, var) - return(memPos_1, /** @src 0:410:418 \"this.f()\" */ 32) + let memPos_2 := mload(_1) + mstore(memPos_2, var_1) + return(memPos_2, add(sub(memPos_2, memPos_2), /** @src 0:410:418 \"this.f()\" */ 32)) } case /** @src 0:79:435 \"contract C...\" */ 0xa00b982b { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let memPos_2 := mload(_2) - mstore(memPos_2, /** @src 0:124:126 \"41\" */ 0x29) + let memPos_3 := mload(_1) + mstore(memPos_3, /** @src 0:124:126 \"41\" */ 0x29) /// @src 0:79:435 \"contract C...\" - return(memPos_2, 32) + return(memPos_3, add(sub(memPos_3, memPos_3), 32)) } } revert(0, 0) } + function checked_add_int256_1129(y) -> sum + { + sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 0:79:435 \"contract C...\" */ y) + let _1 := slt(sum, y) + let _2 := slt(/** @src 0:124:126 \"41\" */ 0x29, /** @src 0:79:435 \"contract C...\" */ 0) + if or(and(iszero(_2), _1), and(_2, iszero(_1))) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x11) + revert(0, 0x24) + } + } function checked_add_int256(x, y) -> sum { sum := add(x, y) @@ -1478,19 +1483,22 @@ object \"D_72\" { mstore(128, 0x2a) /// @src 1:91:166 \"contract D is C(3)...\" let sum := add(/** @src 1:107:108 \"3\" */ 0x03, /** @src 1:91:166 \"contract D is C(3)...\" */ value) - if and(1, slt(sum, value)) + let _2 := slt(sum, value) + let _3 := slt(/** @src 1:107:108 \"3\" */ 0x03, /** @src -1:-1:-1 */ 0) + /// @src 1:91:166 \"contract D is C(3)...\" + if or(and(iszero(_3), _2), and(_3, iszero(_2))) { mstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(224, 0x4e487b71)) mstore(4, 0x11) revert(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ 0x24) } sstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ sum) - let _2 := mload(64) - let _3 := datasize(\"D_72_deployed\") - codecopy(_2, dataoffset(\"D_72_deployed\"), _3) - setimmutable(_2, \"8\", mload(/** @src 0:154:156 \"42\" */ 128)) + let _4 := mload(64) + let _5 := datasize(\"D_72_deployed\") + codecopy(_4, dataoffset(\"D_72_deployed\"), _5) + setimmutable(_4, \"8\", mload(/** @src 0:154:156 \"42\" */ 128)) /// @src 1:91:166 \"contract D is C(3)...\" - return(_2, _3) + return(_4, _5) } } /// @use-src 0:\"C\", 1:\"D\" @@ -1498,103 +1506,108 @@ object \"D_72\" { code { { /// @src 1:91:166 \"contract D is C(3)...\" - let _1 := memoryguard(0x80) - let _2 := 64 - mstore(_2, _1) + let _1 := 64 + mstore(_1, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { switch shr(224, calldataload(0)) case 0x26121ff0 { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - /// @src 0:297:305 \"immutVar\" - let _3 := loadimmutable(\"8\") + /// @src 0:279:305 \"return constVar + immutVar\" + let var := /** @src 0:286:305 \"constVar + immutVar\" */ checked_add_int256_1129(/** @src 0:297:305 \"immutVar\" */ loadimmutable(\"8\")) /// @src 1:91:166 \"contract D is C(3)...\" - let sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 1:91:166 \"contract D is C(3)...\" */ _3) - if and(1, slt(sum, _3)) - { - mstore(0, shl(224, 0x4e487b71)) - mstore(4, 0x11) - revert(0, 0x24) - } - mstore(_1, sum) - return(_1, 32) + let memPos := mload(_1) + mstore(memPos, var) + return(memPos, add(sub(memPos, memPos), 32)) } case 0x793816ec { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let _4 := sload(0) - let memPos := mload(_2) - mstore(memPos, _4) - return(memPos, 32) + let _2 := sload(0) + let memPos_1 := mload(_1) + mstore(memPos_1, _2) + return(memPos_1, add(sub(memPos_1, memPos_1), 32)) } case 0x9942ec6f { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let _5 := sload(0) - if eq(_5, sub(shl(255, 1), 1)) + let _3 := sload(0) + if eq(_3, sub(shl(255, 1), 1)) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) revert(0, 0x24) } - let ret := add(_5, 1) + let ret := add(_3, 1) sstore(0, ret) /// @src 0:410:418 \"this.f()\" - let _6 := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(_2) + let _4 := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(_1) /// @src 0:410:418 \"this.f()\" - mstore(_6, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(228, 0x026121ff)) + mstore(_4, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(228, 0x026121ff)) /// @src 0:410:418 \"this.f()\" - let _7 := staticcall(gas(), /** @src 0:410:414 \"this\" */ address(), /** @src 0:410:418 \"this.f()\" */ _6, /** @src 1:91:166 \"contract D is C(3)...\" */ 4, /** @src 0:410:418 \"this.f()\" */ _6, 32) - if iszero(_7) + let _5 := staticcall(gas(), /** @src 0:410:414 \"this\" */ address(), /** @src 0:410:418 \"this.f()\" */ _4, add(sub(_4, _4), /** @src 1:91:166 \"contract D is C(3)...\" */ 4), /** @src 0:410:418 \"this.f()\" */ _4, 32) + if iszero(_5) { /// @src 1:91:166 \"contract D is C(3)...\" - let pos := mload(_2) + let pos := mload(_1) returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } /// @src 0:410:418 \"this.f()\" let expr := /** @src 1:91:166 \"contract D is C(3)...\" */ 0 /// @src 0:410:418 \"this.f()\" - if _7 + if _5 { - let _8 := 32 - if gt(32, returndatasize()) { _8 := returndatasize() } + let _6 := 32 + if gt(32, returndatasize()) { _6 := returndatasize() } /// @src 1:91:166 \"contract D is C(3)...\" - let newFreePtr := add(_6, and(add(_8, 31), not(31))) - if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _6)) + let newFreePtr := add(_4, and(add(_6, 31), not(31))) + if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _4)) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) revert(0, 0x24) } - mstore(_2, newFreePtr) - if slt(sub(/** @src 0:410:418 \"this.f()\" */ add(_6, _8), /** @src 1:91:166 \"contract D is C(3)...\" */ _6), /** @src 0:410:418 \"this.f()\" */ 32) + mstore(_1, newFreePtr) + if slt(sub(/** @src 0:410:418 \"this.f()\" */ add(_4, _6), /** @src 1:91:166 \"contract D is C(3)...\" */ _4), /** @src 0:410:418 \"this.f()\" */ 32) /// @src 1:91:166 \"contract D is C(3)...\" { revert(0, 0) } /// @src 0:410:418 \"this.f()\" - expr := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(_6) + expr := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(_4) } /// @src 0:399:418 \"stateVar + this.f()\" let expr_1 := checked_add_int256(ret, expr) /// @src 0:392:429 \"return stateVar + this.f() + immutVar\" - let var := /** @src 0:399:429 \"stateVar + this.f() + immutVar\" */ checked_add_int256(expr_1, /** @src 0:421:429 \"immutVar\" */ loadimmutable(\"8\")) + let var_1 := /** @src 0:399:429 \"stateVar + this.f() + immutVar\" */ checked_add_int256(expr_1, /** @src 0:421:429 \"immutVar\" */ loadimmutable(\"8\")) /// @src 1:91:166 \"contract D is C(3)...\" - let memPos_1 := mload(_2) - mstore(memPos_1, var) - return(memPos_1, /** @src 0:410:418 \"this.f()\" */ 32) + let memPos_2 := mload(_1) + mstore(memPos_2, var_1) + return(memPos_2, add(sub(memPos_2, memPos_2), /** @src 0:410:418 \"this.f()\" */ 32)) } case /** @src 1:91:166 \"contract D is C(3)...\" */ 0xa00b982b { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } - let memPos_2 := mload(_2) - mstore(memPos_2, /** @src 0:124:126 \"41\" */ 0x29) + let memPos_3 := mload(_1) + mstore(memPos_3, /** @src 0:124:126 \"41\" */ 0x29) /// @src 1:91:166 \"contract D is C(3)...\" - return(memPos_2, 32) + return(memPos_3, add(sub(memPos_3, memPos_3), 32)) } } revert(0, 0) } + function checked_add_int256_1129(y) -> sum + { + sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 1:91:166 \"contract D is C(3)...\" */ y) + let _1 := slt(sum, y) + let _2 := slt(/** @src 0:124:126 \"41\" */ 0x29, /** @src 1:91:166 \"contract D is C(3)...\" */ 0) + if or(and(iszero(_2), _1), and(_2, iszero(_1))) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x11) + revert(0, 0x24) + } + } function checked_add_int256(x, y) -> sum { sum := add(x, y) diff --git a/test/cmdlineTests/standard_optimizer_generatedSources/output.json b/test/cmdlineTests/standard_optimizer_generatedSources/output.json index da2c31cbee25..07db8f8cb091 100644 --- a/test/cmdlineTests/standard_optimizer_generatedSources/output.json +++ b/test/cmdlineTests/standard_optimizer_generatedSources/output.json @@ -19,9 +19,9 @@ { "ast": { - "nativeSrc": "0:1445:1", + "nativeSrc": "0:1538:1", "nodeType": "YulBlock", - "src": "0:1445:1", + "src": "0:1538:1", "statements": [ { @@ -182,21 +182,92 @@ { "body": { - "nativeSrc": "241:1020:1", + "nativeSrc": "195:33:1", "nodeType": "YulBlock", - "src": "241:1020:1", + "src": "195:33:1", "statements": [ { - "nativeSrc": "251:12:1", + "nativeSrc": "197:29:1", + "nodeType": "YulAssignment", + "src": "197:29:1", + "value": + { + "arguments": + [ + { + "name": "offset", + "nativeSrc": "219:6:1", + "nodeType": "YulIdentifier", + "src": "219:6:1" + } + ], + "functionName": + { + "name": "calldataload", + "nativeSrc": "206:12:1", + "nodeType": "YulIdentifier", + "src": "206:12:1" + }, + "nativeSrc": "206:20:1", + "nodeType": "YulFunctionCall", + "src": "206:20:1" + }, + "variableNames": + [ + { + "name": "value", + "nativeSrc": "197:5:1", + "nodeType": "YulIdentifier", + "src": "197:5:1" + } + ] + } + ] + }, + "name": "abi_decode_uint256", + "nativeSrc": "146:82:1", + "nodeType": "YulFunctionDefinition", + "parameters": + [ + { + "name": "offset", + "nativeSrc": "174:6:1", + "nodeType": "YulTypedName", + "src": "174:6:1", + "type": "" + } + ], + "returnVariables": + [ + { + "name": "value", + "nativeSrc": "185:5:1", + "nodeType": "YulTypedName", + "src": "185:5:1", + "type": "" + } + ], + "src": "146:82:1" + }, + { + "body": + { + "nativeSrc": "328:1026:1", + "nodeType": "YulBlock", + "src": "328:1026:1", + "statements": + [ + { + "nativeSrc": "338:12:1", "nodeType": "YulVariableDeclaration", - "src": "251:12:1", + "src": "338:12:1", "value": { "kind": "number", - "nativeSrc": "261:2:1", + "nativeSrc": "348:2:1", "nodeType": "YulLiteral", - "src": "261:2:1", + "src": "348:2:1", "type": "", "value": "32" }, @@ -204,9 +275,9 @@ [ { "name": "_1", - "nativeSrc": "255:2:1", + "nativeSrc": "342:2:1", "nodeType": "YulTypedName", - "src": "255:2:1", + "src": "342:2:1", "type": "" } ] @@ -214,9 +285,9 @@ { "body": { - "nativeSrc": "308:16:1", + "nativeSrc": "395:16:1", "nodeType": "YulBlock", - "src": "308:16:1", + "src": "395:16:1", "statements": [ { @@ -226,17 +297,17 @@ [ { "kind": "number", - "nativeSrc": "317:1:1", + "nativeSrc": "404:1:1", "nodeType": "YulLiteral", - "src": "317:1:1", + "src": "404:1:1", "type": "", "value": "0" }, { "kind": "number", - "nativeSrc": "320:1:1", + "nativeSrc": "407:1:1", "nodeType": "YulLiteral", - "src": "320:1:1", + "src": "407:1:1", "type": "", "value": "0" } @@ -244,17 +315,17 @@ "functionName": { "name": "revert", - "nativeSrc": "310:6:1", + "nativeSrc": "397:6:1", "nodeType": "YulIdentifier", - "src": "310:6:1" + "src": "397:6:1" }, - "nativeSrc": "310:12:1", + "nativeSrc": "397:12:1", "nodeType": "YulFunctionCall", - "src": "310:12:1" + "src": "397:12:1" }, - "nativeSrc": "310:12:1", + "nativeSrc": "397:12:1", "nodeType": "YulExpressionStatement", - "src": "310:12:1" + "src": "397:12:1" } ] }, @@ -267,97 +338,97 @@ [ { "name": "dataEnd", - "nativeSrc": "283:7:1", + "nativeSrc": "370:7:1", "nodeType": "YulIdentifier", - "src": "283:7:1" + "src": "370:7:1" }, { "name": "headStart", - "nativeSrc": "292:9:1", + "nativeSrc": "379:9:1", "nodeType": "YulIdentifier", - "src": "292:9:1" + "src": "379:9:1" } ], "functionName": { "name": "sub", - "nativeSrc": "279:3:1", + "nativeSrc": "366:3:1", "nodeType": "YulIdentifier", - "src": "279:3:1" + "src": "366:3:1" }, - "nativeSrc": "279:23:1", + "nativeSrc": "366:23:1", "nodeType": "YulFunctionCall", - "src": "279:23:1" + "src": "366:23:1" }, { "name": "_1", - "nativeSrc": "304:2:1", + "nativeSrc": "391:2:1", "nodeType": "YulIdentifier", - "src": "304:2:1" + "src": "391:2:1" } ], "functionName": { "name": "slt", - "nativeSrc": "275:3:1", + "nativeSrc": "362:3:1", "nodeType": "YulIdentifier", - "src": "275:3:1" + "src": "362:3:1" }, - "nativeSrc": "275:32:1", + "nativeSrc": "362:32:1", "nodeType": "YulFunctionCall", - "src": "275:32:1" + "src": "362:32:1" }, - "nativeSrc": "272:52:1", + "nativeSrc": "359:52:1", "nodeType": "YulIf", - "src": "272:52:1" + "src": "359:52:1" }, { - "nativeSrc": "333:37:1", + "nativeSrc": "420:37:1", "nodeType": "YulVariableDeclaration", - "src": "333:37:1", + "src": "420:37:1", "value": { "arguments": [ { "name": "headStart", - "nativeSrc": "360:9:1", + "nativeSrc": "447:9:1", "nodeType": "YulIdentifier", - "src": "360:9:1" + "src": "447:9:1" } ], "functionName": { "name": "calldataload", - "nativeSrc": "347:12:1", + "nativeSrc": "434:12:1", "nodeType": "YulIdentifier", - "src": "347:12:1" + "src": "434:12:1" }, - "nativeSrc": "347:23:1", + "nativeSrc": "434:23:1", "nodeType": "YulFunctionCall", - "src": "347:23:1" + "src": "434:23:1" }, "variables": [ { "name": "offset", - "nativeSrc": "337:6:1", + "nativeSrc": "424:6:1", "nodeType": "YulTypedName", - "src": "337:6:1", + "src": "424:6:1", "type": "" } ] }, { - "nativeSrc": "379:28:1", + "nativeSrc": "466:28:1", "nodeType": "YulVariableDeclaration", - "src": "379:28:1", + "src": "466:28:1", "value": { "kind": "number", - "nativeSrc": "389:18:1", + "nativeSrc": "476:18:1", "nodeType": "YulLiteral", - "src": "389:18:1", + "src": "476:18:1", "type": "", "value": "0xffffffffffffffff" }, @@ -365,9 +436,9 @@ [ { "name": "_2", - "nativeSrc": "383:2:1", + "nativeSrc": "470:2:1", "nodeType": "YulTypedName", - "src": "383:2:1", + "src": "470:2:1", "type": "" } ] @@ -375,9 +446,9 @@ { "body": { - "nativeSrc": "434:16:1", + "nativeSrc": "521:16:1", "nodeType": "YulBlock", - "src": "434:16:1", + "src": "521:16:1", "statements": [ { @@ -387,17 +458,17 @@ [ { "kind": "number", - "nativeSrc": "443:1:1", + "nativeSrc": "530:1:1", "nodeType": "YulLiteral", - "src": "443:1:1", + "src": "530:1:1", "type": "", "value": "0" }, { "kind": "number", - "nativeSrc": "446:1:1", + "nativeSrc": "533:1:1", "nodeType": "YulLiteral", - "src": "446:1:1", + "src": "533:1:1", "type": "", "value": "0" } @@ -405,17 +476,17 @@ "functionName": { "name": "revert", - "nativeSrc": "436:6:1", + "nativeSrc": "523:6:1", "nodeType": "YulIdentifier", - "src": "436:6:1" + "src": "523:6:1" }, - "nativeSrc": "436:12:1", + "nativeSrc": "523:12:1", "nodeType": "YulFunctionCall", - "src": "436:12:1" + "src": "523:12:1" }, - "nativeSrc": "436:12:1", + "nativeSrc": "523:12:1", "nodeType": "YulExpressionStatement", - "src": "436:12:1" + "src": "523:12:1" } ] }, @@ -425,71 +496,71 @@ [ { "name": "offset", - "nativeSrc": "422:6:1", + "nativeSrc": "509:6:1", "nodeType": "YulIdentifier", - "src": "422:6:1" + "src": "509:6:1" }, { "name": "_2", - "nativeSrc": "430:2:1", + "nativeSrc": "517:2:1", "nodeType": "YulIdentifier", - "src": "430:2:1" + "src": "517:2:1" } ], "functionName": { "name": "gt", - "nativeSrc": "419:2:1", + "nativeSrc": "506:2:1", "nodeType": "YulIdentifier", - "src": "419:2:1" + "src": "506:2:1" }, - "nativeSrc": "419:14:1", + "nativeSrc": "506:14:1", "nodeType": "YulFunctionCall", - "src": "419:14:1" + "src": "506:14:1" }, - "nativeSrc": "416:34:1", + "nativeSrc": "503:34:1", "nodeType": "YulIf", - "src": "416:34:1" + "src": "503:34:1" }, { - "nativeSrc": "459:32:1", + "nativeSrc": "546:32:1", "nodeType": "YulVariableDeclaration", - "src": "459:32:1", + "src": "546:32:1", "value": { "arguments": [ { "name": "headStart", - "nativeSrc": "473:9:1", + "nativeSrc": "560:9:1", "nodeType": "YulIdentifier", - "src": "473:9:1" + "src": "560:9:1" }, { "name": "offset", - "nativeSrc": "484:6:1", + "nativeSrc": "571:6:1", "nodeType": "YulIdentifier", - "src": "484:6:1" + "src": "571:6:1" } ], "functionName": { "name": "add", - "nativeSrc": "469:3:1", + "nativeSrc": "556:3:1", "nodeType": "YulIdentifier", - "src": "469:3:1" + "src": "556:3:1" }, - "nativeSrc": "469:22:1", + "nativeSrc": "556:22:1", "nodeType": "YulFunctionCall", - "src": "469:22:1" + "src": "556:22:1" }, "variables": [ { "name": "_3", - "nativeSrc": "463:2:1", + "nativeSrc": "550:2:1", "nodeType": "YulTypedName", - "src": "463:2:1", + "src": "550:2:1", "type": "" } ] @@ -497,9 +568,9 @@ { "body": { - "nativeSrc": "539:16:1", + "nativeSrc": "626:16:1", "nodeType": "YulBlock", - "src": "539:16:1", + "src": "626:16:1", "statements": [ { @@ -509,17 +580,17 @@ [ { "kind": "number", - "nativeSrc": "548:1:1", + "nativeSrc": "635:1:1", "nodeType": "YulLiteral", - "src": "548:1:1", + "src": "635:1:1", "type": "", "value": "0" }, { "kind": "number", - "nativeSrc": "551:1:1", + "nativeSrc": "638:1:1", "nodeType": "YulLiteral", - "src": "551:1:1", + "src": "638:1:1", "type": "", "value": "0" } @@ -527,17 +598,17 @@ "functionName": { "name": "revert", - "nativeSrc": "541:6:1", + "nativeSrc": "628:6:1", "nodeType": "YulIdentifier", - "src": "541:6:1" + "src": "628:6:1" }, - "nativeSrc": "541:12:1", + "nativeSrc": "628:12:1", "nodeType": "YulFunctionCall", - "src": "541:12:1" + "src": "628:12:1" }, - "nativeSrc": "541:12:1", + "nativeSrc": "628:12:1", "nodeType": "YulExpressionStatement", - "src": "541:12:1" + "src": "628:12:1" } ] }, @@ -553,15 +624,15 @@ [ { "name": "_3", - "nativeSrc": "518:2:1", + "nativeSrc": "605:2:1", "nodeType": "YulIdentifier", - "src": "518:2:1" + "src": "605:2:1" }, { "kind": "number", - "nativeSrc": "522:4:1", + "nativeSrc": "609:4:1", "nodeType": "YulLiteral", - "src": "522:4:1", + "src": "609:4:1", "type": "", "value": "0x1f" } @@ -569,81 +640,81 @@ "functionName": { "name": "add", - "nativeSrc": "514:3:1", + "nativeSrc": "601:3:1", "nodeType": "YulIdentifier", - "src": "514:3:1" + "src": "601:3:1" }, - "nativeSrc": "514:13:1", + "nativeSrc": "601:13:1", "nodeType": "YulFunctionCall", - "src": "514:13:1" + "src": "601:13:1" }, { "name": "dataEnd", - "nativeSrc": "529:7:1", + "nativeSrc": "616:7:1", "nodeType": "YulIdentifier", - "src": "529:7:1" + "src": "616:7:1" } ], "functionName": { "name": "slt", - "nativeSrc": "510:3:1", + "nativeSrc": "597:3:1", "nodeType": "YulIdentifier", - "src": "510:3:1" + "src": "597:3:1" }, - "nativeSrc": "510:27:1", + "nativeSrc": "597:27:1", "nodeType": "YulFunctionCall", - "src": "510:27:1" + "src": "597:27:1" } ], "functionName": { "name": "iszero", - "nativeSrc": "503:6:1", + "nativeSrc": "590:6:1", "nodeType": "YulIdentifier", - "src": "503:6:1" + "src": "590:6:1" }, - "nativeSrc": "503:35:1", + "nativeSrc": "590:35:1", "nodeType": "YulFunctionCall", - "src": "503:35:1" + "src": "590:35:1" }, - "nativeSrc": "500:55:1", + "nativeSrc": "587:55:1", "nodeType": "YulIf", - "src": "500:55:1" + "src": "587:55:1" }, { - "nativeSrc": "564:26:1", + "nativeSrc": "651:26:1", "nodeType": "YulVariableDeclaration", - "src": "564:26:1", + "src": "651:26:1", "value": { "arguments": [ { "name": "_3", - "nativeSrc": "587:2:1", + "nativeSrc": "674:2:1", "nodeType": "YulIdentifier", - "src": "587:2:1" + "src": "674:2:1" } ], "functionName": { "name": "calldataload", - "nativeSrc": "574:12:1", + "nativeSrc": "661:12:1", "nodeType": "YulIdentifier", - "src": "574:12:1" + "src": "661:12:1" }, - "nativeSrc": "574:16:1", + "nativeSrc": "661:16:1", "nodeType": "YulFunctionCall", - "src": "574:16:1" + "src": "661:16:1" }, "variables": [ { "name": "_4", - "nativeSrc": "568:2:1", + "nativeSrc": "655:2:1", "nodeType": "YulTypedName", - "src": "568:2:1", + "src": "655:2:1", "type": "" } ] @@ -651,9 +722,9 @@ { "body": { - "nativeSrc": "613:22:1", + "nativeSrc": "700:22:1", "nodeType": "YulBlock", - "src": "613:22:1", + "src": "700:22:1", "statements": [ { @@ -663,17 +734,17 @@ "functionName": { "name": "panic_error_0x41", - "nativeSrc": "615:16:1", + "nativeSrc": "702:16:1", "nodeType": "YulIdentifier", - "src": "615:16:1" + "src": "702:16:1" }, - "nativeSrc": "615:18:1", + "nativeSrc": "702:18:1", "nodeType": "YulFunctionCall", - "src": "615:18:1" + "src": "702:18:1" }, - "nativeSrc": "615:18:1", + "nativeSrc": "702:18:1", "nodeType": "YulExpressionStatement", - "src": "615:18:1" + "src": "702:18:1" } ] }, @@ -683,90 +754,90 @@ [ { "name": "_4", - "nativeSrc": "605:2:1", + "nativeSrc": "692:2:1", "nodeType": "YulIdentifier", - "src": "605:2:1" + "src": "692:2:1" }, { "name": "_2", - "nativeSrc": "609:2:1", + "nativeSrc": "696:2:1", "nodeType": "YulIdentifier", - "src": "609:2:1" + "src": "696:2:1" } ], "functionName": { "name": "gt", - "nativeSrc": "602:2:1", + "nativeSrc": "689:2:1", "nodeType": "YulIdentifier", - "src": "602:2:1" + "src": "689:2:1" }, - "nativeSrc": "602:10:1", + "nativeSrc": "689:10:1", "nodeType": "YulFunctionCall", - "src": "602:10:1" + "src": "689:10:1" }, - "nativeSrc": "599:36:1", + "nativeSrc": "686:36:1", "nodeType": "YulIf", - "src": "599:36:1" + "src": "686:36:1" }, { - "nativeSrc": "644:20:1", + "nativeSrc": "731:20:1", "nodeType": "YulVariableDeclaration", - "src": "644:20:1", + "src": "731:20:1", "value": { "arguments": [ { "kind": "number", - "nativeSrc": "658:1:1", + "nativeSrc": "745:1:1", "nodeType": "YulLiteral", - "src": "658:1:1", + "src": "745:1:1", "type": "", "value": "5" }, { "name": "_4", - "nativeSrc": "661:2:1", + "nativeSrc": "748:2:1", "nodeType": "YulIdentifier", - "src": "661:2:1" + "src": "748:2:1" } ], "functionName": { "name": "shl", - "nativeSrc": "654:3:1", + "nativeSrc": "741:3:1", "nodeType": "YulIdentifier", - "src": "654:3:1" + "src": "741:3:1" }, - "nativeSrc": "654:10:1", + "nativeSrc": "741:10:1", "nodeType": "YulFunctionCall", - "src": "654:10:1" + "src": "741:10:1" }, "variables": [ { "name": "_5", - "nativeSrc": "648:2:1", + "nativeSrc": "735:2:1", "nodeType": "YulTypedName", - "src": "648:2:1", + "src": "735:2:1", "type": "" } ] }, { - "nativeSrc": "673:23:1", + "nativeSrc": "760:23:1", "nodeType": "YulVariableDeclaration", - "src": "673:23:1", + "src": "760:23:1", "value": { "arguments": [ { "kind": "number", - "nativeSrc": "693:2:1", + "nativeSrc": "780:2:1", "nodeType": "YulLiteral", - "src": "693:2:1", + "src": "780:2:1", "type": "", "value": "64" } @@ -774,38 +845,38 @@ "functionName": { "name": "mload", - "nativeSrc": "687:5:1", + "nativeSrc": "774:5:1", "nodeType": "YulIdentifier", - "src": "687:5:1" + "src": "774:5:1" }, - "nativeSrc": "687:9:1", + "nativeSrc": "774:9:1", "nodeType": "YulFunctionCall", - "src": "687:9:1" + "src": "774:9:1" }, "variables": [ { "name": "memPtr", - "nativeSrc": "677:6:1", + "nativeSrc": "764:6:1", "nodeType": "YulTypedName", - "src": "677:6:1", + "src": "764:6:1", "type": "" } ] }, { - "nativeSrc": "705:56:1", + "nativeSrc": "792:56:1", "nodeType": "YulVariableDeclaration", - "src": "705:56:1", + "src": "792:56:1", "value": { "arguments": [ { "name": "memPtr", - "nativeSrc": "727:6:1", + "nativeSrc": "814:6:1", "nodeType": "YulIdentifier", - "src": "727:6:1" + "src": "814:6:1" }, { "arguments": @@ -815,15 +886,15 @@ [ { "name": "_5", - "nativeSrc": "743:2:1", + "nativeSrc": "830:2:1", "nodeType": "YulIdentifier", - "src": "743:2:1" + "src": "830:2:1" }, { "kind": "number", - "nativeSrc": "747:2:1", + "nativeSrc": "834:2:1", "nodeType": "YulLiteral", - "src": "747:2:1", + "src": "834:2:1", "type": "", "value": "63" } @@ -831,22 +902,22 @@ "functionName": { "name": "add", - "nativeSrc": "739:3:1", + "nativeSrc": "826:3:1", "nodeType": "YulIdentifier", - "src": "739:3:1" + "src": "826:3:1" }, - "nativeSrc": "739:11:1", + "nativeSrc": "826:11:1", "nodeType": "YulFunctionCall", - "src": "739:11:1" + "src": "826:11:1" }, { "arguments": [ { "kind": "number", - "nativeSrc": "756:2:1", + "nativeSrc": "843:2:1", "nodeType": "YulLiteral", - "src": "756:2:1", + "src": "843:2:1", "type": "", "value": "31" } @@ -854,45 +925,45 @@ "functionName": { "name": "not", - "nativeSrc": "752:3:1", + "nativeSrc": "839:3:1", "nodeType": "YulIdentifier", - "src": "752:3:1" + "src": "839:3:1" }, - "nativeSrc": "752:7:1", + "nativeSrc": "839:7:1", "nodeType": "YulFunctionCall", - "src": "752:7:1" + "src": "839:7:1" } ], "functionName": { "name": "and", - "nativeSrc": "735:3:1", + "nativeSrc": "822:3:1", "nodeType": "YulIdentifier", - "src": "735:3:1" + "src": "822:3:1" }, - "nativeSrc": "735:25:1", + "nativeSrc": "822:25:1", "nodeType": "YulFunctionCall", - "src": "735:25:1" + "src": "822:25:1" } ], "functionName": { "name": "add", - "nativeSrc": "723:3:1", + "nativeSrc": "810:3:1", "nodeType": "YulIdentifier", - "src": "723:3:1" + "src": "810:3:1" }, - "nativeSrc": "723:38:1", + "nativeSrc": "810:38:1", "nodeType": "YulFunctionCall", - "src": "723:38:1" + "src": "810:38:1" }, "variables": [ { "name": "newFreePtr", - "nativeSrc": "709:10:1", + "nativeSrc": "796:10:1", "nodeType": "YulTypedName", - "src": "709:10:1", + "src": "796:10:1", "type": "" } ] @@ -900,9 +971,9 @@ { "body": { - "nativeSrc": "820:22:1", + "nativeSrc": "907:22:1", "nodeType": "YulBlock", - "src": "820:22:1", + "src": "907:22:1", "statements": [ { @@ -912,17 +983,17 @@ "functionName": { "name": "panic_error_0x41", - "nativeSrc": "822:16:1", + "nativeSrc": "909:16:1", "nodeType": "YulIdentifier", - "src": "822:16:1" + "src": "909:16:1" }, - "nativeSrc": "822:18:1", + "nativeSrc": "909:18:1", "nodeType": "YulFunctionCall", - "src": "822:18:1" + "src": "909:18:1" }, - "nativeSrc": "822:18:1", + "nativeSrc": "909:18:1", "nodeType": "YulExpressionStatement", - "src": "822:18:1" + "src": "909:18:1" } ] }, @@ -935,70 +1006,70 @@ [ { "name": "newFreePtr", - "nativeSrc": "779:10:1", + "nativeSrc": "866:10:1", "nodeType": "YulIdentifier", - "src": "779:10:1" + "src": "866:10:1" }, { "name": "_2", - "nativeSrc": "791:2:1", + "nativeSrc": "878:2:1", "nodeType": "YulIdentifier", - "src": "791:2:1" + "src": "878:2:1" } ], "functionName": { "name": "gt", - "nativeSrc": "776:2:1", + "nativeSrc": "863:2:1", "nodeType": "YulIdentifier", - "src": "776:2:1" + "src": "863:2:1" }, - "nativeSrc": "776:18:1", + "nativeSrc": "863:18:1", "nodeType": "YulFunctionCall", - "src": "776:18:1" + "src": "863:18:1" }, { "arguments": [ { "name": "newFreePtr", - "nativeSrc": "799:10:1", + "nativeSrc": "886:10:1", "nodeType": "YulIdentifier", - "src": "799:10:1" + "src": "886:10:1" }, { "name": "memPtr", - "nativeSrc": "811:6:1", + "nativeSrc": "898:6:1", "nodeType": "YulIdentifier", - "src": "811:6:1" + "src": "898:6:1" } ], "functionName": { "name": "lt", - "nativeSrc": "796:2:1", + "nativeSrc": "883:2:1", "nodeType": "YulIdentifier", - "src": "796:2:1" + "src": "883:2:1" }, - "nativeSrc": "796:22:1", + "nativeSrc": "883:22:1", "nodeType": "YulFunctionCall", - "src": "796:22:1" + "src": "883:22:1" } ], "functionName": { "name": "or", - "nativeSrc": "773:2:1", + "nativeSrc": "860:2:1", "nodeType": "YulIdentifier", - "src": "773:2:1" + "src": "860:2:1" }, - "nativeSrc": "773:46:1", + "nativeSrc": "860:46:1", "nodeType": "YulFunctionCall", - "src": "773:46:1" + "src": "860:46:1" }, - "nativeSrc": "770:72:1", + "nativeSrc": "857:72:1", "nodeType": "YulIf", - "src": "770:72:1" + "src": "857:72:1" }, { "expression": @@ -1007,52 +1078,52 @@ [ { "kind": "number", - "nativeSrc": "858:2:1", + "nativeSrc": "945:2:1", "nodeType": "YulLiteral", - "src": "858:2:1", + "src": "945:2:1", "type": "", "value": "64" }, { "name": "newFreePtr", - "nativeSrc": "862:10:1", + "nativeSrc": "949:10:1", "nodeType": "YulIdentifier", - "src": "862:10:1" + "src": "949:10:1" } ], "functionName": { "name": "mstore", - "nativeSrc": "851:6:1", + "nativeSrc": "938:6:1", "nodeType": "YulIdentifier", - "src": "851:6:1" + "src": "938:6:1" }, - "nativeSrc": "851:22:1", + "nativeSrc": "938:22:1", "nodeType": "YulFunctionCall", - "src": "851:22:1" + "src": "938:22:1" }, - "nativeSrc": "851:22:1", + "nativeSrc": "938:22:1", "nodeType": "YulExpressionStatement", - "src": "851:22:1" + "src": "938:22:1" }, { - "nativeSrc": "882:17:1", + "nativeSrc": "969:17:1", "nodeType": "YulVariableDeclaration", - "src": "882:17:1", + "src": "969:17:1", "value": { "name": "memPtr", - "nativeSrc": "893:6:1", + "nativeSrc": "980:6:1", "nodeType": "YulIdentifier", - "src": "893:6:1" + "src": "980:6:1" }, "variables": [ { "name": "dst", - "nativeSrc": "886:3:1", + "nativeSrc": "973:3:1", "nodeType": "YulTypedName", - "src": "886:3:1", + "src": "973:3:1", "type": "" } ] @@ -1064,78 +1135,78 @@ [ { "name": "memPtr", - "nativeSrc": "915:6:1", + "nativeSrc": "1002:6:1", "nodeType": "YulIdentifier", - "src": "915:6:1" + "src": "1002:6:1" }, { "name": "_4", - "nativeSrc": "923:2:1", + "nativeSrc": "1010:2:1", "nodeType": "YulIdentifier", - "src": "923:2:1" + "src": "1010:2:1" } ], "functionName": { "name": "mstore", - "nativeSrc": "908:6:1", + "nativeSrc": "995:6:1", "nodeType": "YulIdentifier", - "src": "908:6:1" + "src": "995:6:1" }, - "nativeSrc": "908:18:1", + "nativeSrc": "995:18:1", "nodeType": "YulFunctionCall", - "src": "908:18:1" + "src": "995:18:1" }, - "nativeSrc": "908:18:1", + "nativeSrc": "995:18:1", "nodeType": "YulExpressionStatement", - "src": "908:18:1" + "src": "995:18:1" }, { - "nativeSrc": "935:22:1", + "nativeSrc": "1022:22:1", "nodeType": "YulAssignment", - "src": "935:22:1", + "src": "1022:22:1", "value": { "arguments": [ { "name": "memPtr", - "nativeSrc": "946:6:1", + "nativeSrc": "1033:6:1", "nodeType": "YulIdentifier", - "src": "946:6:1" + "src": "1033:6:1" }, { "name": "_1", - "nativeSrc": "954:2:1", + "nativeSrc": "1041:2:1", "nodeType": "YulIdentifier", - "src": "954:2:1" + "src": "1041:2:1" } ], "functionName": { "name": "add", - "nativeSrc": "942:3:1", + "nativeSrc": "1029:3:1", "nodeType": "YulIdentifier", - "src": "942:3:1" + "src": "1029:3:1" }, - "nativeSrc": "942:15:1", + "nativeSrc": "1029:15:1", "nodeType": "YulFunctionCall", - "src": "942:15:1" + "src": "1029:15:1" }, "variableNames": [ { "name": "dst", - "nativeSrc": "935:3:1", + "nativeSrc": "1022:3:1", "nodeType": "YulIdentifier", - "src": "935:3:1" + "src": "1022:3:1" } ] }, { - "nativeSrc": "966:34:1", + "nativeSrc": "1053:34:1", "nodeType": "YulVariableDeclaration", - "src": "966:34:1", + "src": "1053:34:1", "value": { "arguments": @@ -1145,53 +1216,53 @@ [ { "name": "_3", - "nativeSrc": "988:2:1", + "nativeSrc": "1075:2:1", "nodeType": "YulIdentifier", - "src": "988:2:1" + "src": "1075:2:1" }, { "name": "_5", - "nativeSrc": "992:2:1", + "nativeSrc": "1079:2:1", "nodeType": "YulIdentifier", - "src": "992:2:1" + "src": "1079:2:1" } ], "functionName": { "name": "add", - "nativeSrc": "984:3:1", + "nativeSrc": "1071:3:1", "nodeType": "YulIdentifier", - "src": "984:3:1" + "src": "1071:3:1" }, - "nativeSrc": "984:11:1", + "nativeSrc": "1071:11:1", "nodeType": "YulFunctionCall", - "src": "984:11:1" + "src": "1071:11:1" }, { "name": "_1", - "nativeSrc": "997:2:1", + "nativeSrc": "1084:2:1", "nodeType": "YulIdentifier", - "src": "997:2:1" + "src": "1084:2:1" } ], "functionName": { "name": "add", - "nativeSrc": "980:3:1", + "nativeSrc": "1067:3:1", "nodeType": "YulIdentifier", - "src": "980:3:1" + "src": "1067:3:1" }, - "nativeSrc": "980:20:1", + "nativeSrc": "1067:20:1", "nodeType": "YulFunctionCall", - "src": "980:20:1" + "src": "1067:20:1" }, "variables": [ { "name": "srcEnd", - "nativeSrc": "970:6:1", + "nativeSrc": "1057:6:1", "nodeType": "YulTypedName", - "src": "970:6:1", + "src": "1057:6:1", "type": "" } ] @@ -1199,9 +1270,9 @@ { "body": { - "nativeSrc": "1032:16:1", + "nativeSrc": "1119:16:1", "nodeType": "YulBlock", - "src": "1032:16:1", + "src": "1119:16:1", "statements": [ { @@ -1211,17 +1282,17 @@ [ { "kind": "number", - "nativeSrc": "1041:1:1", + "nativeSrc": "1128:1:1", "nodeType": "YulLiteral", - "src": "1041:1:1", + "src": "1128:1:1", "type": "", "value": "0" }, { "kind": "number", - "nativeSrc": "1044:1:1", + "nativeSrc": "1131:1:1", "nodeType": "YulLiteral", - "src": "1044:1:1", + "src": "1131:1:1", "type": "", "value": "0" } @@ -1229,17 +1300,17 @@ "functionName": { "name": "revert", - "nativeSrc": "1034:6:1", + "nativeSrc": "1121:6:1", "nodeType": "YulIdentifier", - "src": "1034:6:1" + "src": "1121:6:1" }, - "nativeSrc": "1034:12:1", + "nativeSrc": "1121:12:1", "nodeType": "YulFunctionCall", - "src": "1034:12:1" + "src": "1121:12:1" }, - "nativeSrc": "1034:12:1", + "nativeSrc": "1121:12:1", "nodeType": "YulExpressionStatement", - "src": "1034:12:1" + "src": "1121:12:1" } ] }, @@ -1249,71 +1320,71 @@ [ { "name": "srcEnd", - "nativeSrc": "1015:6:1", + "nativeSrc": "1102:6:1", "nodeType": "YulIdentifier", - "src": "1015:6:1" + "src": "1102:6:1" }, { "name": "dataEnd", - "nativeSrc": "1023:7:1", + "nativeSrc": "1110:7:1", "nodeType": "YulIdentifier", - "src": "1023:7:1" + "src": "1110:7:1" } ], "functionName": { "name": "gt", - "nativeSrc": "1012:2:1", + "nativeSrc": "1099:2:1", "nodeType": "YulIdentifier", - "src": "1012:2:1" + "src": "1099:2:1" }, - "nativeSrc": "1012:19:1", + "nativeSrc": "1099:19:1", "nodeType": "YulFunctionCall", - "src": "1012:19:1" + "src": "1099:19:1" }, - "nativeSrc": "1009:39:1", + "nativeSrc": "1096:39:1", "nodeType": "YulIf", - "src": "1009:39:1" + "src": "1096:39:1" }, { - "nativeSrc": "1057:22:1", + "nativeSrc": "1144:22:1", "nodeType": "YulVariableDeclaration", - "src": "1057:22:1", + "src": "1144:22:1", "value": { "arguments": [ { "name": "_3", - "nativeSrc": "1072:2:1", + "nativeSrc": "1159:2:1", "nodeType": "YulIdentifier", - "src": "1072:2:1" + "src": "1159:2:1" }, { "name": "_1", - "nativeSrc": "1076:2:1", + "nativeSrc": "1163:2:1", "nodeType": "YulIdentifier", - "src": "1076:2:1" + "src": "1163:2:1" } ], "functionName": { "name": "add", - "nativeSrc": "1068:3:1", + "nativeSrc": "1155:3:1", "nodeType": "YulIdentifier", - "src": "1068:3:1" + "src": "1155:3:1" }, - "nativeSrc": "1068:11:1", + "nativeSrc": "1155:11:1", "nodeType": "YulFunctionCall", - "src": "1068:11:1" + "src": "1155:11:1" }, "variables": [ { "name": "src", - "nativeSrc": "1061:3:1", + "nativeSrc": "1148:3:1", "nodeType": "YulTypedName", - "src": "1061:3:1", + "src": "1148:3:1", "type": "" } ] @@ -1321,9 +1392,9 @@ { "body": { - "nativeSrc": "1144:86:1", + "nativeSrc": "1231:92:1", "nodeType": "YulBlock", - "src": "1144:86:1", + "src": "1231:92:1", "statements": [ { @@ -1333,86 +1404,86 @@ [ { "name": "dst", - "nativeSrc": "1165:3:1", + "nativeSrc": "1252:3:1", "nodeType": "YulIdentifier", - "src": "1165:3:1" + "src": "1252:3:1" }, { "arguments": [ { "name": "src", - "nativeSrc": "1183:3:1", + "nativeSrc": "1276:3:1", "nodeType": "YulIdentifier", - "src": "1183:3:1" + "src": "1276:3:1" } ], "functionName": { - "name": "calldataload", - "nativeSrc": "1170:12:1", + "name": "abi_decode_uint256", + "nativeSrc": "1257:18:1", "nodeType": "YulIdentifier", - "src": "1170:12:1" + "src": "1257:18:1" }, - "nativeSrc": "1170:17:1", + "nativeSrc": "1257:23:1", "nodeType": "YulFunctionCall", - "src": "1170:17:1" + "src": "1257:23:1" } ], "functionName": { "name": "mstore", - "nativeSrc": "1158:6:1", + "nativeSrc": "1245:6:1", "nodeType": "YulIdentifier", - "src": "1158:6:1" + "src": "1245:6:1" }, - "nativeSrc": "1158:30:1", + "nativeSrc": "1245:36:1", "nodeType": "YulFunctionCall", - "src": "1158:30:1" + "src": "1245:36:1" }, - "nativeSrc": "1158:30:1", + "nativeSrc": "1245:36:1", "nodeType": "YulExpressionStatement", - "src": "1158:30:1" + "src": "1245:36:1" }, { - "nativeSrc": "1201:19:1", + "nativeSrc": "1294:19:1", "nodeType": "YulAssignment", - "src": "1201:19:1", + "src": "1294:19:1", "value": { "arguments": [ { "name": "dst", - "nativeSrc": "1212:3:1", + "nativeSrc": "1305:3:1", "nodeType": "YulIdentifier", - "src": "1212:3:1" + "src": "1305:3:1" }, { "name": "_1", - "nativeSrc": "1217:2:1", + "nativeSrc": "1310:2:1", "nodeType": "YulIdentifier", - "src": "1217:2:1" + "src": "1310:2:1" } ], "functionName": { "name": "add", - "nativeSrc": "1208:3:1", + "nativeSrc": "1301:3:1", "nodeType": "YulIdentifier", - "src": "1208:3:1" + "src": "1301:3:1" }, - "nativeSrc": "1208:12:1", + "nativeSrc": "1301:12:1", "nodeType": "YulFunctionCall", - "src": "1208:12:1" + "src": "1301:12:1" }, "variableNames": [ { "name": "dst", - "nativeSrc": "1201:3:1", + "nativeSrc": "1294:3:1", "nodeType": "YulIdentifier", - "src": "1201:3:1" + "src": "1294:3:1" } ] } @@ -1424,76 +1495,76 @@ [ { "name": "src", - "nativeSrc": "1099:3:1", + "nativeSrc": "1186:3:1", "nodeType": "YulIdentifier", - "src": "1099:3:1" + "src": "1186:3:1" }, { "name": "srcEnd", - "nativeSrc": "1104:6:1", + "nativeSrc": "1191:6:1", "nodeType": "YulIdentifier", - "src": "1104:6:1" + "src": "1191:6:1" } ], "functionName": { "name": "lt", - "nativeSrc": "1096:2:1", + "nativeSrc": "1183:2:1", "nodeType": "YulIdentifier", - "src": "1096:2:1" + "src": "1183:2:1" }, - "nativeSrc": "1096:15:1", + "nativeSrc": "1183:15:1", "nodeType": "YulFunctionCall", - "src": "1096:15:1" + "src": "1183:15:1" }, - "nativeSrc": "1088:142:1", + "nativeSrc": "1175:148:1", "nodeType": "YulForLoop", "post": { - "nativeSrc": "1112:23:1", + "nativeSrc": "1199:23:1", "nodeType": "YulBlock", - "src": "1112:23:1", + "src": "1199:23:1", "statements": [ { - "nativeSrc": "1114:19:1", + "nativeSrc": "1201:19:1", "nodeType": "YulAssignment", - "src": "1114:19:1", + "src": "1201:19:1", "value": { "arguments": [ { "name": "src", - "nativeSrc": "1125:3:1", + "nativeSrc": "1212:3:1", "nodeType": "YulIdentifier", - "src": "1125:3:1" + "src": "1212:3:1" }, { "name": "_1", - "nativeSrc": "1130:2:1", + "nativeSrc": "1217:2:1", "nodeType": "YulIdentifier", - "src": "1130:2:1" + "src": "1217:2:1" } ], "functionName": { "name": "add", - "nativeSrc": "1121:3:1", + "nativeSrc": "1208:3:1", "nodeType": "YulIdentifier", - "src": "1121:3:1" + "src": "1208:3:1" }, - "nativeSrc": "1121:12:1", + "nativeSrc": "1208:12:1", "nodeType": "YulFunctionCall", - "src": "1121:12:1" + "src": "1208:12:1" }, "variableNames": [ { "name": "src", - "nativeSrc": "1114:3:1", + "nativeSrc": "1201:3:1", "nodeType": "YulIdentifier", - "src": "1114:3:1" + "src": "1201:3:1" } ] } @@ -1501,53 +1572,53 @@ }, "pre": { - "nativeSrc": "1092:3:1", + "nativeSrc": "1179:3:1", "nodeType": "YulBlock", - "src": "1092:3:1", + "src": "1179:3:1", "statements": [] }, - "src": "1088:142:1" + "src": "1175:148:1" }, { - "nativeSrc": "1239:16:1", + "nativeSrc": "1332:16:1", "nodeType": "YulAssignment", - "src": "1239:16:1", + "src": "1332:16:1", "value": { "name": "memPtr", - "nativeSrc": "1249:6:1", + "nativeSrc": "1342:6:1", "nodeType": "YulIdentifier", - "src": "1249:6:1" + "src": "1342:6:1" }, "variableNames": [ { "name": "value0", - "nativeSrc": "1239:6:1", + "nativeSrc": "1332:6:1", "nodeType": "YulIdentifier", - "src": "1239:6:1" + "src": "1332:6:1" } ] } ] }, "name": "abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr", - "nativeSrc": "146:1115:1", + "nativeSrc": "233:1121:1", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", - "nativeSrc": "207:9:1", + "nativeSrc": "294:9:1", "nodeType": "YulTypedName", - "src": "207:9:1", + "src": "294:9:1", "type": "" }, { "name": "dataEnd", - "nativeSrc": "218:7:1", + "nativeSrc": "305:7:1", "nodeType": "YulTypedName", - "src": "218:7:1", + "src": "305:7:1", "type": "" } ], @@ -1555,41 +1626,41 @@ [ { "name": "value0", - "nativeSrc": "230:6:1", + "nativeSrc": "317:6:1", "nodeType": "YulTypedName", - "src": "230:6:1", + "src": "317:6:1", "type": "" } ], - "src": "146:1115:1" + "src": "233:1121:1" }, { "body": { - "nativeSrc": "1367:76:1", + "nativeSrc": "1460:76:1", "nodeType": "YulBlock", - "src": "1367:76:1", + "src": "1460:76:1", "statements": [ { - "nativeSrc": "1377:26:1", + "nativeSrc": "1470:26:1", "nodeType": "YulAssignment", - "src": "1377:26:1", + "src": "1470:26:1", "value": { "arguments": [ { "name": "headStart", - "nativeSrc": "1389:9:1", + "nativeSrc": "1482:9:1", "nodeType": "YulIdentifier", - "src": "1389:9:1" + "src": "1482:9:1" }, { "kind": "number", - "nativeSrc": "1400:2:1", + "nativeSrc": "1493:2:1", "nodeType": "YulLiteral", - "src": "1400:2:1", + "src": "1493:2:1", "type": "", "value": "32" } @@ -1597,21 +1668,21 @@ "functionName": { "name": "add", - "nativeSrc": "1385:3:1", + "nativeSrc": "1478:3:1", "nodeType": "YulIdentifier", - "src": "1385:3:1" + "src": "1478:3:1" }, - "nativeSrc": "1385:18:1", + "nativeSrc": "1478:18:1", "nodeType": "YulFunctionCall", - "src": "1385:18:1" + "src": "1478:18:1" }, "variableNames": [ { "name": "tail", - "nativeSrc": "1377:4:1", + "nativeSrc": "1470:4:1", "nodeType": "YulIdentifier", - "src": "1377:4:1" + "src": "1470:4:1" } ] }, @@ -1622,51 +1693,51 @@ [ { "name": "headStart", - "nativeSrc": "1419:9:1", + "nativeSrc": "1512:9:1", "nodeType": "YulIdentifier", - "src": "1419:9:1" + "src": "1512:9:1" }, { "name": "value0", - "nativeSrc": "1430:6:1", + "nativeSrc": "1523:6:1", "nodeType": "YulIdentifier", - "src": "1430:6:1" + "src": "1523:6:1" } ], "functionName": { "name": "mstore", - "nativeSrc": "1412:6:1", + "nativeSrc": "1505:6:1", "nodeType": "YulIdentifier", - "src": "1412:6:1" + "src": "1505:6:1" }, - "nativeSrc": "1412:25:1", + "nativeSrc": "1505:25:1", "nodeType": "YulFunctionCall", - "src": "1412:25:1" + "src": "1505:25:1" }, - "nativeSrc": "1412:25:1", + "nativeSrc": "1505:25:1", "nodeType": "YulExpressionStatement", - "src": "1412:25:1" + "src": "1505:25:1" } ] }, "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", - "nativeSrc": "1266:177:1", + "nativeSrc": "1359:177:1", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", - "nativeSrc": "1336:9:1", + "nativeSrc": "1429:9:1", "nodeType": "YulTypedName", - "src": "1336:9:1", + "src": "1429:9:1", "type": "" }, { "name": "value0", - "nativeSrc": "1347:6:1", + "nativeSrc": "1440:6:1", "nodeType": "YulTypedName", - "src": "1347:6:1", + "src": "1440:6:1", "type": "" } ], @@ -1674,13 +1745,13 @@ [ { "name": "tail", - "nativeSrc": "1358:4:1", + "nativeSrc": "1451:4:1", "nodeType": "YulTypedName", - "src": "1358:4:1", + "src": "1451:4:1", "type": "" } ], - "src": "1266:177:1" + "src": "1359:177:1" } ] }, @@ -1692,6 +1763,8 @@ mstore(4, 0x41) revert(0, 0x24) } + function abi_decode_uint256(offset) -> value + { value := calldataload(offset) } function abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr(headStart, dataEnd) -> value0 { let _1 := 32 @@ -1716,7 +1789,7 @@ let src := add(_3, _1) for { } lt(src, srcEnd) { src := add(src, _1) } { - mstore(dst, calldataload(src)) + mstore(dst, abi_decode_uint256(src)) dst := add(dst, _1) } value0 := memPtr diff --git a/test/cmdlineTests/viair_subobject_optimization/output b/test/cmdlineTests/viair_subobject_optimization/output index 4804d138434c..f36a0a4a4630 100644 --- a/test/cmdlineTests/viair_subobject_optimization/output +++ b/test/cmdlineTests/viair_subobject_optimization/output @@ -104,6 +104,7 @@ stop sub_0: assembly { /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ + 0x40 0x80 jumpi(tag_1, iszero(lt(calldatasize, 0x04))) 0x00 @@ -117,48 +118,44 @@ sub_0: assembly { tag_3: jumpi(tag_7, callvalue) jumpi(tag_7, slt(add(not(0x03), calldatasize), 0x00)) + /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ + 0x20 + swap2 not(0x1f) + /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ + swap1 /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ dataSize(sub_0) /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ 0x3f dup2 add - dup3 - and dup4 + and + dup5 add - swap1 - dup4 - dup3 - lt 0xffffffffffffffff - dup4 + dup2 gt + dup6 + dup3 + lt or tag_9 jumpi - swap3 - swap1 - 0x40 - swap1 0x40 mstore /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ - dup4 - dup3 + dup1 + dup5 mstore - 0x20 - swap4 dataOffset(sub_0) 0x20 - dup5 + dup6 add codecopy /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ mload(0x40) - swap4 - dup5 swap3 /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ 0x20 @@ -167,8 +164,8 @@ sub_0: assembly { mstore dup1 mload - swap3 - dup4 + swap2 + dup3 /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ 0x20 /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ @@ -177,49 +174,46 @@ sub_0: assembly { mstore 0x00 tag_11: - dup5 + dup4 dup2 lt tag_12 jumpi dup6 + dup1 0x40 - dup2 - dup10 + dup8 0x1f - dup10 + dup9 0x00 - dup6 + dup5 dup3 - dup7 + dup8 add add mstore add and - dup2 + dup3 add - sub add + sub swap1 return tag_12: dup3 dup2 add - dup5 + dup8 add mload - dup9 + dup7 dup3 add dup4 add mstore - dup8 - swap6 - pop - dup4 + dup7 add jump(tag_11) tag_9: diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index 1ab8803d28b2..0636571085c1 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -17,13 +17,13 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 639000 -// executionCost: 668 -// totalCost: 639668 +// codeDepositCost: 621000 +// executionCost: 655 +// totalCost: 621655 // external: // a(): 2283 -// b(uint256): 4649 -// f1(uint256): 304 +// b(uint256): 4666 +// f1(uint256): 321 // f2(uint256[],string[],uint16,address): infinite // f3(uint16[],string[],uint16,address): infinite // f4(uint32[],string[12],bytes[2][],address): infinite diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol index b4ef43c44172..9b7995cea73a 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol @@ -21,6 +21,6 @@ contract C { } // ---- // f() -> 0x20, 0x8, 0x40, 0x3, 0x9, 0xa, 0xb -// gas irOptimized: 203149 +// gas irOptimized: 203260 // gas legacy: 206263 // gas legacyOptimized: 203156 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol index f548c50bcf52..4090573ac82e 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol @@ -59,10 +59,10 @@ contract C { // EVMVersion: >homestead // ---- // test_bytes() -> -// gas irOptimized: 321332 +// gas irOptimized: 321957 // gas legacy: 319111 // gas legacyOptimized: 269317 // test_uint256() -> -// gas irOptimized: 447646 +// gas irOptimized: 449971 // gas legacy: 433627 // gas legacyOptimized: 365410 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol index efffab86c1cf..62d906158dbd 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol @@ -24,6 +24,6 @@ contract C { // ---- // library: L // f() -> 8, 7, 1, 2, 7, 12 -// gas irOptimized: 166475 +// gas irOptimized: 167424 // gas legacy: 169283 -// gas legacyOptimized: 167248 +// gas legacyOptimized: 167298 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol index 686164de856a..8490063a43eb 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol @@ -60,10 +60,10 @@ contract C { // EVMVersion: >homestead // ---- // test_bytes() -> -// gas irOptimized: 321332 +// gas irOptimized: 321957 // gas legacy: 319111 // gas legacyOptimized: 269317 // test_uint256() -> -// gas irOptimized: 447646 +// gas irOptimized: 449971 // gas legacy: 433627 // gas legacyOptimized: 365410 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol index 5e50d5e9a807..374c9735b4c0 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol @@ -50,6 +50,6 @@ contract C { // f2() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3 -// gas irOptimized: 112630 +// gas irOptimized: 112815 // gas legacy: 114794 -// gas legacyOptimized: 112572 +// gas legacyOptimized: 112506 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol index c41905e2a491..cb3c59d53944 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol @@ -30,9 +30,9 @@ contract C is B { } // ---- // test() -> 77 -// gas irOptimized: 55148 -// gas irOptimized code: 55200 +// gas irOptimized: 55329 +// gas irOptimized code: 65000 // gas legacy: 57266 // gas legacy code: 94600 -// gas legacyOptimized: 55173 -// gas legacyOptimized code: 55200 +// gas legacyOptimized: 55246 +// gas legacyOptimized code: 55600 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol index 22aad67492e8..e037898fb81d 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol @@ -20,6 +20,6 @@ contract C { // f(uint256[][1]): 32, 32, 0 -> true // f(uint256[][1]): 32, 32, 1, 42 -> true // f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true -// gas irOptimized: 120043 +// gas irOptimized: 120050 // gas legacy: 101568 // gas legacyOptimized: 119092 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol index a92336097172..6d3db00b7408 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol @@ -33,7 +33,7 @@ contract C { // f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1, 5, 6 -> 0x20, 0x40, 5, 2 // f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1 -> FAILURE // f_storage(uint256[],uint256[2]): 0x20, 1, 2 -> 0x20, 0x60, 0x20, 1, 2 -// gas irOptimized: 111642 +// gas irOptimized: 111651 // gas legacy: 112944 // gas legacyOptimized: 112092 // f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5, 6 -> 0x20, 0x80, 0x20, 2, 5, 6 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol b/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol index 33075675358e..ea7de1518668 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol @@ -18,10 +18,10 @@ contract C { // EVMVersion: >homestead // ---- // h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324 -// gas irOptimized: 180720 +// gas irOptimized: 180727 // gas legacy: 184830 -// gas legacyOptimized: 181493 +// gas legacyOptimized: 181508 // i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224 -// gas irOptimized: 112425 +// gas irOptimized: 112427 // gas legacy: 115398 -// gas legacyOptimized: 112982 +// gas legacyOptimized: 112976 diff --git a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol index c06d2b24c457..1aab3a12c93e 100644 --- a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol +++ b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol @@ -8,6 +8,6 @@ contract C { } // ---- // f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg" -// gas irOptimized: 135661 +// gas irOptimized: 135691 // gas legacy: 137278 // gas legacyOptimized: 136048 diff --git a/test/libsolidity/semanticTests/array/array_memory_index_access.sol b/test/libsolidity/semanticTests/array/array_memory_index_access.sol index d313e7acb234..427204926185 100644 --- a/test/libsolidity/semanticTests/array/array_memory_index_access.sol +++ b/test/libsolidity/semanticTests/array/array_memory_index_access.sol @@ -26,7 +26,7 @@ contract C { // index(uint256): 10 -> true // index(uint256): 20 -> true // index(uint256): 0xFF -> true -// gas irOptimized: 108291 +// gas irOptimized: 108303 // gas legacy: 181523 // gas legacyOptimized: 117443 // accessIndex(uint256,int256): 10, 1 -> 2 diff --git a/test/libsolidity/semanticTests/array/array_storage_index_access.sol b/test/libsolidity/semanticTests/array/array_storage_index_access.sol index 2589e4709dae..51c095ba1a24 100644 --- a/test/libsolidity/semanticTests/array/array_storage_index_access.sol +++ b/test/libsolidity/semanticTests/array/array_storage_index_access.sol @@ -16,38 +16,38 @@ contract C { // ---- // test_indices(uint256): 1 -> // test_indices(uint256): 129 -> -// gas irOptimized: 3003025 +// gas irOptimized: 3023926 // gas legacy: 3038654 // gas legacyOptimized: 2995964 // test_indices(uint256): 5 -> -// gas irOptimized: 576296 +// gas irOptimized: 584178 // gas legacy: 573810 // gas legacyOptimized: 571847 // test_indices(uint256): 10 -> -// gas irOptimized: 157009 +// gas irOptimized: 158372 // gas legacy: 160108 // gas legacyOptimized: 156996 // test_indices(uint256): 15 -> -// gas irOptimized: 171409 +// gas irOptimized: 173257 // gas legacy: 175973 // gas legacyOptimized: 171596 // test_indices(uint256): 0xFF -> -// gas irOptimized: 5645329 +// gas irOptimized: 5685732 // gas legacy: 5715748 // gas legacyOptimized: 5632556 // test_indices(uint256): 1000 -> -// gas irOptimized: 18068701 +// gas irOptimized: 18214194 // gas legacy: 18347810 // gas legacyOptimized: 18037248 // test_indices(uint256): 129 -> -// gas irOptimized: 4136840 +// gas irOptimized: 4199164 // gas legacy: 4140113 // gas legacyOptimized: 4108272 // test_indices(uint256): 128 -> -// gas irOptimized: 395769 +// gas irOptimized: 408328 // gas legacy: 433498 // gas legacyOptimized: 400909 // test_indices(uint256): 1 -> -// gas irOptimized: 580232 +// gas irOptimized: 587984 // gas legacy: 576715 // gas legacyOptimized: 575542 diff --git a/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol b/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol index c77aad0a4515..6d71e8562695 100644 --- a/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol +++ b/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol @@ -16,11 +16,11 @@ contract C { // test_boundary_check(uint256,uint256): 1, 1 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 10, 10 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 256, 256 -> FAILURE, hex"4e487b71", 0x32 -// gas irOptimized: 137913 +// gas irOptimized: 152734 // gas legacy: 133633 // gas legacyOptimized: 114354 // test_boundary_check(uint256,uint256): 256, 255 -> 0 -// gas irOptimized: 140048 +// gas irOptimized: 154919 // gas legacy: 135949 // gas legacyOptimized: 116533 // test_boundary_check(uint256,uint256): 256, 0xFFFF -> FAILURE, hex"4e487b71", 0x32 diff --git a/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol b/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol index 593358659341..c81cff35d556 100644 --- a/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol +++ b/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol @@ -52,18 +52,18 @@ contract C { // ---- // test_zeroed_indicies(uint256): 1 -> // test_zeroed_indicies(uint256): 5 -> -// gas irOptimized: 131315 +// gas irOptimized: 135884 // gas legacy: 131671 // gas legacyOptimized: 129994 // test_zeroed_indicies(uint256): 10 -> -// gas irOptimized: 224578 +// gas irOptimized: 231900 // gas legacy: 225237 // gas legacyOptimized: 222359 // test_zeroed_indicies(uint256): 15 -> -// gas irOptimized: 321962 +// gas irOptimized: 331888 // gas legacy: 322937 // gas legacyOptimized: 318919 // test_zeroed_indicies(uint256): 0xFF -> -// gas irOptimized: 5080806 +// gas irOptimized: 5250880 // gas legacy: 5093941 // gas legacyOptimized: 5020727 diff --git a/test/libsolidity/semanticTests/array/array_storage_length_access.sol b/test/libsolidity/semanticTests/array/array_storage_length_access.sol index 0669a320971d..dce01aa1ce8b 100644 --- a/test/libsolidity/semanticTests/array/array_storage_length_access.sol +++ b/test/libsolidity/semanticTests/array/array_storage_length_access.sol @@ -12,11 +12,11 @@ contract C { // set_get_length(uint256): 10 -> 10 // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0xFF -> 0xFF -// gas irOptimized: 96690 +// gas irOptimized: 102799 // gas legacy: 128571 // gas legacyOptimized: 110143 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1209119 +// gas irOptimized: 1274436 // gas legacy: 1689548 // gas legacyOptimized: 1393535 // set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/array/array_storage_push_empty.sol b/test/libsolidity/semanticTests/array/array_storage_push_empty.sol index 80376b423f62..29d69fc949e0 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_empty.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_empty.sol @@ -12,11 +12,11 @@ contract C { // EVMVersion: >=petersburg // ---- // pushEmpty(uint256): 128 -// gas irOptimized: 401024 +// gas irOptimized: 412961 // gas legacy: 400640 // gas legacyOptimized: 388804 // pushEmpty(uint256): 256 -// gas irOptimized: 683700 +// gas irOptimized: 700501 // gas legacy: 685108 // gas legacyOptimized: 671480 // pushEmpty(uint256): 38869 -> FAILURE # out-of-gas # diff --git a/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol b/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol index 4b5b407eaff5..6e3f725a68ca 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol @@ -21,11 +21,11 @@ contract C { // gas legacy: 77730 // gas legacyOptimized: 77162 // set_get_length(uint256): 0xFF -> 0xFF -// gas irOptimized: 158881 +// gas irOptimized: 174251 // gas legacy: 696850 // gas legacyOptimized: 134488 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1762213 +// gas irOptimized: 1992683 // gas legacy: 9857362 // gas legacyOptimized: 1393660 // set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/array/array_storage_push_pop.sol b/test/libsolidity/semanticTests/array/array_storage_push_pop.sol index 5befbe2282b2..e9decfea6e7a 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_pop.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_pop.sol @@ -17,11 +17,11 @@ contract C { // gas legacy: 105722 // gas legacyOptimized: 103508 // set_get_length(uint256): 0xFF -> 0 -// gas irOptimized: 815997 +// gas irOptimized: 851776 // gas legacy: 808020 // gas legacyOptimized: 784467 // set_get_length(uint256): 0xFFF -> 0 -// gas irOptimized: 12746889 +// gas irOptimized: 13320268 // gas legacy: 12612192 // gas legacyOptimized: 12239199 // set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol index 95280054aae7..cac33ce9d3fb 100644 --- a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol @@ -12,7 +12,7 @@ contract Test { } // ---- // set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06 -// gas irOptimized: 186557 +// gas irOptimized: 187264 // gas legacy: 211054 // gas legacyOptimized: 206042 // data(uint256,uint256): 0x02, 0x02 -> 0x09 diff --git a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol index 3e0f02225bce..6d1db1ca392e 100644 --- a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol +++ b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 0 -// gas irOptimized: 123560 +// gas irOptimized: 128918 // gas legacy: 147098 // gas legacyOptimized: 144200 diff --git a/test/libsolidity/semanticTests/array/bytes_length_member.sol b/test/libsolidity/semanticTests/array/bytes_length_member.sol index 0a3c58b3ac92..ee09e0327f64 100644 --- a/test/libsolidity/semanticTests/array/bytes_length_member.sol +++ b/test/libsolidity/semanticTests/array/bytes_length_member.sol @@ -13,7 +13,7 @@ contract c { // ---- // getLength() -> 0 // set(): 1, 2 -> true -// gas irOptimized: 110393 +// gas irOptimized: 110411 // gas legacy: 110952 // gas legacyOptimized: 110576 // getLength() -> 68 diff --git a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol index 19acb7cba14b..614e211b8005 100644 --- a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol +++ b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol @@ -8,11 +8,11 @@ contract C { } // ---- // constructor(): 1, 2, 3 -> -// gas irOptimized: 124816 -// gas irOptimized code: 14800 +// gas irOptimized: 125761 +// gas irOptimized code: 19400 // gas legacy: 134317 // gas legacy code: 46200 -// gas legacyOptimized: 127062 +// gas legacyOptimized: 127166 // gas legacyOptimized code: 23400 // a(uint256): 0 -> 1 // a(uint256): 1 -> 2 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol b/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol index 80ecd3e1cef4..4b424c524f7a 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol @@ -20,7 +20,7 @@ contract c { } // ---- // store(uint256[9],uint8[3][]): 21, 22, 23, 24, 25, 26, 27, 28, 29, 0x140, 4, 1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33 -> 32 -// gas irOptimized: 648315 +// gas irOptimized: 648664 // gas legacy: 694356 // gas legacyOptimized: 693864 // retrieve() -> 9, 28, 9, 28, 4, 3, 32 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol index 600f00a98110..cbec7ed8c552 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol @@ -46,6 +46,6 @@ contract C { } // ---- // f() -> true -// gas irOptimized: 117264 +// gas irOptimized: 124607 // gas legacy: 124660 // gas legacyOptimized: 122801 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol index 0bdcda1d9e7f..3d9d0a88c338 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> 0 -// gas irOptimized: 107453 +// gas irOptimized: 108760 // gas legacy: 108218 // gas legacyOptimized: 107625 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol index 6e81269d8a50..a3921b29452a 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000 -// gas irOptimized: 207889 +// gas irOptimized: 208846 // gas legacy: 220707 // gas legacyOptimized: 220098 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol index 385f2ecfbf1e..b94df012f8e4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol @@ -35,12 +35,12 @@ contract c { } // ---- // test() -> 0x02000202 -// gas irOptimized: 4547793 +// gas irOptimized: 4568284 // gas legacy: 4475396 // gas legacyOptimized: 4447665 // storageEmpty -> 1 // clear() -> 0, 0 -// gas irOptimized: 4474777 +// gas irOptimized: 4497464 // gas legacy: 4407188 // gas legacyOptimized: 4381336 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol b/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol index 737e4b32bc1d..678f8b026174 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol @@ -12,6 +12,6 @@ contract c { } // ---- // test(uint256[2][]): 32, 3, 7, 8, 9, 10, 11, 12 -> 10 -// gas irOptimized: 689656 +// gas irOptimized: 690134 // gas legacy: 686178 // gas legacyOptimized: 685628 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol index d477dc6cf978..5c8577506c57 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 5, 4 -// gas irOptimized: 205044 +// gas irOptimized: 206126 // gas legacy: 213863 // gas legacyOptimized: 212902 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol index 0571195861b7..161e100c7d9f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol @@ -21,6 +21,6 @@ contract c { } // ---- // test() -> 3, 4 -// gas irOptimized: 169565 +// gas irOptimized: 170656 // gas legacy: 175424 // gas legacyOptimized: 172535 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol index 99dd1ca934ff..2d2d42c3375a 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol @@ -15,7 +15,7 @@ contract c { // ---- // setData1(uint256,uint256,uint256): 10, 5, 4 -> // copyStorageStorage() -> -// gas irOptimized: 111348 +// gas irOptimized: 111408 // gas legacy: 109272 // gas legacyOptimized: 109262 // getData2(uint256): 5 -> 10, 4 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol index 30173409eb77..bb04048e6b25 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 5, 4 -// gas irOptimized: 252929 +// gas irOptimized: 254132 // gas legacy: 250892 // gas legacyOptimized: 250046 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol index 971469dec64f..6cd2e076c088 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol @@ -11,6 +11,6 @@ contract c { } // ---- // test() -> 9, 4 -// gas irOptimized: 123135 +// gas irOptimized: 123227 // gas legacy: 123567 // gas legacyOptimized: 123202 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol index 0d613e5e946b..ef9aba2073da 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol @@ -14,6 +14,6 @@ contract c { } // ---- // test() -> 8, 0 -// gas irOptimized: 196259 +// gas irOptimized: 196321 // gas legacy: 194843 // gas legacyOptimized: 194281 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol index cfb623393c87..3471c2cc19ee 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol @@ -17,7 +17,7 @@ contract c { } // ---- // test() -> 4, 5 -// gas irOptimized: 190694 +// gas irOptimized: 191251 // gas legacy: 190852 // gas legacyOptimized: 189658 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol index 6bd31ca5af46..dc0d182b3bee 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol @@ -15,6 +15,6 @@ contract C { } // ---- // f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3 -// gas irOptimized: 161624 +// gas irOptimized: 162073 // gas legacy: 162203 // gas legacyOptimized: 159934 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol index 10a48a18c574..4622352bbb16 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 100980 +// gas irOptimized: 104171 // gas legacy: 158142 -// gas legacyOptimized: 141096 +// gas legacyOptimized: 141280 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol index a839e3bb44b2..66a5bc3054ca 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0 -// gas irOptimized: 273372 +// gas irOptimized: 274157 // gas legacy: 282604 // gas legacyOptimized: 281510 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol index f9e1cbd27ef1..fe40d787dbf3 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00 -// gas irOptimized: 233118 +// gas irOptimized: 233328 // gas legacy: 235697 // gas legacyOptimized: 235193 diff --git a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol index b1e8659be8df..88e5689f6a59 100644 --- a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol @@ -52,7 +52,7 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 150004 +// gas irOptimized: 150232 // gas legacy: 150745 // gas legacyOptimized: 148678 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol index 919e83298675..3de3dab97428 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol @@ -38,10 +38,10 @@ contract c { // compileViaYul: true // ---- // test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 180716 +// gas irOptimized: 181035 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 157544 +// gas irOptimized: 157906 // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 -// gas irOptimized: 134634 +// gas irOptimized: 134807 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 -// gas irOptimized: 111252 +// gas irOptimized: 111267 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol index eb4b1bbb9aab..bd7f98ccde94 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol @@ -38,12 +38,12 @@ contract Test { } // ---- // test() -> 24 -// gas irOptimized: 226666 +// gas irOptimized: 227023 // gas legacy: 227084 // gas legacyOptimized: 226529 // test1() -> 3 // test2() -> 6 // test3() -> 24 -// gas irOptimized: 141225 +// gas irOptimized: 141558 // gas legacy: 142238 // gas legacyOptimized: 141365 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol index 01329504d2a9..86f7fd0f3587 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol @@ -45,7 +45,7 @@ contract C { } // ---- // copyExternalStorageArrayOfFunctionType() -> true -// gas irOptimized: 104592 +// gas irOptimized: 104695 // gas legacy: 108554 -// gas legacyOptimized: 102413 +// gas legacyOptimized: 102401 // copyInternalArrayOfFunctionType() -> true diff --git a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol index 50756d0b0c3d..75bf8507e101 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol @@ -48,7 +48,7 @@ contract C { } // ---- // copyExternalStorageArraysOfFunctionType() -> true -// gas irOptimized: 104265 +// gas irOptimized: 104468 // gas legacy: 108295 // gas legacyOptimized: 102146 // copyInternalArrayOfFunctionType() -> true diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol index 546a6e49e48d..3424dece9b49 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol @@ -17,4 +17,4 @@ contract C { // compileViaYul: true // ---- // f((uint128,uint64,uint128)[]): 0x20, 3, 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12 -// gas irOptimized: 119704 +// gas irOptimized: 120839 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol index 38e26e480add..f67f64dce509 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol @@ -19,4 +19,4 @@ contract C { // compileViaYul: true // ---- // f() -> 10, 11, 12 -// gas irOptimized: 118362 +// gas irOptimized: 119750 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol index c6e6c58765ac..d9c2af95e33e 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol @@ -23,4 +23,4 @@ contract C { // compileViaYul: true // ---- // f((uint256[])[]): 0x20, 3, 0x60, 0x60, 0x60, 0x20, 3, 1, 2, 3 -> 3, 1 -// gas irOptimized: 326771 +// gas irOptimized: 328269 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol index 510e7c9a4a62..cc3976d83fee 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol @@ -26,4 +26,4 @@ contract C { // compileViaYul: true // ---- // f() -> 3, 3, 3, 1 -// gas irOptimized: 181890 +// gas irOptimized: 182189 diff --git a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol index 5c44ef16a54d..a42f92226f5f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol +++ b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol @@ -12,6 +12,6 @@ contract C { } // ---- // f() -> 1, 2, 3 -// gas irOptimized: 131915 +// gas irOptimized: 131930 // gas legacy: 134606 // gas legacyOptimized: 131938 diff --git a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol index 50ea19a1eab4..fcd77acc843d 100644 --- a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol @@ -37,7 +37,7 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 147871 +// gas irOptimized: 147954 // gas legacy: 148896 // gas legacyOptimized: 146901 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol index 19e5ddebd443..c30108e2a05b 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol @@ -5,11 +5,11 @@ contract c { } // ---- // set(uint256): 1, 2 -> true -// gas irOptimized: 110558 +// gas irOptimized: 110584 // gas legacy: 111312 // gas legacyOptimized: 110741 // set(uint256): 2, 2, 3, 4, 5 -> true -// gas irOptimized: 177509 +// gas irOptimized: 177562 // gas legacy: 178314 // gas legacyOptimized: 177716 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol index 38dbe52bccde..3246bc003a39 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol @@ -17,25 +17,25 @@ contract c { // ---- // f(uint256): 0 -> 0x20, 0x00 // f(uint256): 31 -> 0x20, 0x1f, 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00 -// gas irOptimized: 104476 +// gas irOptimized: 110750 // gas legacy: 112974 // gas legacyOptimized: 112717 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 118962 +// gas irOptimized: 125194 // gas legacy: 129034 // gas legacyOptimized: 128952 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 125419 +// gas irOptimized: 131780 // gas legacy: 136234 // gas legacyOptimized: 135643 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 129529 +// gas irOptimized: 141770 // gas legacy: 148834 // gas legacyOptimized: 148873 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 // gas legacy: 59345 // gas legacyOptimized: 57279 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 421911 +// gas irOptimized: 447004 // gas legacy: 459355 // gas legacyOptimized: 461066 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol index 706232d589f7..805b6e8e8617 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol @@ -9,6 +9,6 @@ contract C { } // ---- // f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1 -// gas irOptimized: 110968 +// gas irOptimized: 111000 // gas legacy: 111551 // gas legacyOptimized: 111339 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol index e6bf7671a1b0..215ebc417d10 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol @@ -14,4 +14,4 @@ contract C { // compileViaYul: true // ---- // from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 139683 +// gas irOptimized: 139739 diff --git a/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol b/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol index 36b94d7c3974..9cbf86511300 100644 --- a/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol +++ b/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol @@ -16,8 +16,8 @@ contract C { } // ---- // constructor() -// gas irOptimized: 89121 -// gas irOptimized code: 137200 +// gas irOptimized: 89711 +// gas irOptimized code: 144800 // gas legacy: 89553 // gas legacy code: 126200 // gas legacyOptimized: 83556 diff --git a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol index 5482f615f241..3bca3c35ca30 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol @@ -35,12 +35,12 @@ contract C { } // ---- // f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000 -// gas irOptimized: 179750 +// gas irOptimized: 179939 // gas legacy: 181001 -// gas legacyOptimized: 180018 +// gas legacyOptimized: 180028 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas irOptimized: 106679 +// gas irOptimized: 106876 // gas legacy: 109720 -// gas legacyOptimized: 106932 +// gas legacyOptimized: 106942 // h() -> 0x40, 0x60, 0x00, 0x00 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol index d4599cdb7e58..912e47c42855 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol @@ -46,6 +46,6 @@ contract C { } // ---- // f() -> 0xff -// gas irOptimized: 143412 +// gas irOptimized: 144067 // gas legacy: 153395 // gas legacyOptimized: 146720 diff --git a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol index fb2177901239..9c3469a8a710 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol @@ -15,6 +15,6 @@ contract C { } // ---- // test() -> 7 -// gas irOptimized: 122455 +// gas irOptimized: 122696 // gas legacy: 205176 // gas legacyOptimized: 204971 diff --git a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol index 85c396fb4e12..e42e347fe15d 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol @@ -7,7 +7,7 @@ contract c { } // ---- // set(): 1, 2, 3, 4, 5 -> true -// gas irOptimized: 177376 +// gas irOptimized: 177398 // gas legacy: 177954 // gas legacyOptimized: 177550 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol index 58b5dd045449..605f0ddea68d 100644 --- a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol +++ b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol @@ -18,7 +18,7 @@ contract sender { } // ---- // (): 7 -> -// gas irOptimized: 110831 +// gas irOptimized: 110981 // gas legacy: 111388 // gas legacyOptimized: 111065 // val() -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol index ea5625f21d39..86281bd31612 100644 --- a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol @@ -31,8 +31,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][][]): 0x20, 1, 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 327874 +// gas irOptimized: 328163 // test2((uint8[],uint8[2])[][1][]): 0x20, 2, 0x40, 0x0160, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13, 0x20, 1, 0x20, 0x60, 31, 37, 2, 23, 29 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 140879 +// gas irOptimized: 141150 // test3((uint8[],uint8[2])[1][][2]): 0x20, 0x40, 0x60, 0, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 188535 +// gas irOptimized: 188552 diff --git a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol index 96f24f77da19..d16b552466f7 100644 --- a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol @@ -31,8 +31,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][][]): 0x20, 1, 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 332660 +// gas irOptimized: 332834 // test2((uint8[],uint8[2])[][1][]): 0x20, 2, 0x40, 0x0160, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13, 0x20, 1, 0x20, 0x60, 31, 37, 2, 23, 29 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 145150 +// gas irOptimized: 145499 // test3((uint8[],uint8[2])[1][][2]): 0x20, 0x40, 0x60, 0, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 192598 +// gas irOptimized: 192727 diff --git a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol index 275a0fca1b75..1421f13ad02a 100644 --- a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol @@ -46,11 +46,11 @@ contract C { } // ---- // test() -> 0x20, 0x14, "[a called][b called]" -// gas irOptimized: 116645 +// gas irOptimized: 116841 // gas legacy: 118936 // gas legacyOptimized: 116975 // test2() -> 0x20, 0x14, "[b called][a called]" // test3() -> 0x20, 0x14, "[b called][a called]" -// gas irOptimized: 103246 +// gas irOptimized: 103471 // gas legacy: 102745 // gas legacyOptimized: 101669 diff --git a/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol b/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol index 79882a74b267..08f5324941e9 100644 --- a/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 3 -// gas irOptimized: 127422 +// gas irOptimized: 128494 // gas legacy: 129050 // gas legacyOptimized: 128222 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol index f85b8eb9f31b..91de4f4cdd47 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol @@ -70,15 +70,15 @@ contract C { } // ---- // test1() -> -// gas irOptimized: 150468 +// gas irOptimized: 150615 // gas legacy: 150949 // gas legacyOptimized: 150906 // test2() -> FAILURE -// gas irOptimized: 150378 +// gas irOptimized: 150562 // gas legacy: 150673 // gas legacyOptimized: 150576 // test3() -> -// gas irOptimized: 123762 +// gas irOptimized: 124435 // gas legacy: 125333 // gas legacyOptimized: 125127 // test4() -> FAILURE diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol index 844a86304ee7..5e0ec1c12e02 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol @@ -29,8 +29,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][]): 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 304747 +// gas irOptimized: 304976 // test2((uint8[],uint8[2])[][1]): 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 116464 +// gas irOptimized: 116578 // test3((uint8[],uint8[2])[1][]): 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 188024 +// gas irOptimized: 188116 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol index 209a6ee696e9..869df3820d65 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol @@ -29,8 +29,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][]): 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 309074 +// gas irOptimized: 309290 // test2((uint8[],uint8[2])[][1]): 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 118256 +// gas irOptimized: 118293 // test3((uint8[],uint8[2])[1][]): 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 190993 +// gas irOptimized: 191152 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol index c356e029f6b6..07f0c7b6d60a 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol @@ -63,7 +63,7 @@ contract C { // compileViaYul: true // ---- // test1() -// gas irOptimized: 123202 +// gas irOptimized: 123301 // test2() -// gas irOptimized: 123027 +// gas irOptimized: 123134 // test3() diff --git a/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol index dfb7c27aca40..6ad95f1f0e52 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol @@ -30,7 +30,7 @@ contract C { // compileViaYul: true // ---- // test(uint8[][][]): 0x20, 2, 0x40, 0x60, 0, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 138040 +// gas irOptimized: 138067 // test2(uint8[][]): 0x20, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 164246 +// gas irOptimized: 164449 // gas legacyOptimized: 120228 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol index 9a2fbb4d9d58..f221888599d3 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 205783 +// gas irOptimized: 207401 // gas legacy: 211765 // gas legacyOptimized: 211181 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol index 211477c553c2..5debc2461abf 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol @@ -11,6 +11,6 @@ contract C { } // ---- // f() -> 0x20, 0x02, 0x40, 0x80, 3, 0x6162630000000000000000000000000000000000000000000000000000000000, 0x99, 44048183304486788312148433451363384677562265908331949128489393215789685032262, 32241931068525137014058842823026578386641954854143559838526554899205067598957, 49951309422467613961193228765530489307475214998374779756599339590522149884499, 0x54555658595a6162636465666768696a6b6c6d6e6f707172737475767778797a, 0x4142434445464748494a4b4c4d4e4f5051525354555658595a00000000000000 -// gas irOptimized: 202731 +// gas irOptimized: 202760 // gas legacy: 204798 // gas legacyOptimized: 203357 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol index 3606d7d60188..c17d2fc2578a 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 205783 +// gas irOptimized: 207401 // gas legacy: 211770 // gas legacyOptimized: 211186 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol index cfbf5c874575..4fe80c2c255b 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol @@ -24,6 +24,6 @@ contract C { } // ---- // f() -> 11, 0x0c, 1, 0x15, 22, 4 -// gas irOptimized: 291047 +// gas irOptimized: 291550 // gas legacy: 293407 // gas legacyOptimized: 290218 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol index 3ba5604a79f5..c0d08081035d 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> 2, 3, 4 -// gas irOptimized: 109108 +// gas irOptimized: 116471 // gas legacy: 122235 // gas legacyOptimized: 118411 diff --git a/test/libsolidity/semanticTests/array/create_memory_array.sol b/test/libsolidity/semanticTests/array/create_memory_array.sol index d507f080f36f..e97871e9b314 100644 --- a/test/libsolidity/semanticTests/array/create_memory_array.sol +++ b/test/libsolidity/semanticTests/array/create_memory_array.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> "A", 8, 4, "B" -// gas irOptimized: 125822 +// gas irOptimized: 139546 // gas legacy: 121382 // gas legacyOptimized: 115488 diff --git a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol index fffea685a8cb..1a2fae4c30a5 100644 --- a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol +++ b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test1() -> true -// gas irOptimized: 204782 +// gas irOptimized: 226188 // gas legacy: 242256 // gas legacyOptimized: 241192 diff --git a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol index eb950d1834c2..154e437c89ee 100644 --- a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol @@ -14,7 +14,7 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 519017 +// gas irOptimized: 519956 // gas legacy: 518936 // gas legacyOptimized: 515555 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol index 2f6769a24189..cd3adde53f07 100644 --- a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol +++ b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol @@ -41,7 +41,7 @@ contract c { // ---- // getLengths() -> 0, 0 // setLengths(uint256,uint256): 48, 49 -> -// gas irOptimized: 110797 +// gas irOptimized: 113545 // gas legacy: 108273 // gas legacyOptimized: 100269 // getLengths() -> 48, 49 diff --git a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol index 7621d05bdcfd..d3616fc7ff8d 100644 --- a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol @@ -16,7 +16,7 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> 8 -// gas irOptimized: 122742 +// gas irOptimized: 123307 // gas legacy: 121602 // gas legacyOptimized: 120589 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol index b4d9a30ec068..33090ddfecbc 100644 --- a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol @@ -10,7 +10,7 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 464834 +// gas irOptimized: 465768 // gas legacy: 468818 // gas legacyOptimized: 466238 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol index 0fb513543bea..3fbb357444ce 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -18,9 +18,9 @@ contract B { } // ---- // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 -// gas irOptimized: 59204 -// gas irOptimized code: 55200 +// gas irOptimized: 59408 +// gas irOptimized code: 59000 // gas legacy: 68001 // gas legacy code: 162000 -// gas legacyOptimized: 60037 -// gas legacyOptimized code: 70600 +// gas legacyOptimized: 60057 +// gas legacyOptimized code: 71000 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index 0eb0f1e90e7d..bc015ce39c33 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -9,11 +9,11 @@ contract Creator { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 103927 +// gas irOptimized: 104453 // gas irOptimized code: 22400 // gas legacy: 115186 // gas legacy code: 59000 -// gas legacyOptimized: 104909 +// gas legacyOptimized: 105075 // gas legacyOptimized code: 23800 // r() -> 4 // ch() -> 3 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index e35e24bbf12a..1e0c9a5d0e70 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -42,9 +42,9 @@ contract C { } // ---- // test() -> 5, 6, 7 -// gas irOptimized: 86128 -// gas irOptimized code: 169600 +// gas irOptimized: 87871 +// gas irOptimized code: 175800 // gas legacy: 97576 // gas legacy code: 342800 -// gas legacyOptimized: 87851 -// gas legacyOptimized code: 190800 +// gas legacyOptimized: 87856 +// gas legacyOptimized code: 191200 diff --git a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol index ddf67aa90fbf..4a1bc16b71b4 100644 --- a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol +++ b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol @@ -40,7 +40,7 @@ contract C { // copyFromStorageShort() // x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000 // copyFromStorageLong() -// gas irOptimized: 121106 +// gas irOptimized: 121139 // gas legacy: 121904 // gas legacyOptimized: 121398 // x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol b/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol index a08d27ac0b38..a1227315bf0d 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol @@ -23,7 +23,7 @@ contract c { } // ---- // test() -> 1, 2, 3 -// gas irOptimized: 1827730 +// gas irOptimized: 1835321 // gas legacy: 1822466 // gas legacyOptimized: 1813404 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol b/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol index 1b69ab336bc7..8b5b723df7cf 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol @@ -18,7 +18,7 @@ contract c { } // ---- // test() -> 38, 28, 18 -// gas irOptimized: 148538 +// gas irOptimized: 151637 // gas legacy: 151184 // gas legacyOptimized: 142418 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol b/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol index d2e5995c0070..639dc842a9b3 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol @@ -18,7 +18,7 @@ contract c { } // ---- // test() -> 20, 10 -// gas irOptimized: 126068 +// gas irOptimized: 127930 // gas legacy: 127216 // gas legacyOptimized: 122224 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol index a3ba9d4d2111..e0888172e324 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol @@ -16,7 +16,7 @@ contract c { } // ---- // test() -> true -// gas irOptimized: 140154 +// gas irOptimized: 141404 // gas legacy: 178397 // gas legacyOptimized: 163832 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol index a014e761ea24..fa65e7c89116 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol @@ -15,7 +15,7 @@ contract c { } // ---- // test() -> -// gas irOptimized: 113782 +// gas irOptimized: 114069 // gas legacy: 131245 // gas legacyOptimized: 126668 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol index 5b1a61839183..9ef6e6a3e792 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol @@ -9,6 +9,6 @@ contract c { } // ---- // test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 107343 +// gas irOptimized: 107132 // gas legacy: 121408 // gas legacyOptimized: 120534 diff --git a/test/libsolidity/semanticTests/array/push/array_push.sol b/test/libsolidity/semanticTests/array/push/array_push.sol index 3e7ceb5a8b7d..9c4e81d649e8 100644 --- a/test/libsolidity/semanticTests/array/push/array_push.sol +++ b/test/libsolidity/semanticTests/array/push/array_push.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test() -> 5, 4, 3, 3 -// gas irOptimized: 111363 +// gas irOptimized: 112004 // gas legacy: 111807 // gas legacyOptimized: 111122 diff --git a/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol index a010a9938ac7..613b28f61c6b 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol @@ -12,6 +12,6 @@ contract C { } // ---- // f(uint120[]): 0x20, 3, 1, 2, 3 -> 1 -// gas irOptimized: 112812 +// gas irOptimized: 113033 // gas legacy: 113659 // gas legacyOptimized: 113482 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct.sol b/test/libsolidity/semanticTests/array/push/array_push_struct.sol index 06c5db88b73c..921545ebbfc9 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct.sol @@ -20,6 +20,6 @@ contract c { } // ---- // test() -> 2, 3, 4, 5 -// gas irOptimized: 135103 +// gas irOptimized: 135462 // gas legacy: 147443 // gas legacyOptimized: 146434 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol index 4a33f816d773..34d467836e6c 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test((uint16,uint16,uint16[3],uint16[])): 0x20, 2, 3, 0, 0, 4, 0xC0, 4, 0, 0, 5, 0, 0 -> 2, 3, 4, 5 -// gas irOptimized: 137061 +// gas irOptimized: 137369 // gas legacy: 142423 -// gas legacyOptimized: 137991 +// gas legacyOptimized: 138003 diff --git a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol index 5f1fe0fac770..7b4bab4125ab 100644 --- a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol +++ b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol @@ -15,6 +15,6 @@ contract c { } // ---- // test() -> 0 -// gas irOptimized: 167700 +// gas irOptimized: 168837 // gas legacy: 206219 // gas legacyOptimized: 197297 diff --git a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol index 30ed47920d9c..b2ee1903387d 100644 --- a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol +++ b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> -// gas irOptimized: 179112 +// gas irOptimized: 179789 // gas legacy: 181014 // gas legacyOptimized: 180422 diff --git a/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol b/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol index 6901e32b8b54..731c99472825 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol @@ -27,14 +27,14 @@ contract C { // ---- // l() -> 0 // f(uint256,uint256): 42, 64 -> -// gas irOptimized: 112266 +// gas irOptimized: 112307 // gas legacy: 107920 // gas legacyOptimized: 101897 // l() -> 1 // ll(uint256): 0 -> 43 // a(uint256,uint256): 0, 42 -> 64 // f(uint256,uint256): 84, 128 -> -// gas irOptimized: 118686 +// gas irOptimized: 118727 // gas legacy: 109972 // gas legacyOptimized: 96331 // l() -> 2 diff --git a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol index b19ebcc7367f..0d7d3fc71bbc 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol @@ -21,7 +21,7 @@ contract C { // ---- // l() -> 0 // g(uint256): 70 -> -// gas irOptimized: 180849 +// gas irOptimized: 187656 // gas legacy: 175185 // gas legacyOptimized: 175005 // l() -> 70 diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index a7608f6e0c81..dea61037739f 100644 --- a/test/libsolidity/semanticTests/array/reusing_memory.sol +++ b/test/libsolidity/semanticTests/array/reusing_memory.sol @@ -24,7 +24,7 @@ contract Main { } // ---- // f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1 -// gas irOptimized: 99524 +// gas irOptimized: 99831 // gas irOptimized code: 12400 // gas legacy: 101554 // gas legacy code: 23600 diff --git a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol index 14130926e7fb..08e39bf50124 100644 --- a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol +++ b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol @@ -28,8 +28,8 @@ contract C { // compileViaYul: also // ---- // constructor() -> -// gas irOptimized: 82402 -// gas irOptimized code: 361000 +// gas irOptimized: 90780 +// gas irOptimized code: 469800 // gas legacy: 101895 // gas legacy code: 609400 // gas legacyOptimized: 85378 diff --git a/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol b/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol index aedf5ada4f57..f468d5b0fdcd 100644 --- a/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol @@ -9,7 +9,7 @@ contract c { // EVMVersion: >=byzantium // ---- // (): 1, 2, 3, 4, 5 -> -// gas irOptimized: 155130 +// gas irOptimized: 155150 // gas legacy: 155473 // gas legacyOptimized: 155295 // checkIfDataIsEmpty() -> false diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index 3e60ba451c8c..705ca46c0daf 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -24,9 +24,9 @@ contract Creator { } // ---- // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 -// gas irOptimized: 328126 -// gas irOptimized code: 96400 +// gas irOptimized: 328162 +// gas irOptimized code: 96600 // gas legacy: 336626 // gas legacy code: 244800 -// gas legacyOptimized: 329599 +// gas legacyOptimized: 329621 // gas legacyOptimized code: 115000 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index 7885d3ceecf0..6d7436fb5dbe 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -24,9 +24,9 @@ contract Creator { } // ---- // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" -// gas irOptimized: 169902 -// gas irOptimized code: 105200 +// gas irOptimized: 169947 +// gas irOptimized code: 106000 // gas legacy: 173433 // gas legacy code: 245000 -// gas legacyOptimized: 170360 +// gas legacyOptimized: 170383 // gas legacyOptimized code: 121600 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol index 1d6b01127c5a..dbe031a09951 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol @@ -8,8 +8,8 @@ contract Test { } // ---- // constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> -// gas irOptimized: 182025 -// gas irOptimized code: 87200 +// gas irOptimized: 181859 +// gas irOptimized code: 85600 // gas legacy: 196220 // gas legacy code: 114600 // gas legacyOptimized: 182604 diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index 8fa725dad569..39cc8474b7f4 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -17,8 +17,8 @@ contract Main { } // ---- // constructor(): "abc", true -// gas irOptimized: 80174 -// gas irOptimized code: 24200 +// gas irOptimized: 80453 +// gas irOptimized code: 24800 // gas legacy: 85100 // gas legacy code: 58200 // gas legacyOptimized: 80133 diff --git a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol index e6ce445ada39..a2f2cfe6bfbd 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol @@ -9,8 +9,8 @@ contract C { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 147975 -// gas irOptimized code: 23000 +// gas irOptimized: 148958 +// gas irOptimized code: 27800 // gas legacy: 157978 // gas legacy code: 60400 // gas legacyOptimized: 150011 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol index ef53142d458a..3a719795910c 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol @@ -14,6 +14,6 @@ contract B is A { // compileViaYul: true // ---- // constructor() -> -// gas irOptimized: 99436 -// gas irOptimized code: 20200 +// gas irOptimized: 99452 +// gas irOptimized code: 20400 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol index e19ad39cfad7..87c0879829ca 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol @@ -9,8 +9,8 @@ contract B is A { } // ---- // constructor() -> -// gas irOptimized: 99436 -// gas irOptimized code: 20200 +// gas irOptimized: 99452 +// gas irOptimized code: 20400 // gas legacy: 100974 // gas legacy code: 32600 // gas legacyOptimized: 99137 diff --git a/test/libsolidity/semanticTests/constructor_with_params.sol b/test/libsolidity/semanticTests/constructor_with_params.sol index 1c5a170202f3..354e5e48cdd8 100644 --- a/test/libsolidity/semanticTests/constructor_with_params.sol +++ b/test/libsolidity/semanticTests/constructor_with_params.sol @@ -9,8 +9,8 @@ contract C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 81170 -// gas irOptimized code: 20200 +// gas irOptimized: 81186 +// gas irOptimized code: 20400 // gas legacy: 83614 // gas legacy code: 32000 // i() -> 2 diff --git a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol index 29f401a77322..3c3c6d95114f 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol @@ -21,11 +21,11 @@ contract D is B, C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 124350 -// gas irOptimized code: 27600 +// gas irOptimized: 124382 +// gas irOptimized code: 28000 // gas legacy: 128223 // gas legacy code: 40400 -// gas legacyOptimized: 123921 +// gas legacyOptimized: 124058 // gas legacyOptimized code: 20600 // i() -> 2 // j() -> 2 diff --git a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol index b0373b74f193..b835a4b45d28 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol @@ -12,11 +12,11 @@ contract D is C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 101581 -// gas irOptimized code: 20200 +// gas irOptimized: 101597 +// gas irOptimized code: 20400 // gas legacy: 105193 // gas legacy code: 32000 -// gas legacyOptimized: 101504 +// gas legacyOptimized: 101617 // gas legacyOptimized code: 17000 // i() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol index fec281c59a01..a3ec5796468c 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol @@ -13,6 +13,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c -// gas irOptimized: 113485 +// gas irOptimized: 114818 // gas legacy: 116314 // gas legacyOptimized: 114407 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol index 2b5a7114d99b..4d53af586f1a 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol @@ -14,6 +14,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c -// gas irOptimized: 113485 +// gas irOptimized: 114818 // gas legacy: 116314 // gas legacyOptimized: 114407 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol index d6cfb68beff9..4108c1c12937 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol @@ -15,6 +15,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d -// gas irOptimized: 185033 +// gas irOptimized: 185762 // gas legacy: 187495 // gas legacyOptimized: 184525 diff --git a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol index 6a01d0019295..1e6ff5f87d52 100644 --- a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol +++ b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol @@ -15,7 +15,7 @@ contract C { } // ---- // constructor() -> -// gas irOptimized: 113970 +// gas irOptimized: 113939 // gas irOptimized code: 51400 // gas legacy: 119776 // gas legacy code: 125000 diff --git a/test/libsolidity/semanticTests/events/event_indexed_string.sol b/test/libsolidity/semanticTests/events/event_indexed_string.sol index 739619066a43..b02b6ed69f7f 100644 --- a/test/libsolidity/semanticTests/events/event_indexed_string.sol +++ b/test/libsolidity/semanticTests/events/event_indexed_string.sol @@ -17,6 +17,6 @@ contract C { // ---- // deposit() -> // ~ emit E(string,uint256[4]): #0xa7fb06bb999a5eb9aff9e0779953f4e1e4ce58044936c2f51c7fb879b85c08bd, #0xe755d8cc1a8cde16a2a31160dcd8017ac32d7e2f13215b29a23cdae40a78aa81 -// gas irOptimized: 328856 +// gas irOptimized: 337423 // gas legacy: 365828 -// gas legacyOptimized: 362251 +// gas legacyOptimized: 362256 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index d308d4597e53..bcdd8b30aeca 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -74,12 +74,12 @@ contract FixedFeeRegistrar is Registrar { } // ---- // constructor() -// gas irOptimized: 78006 -// gas irOptimized code: 306600 +// gas irOptimized: 78364 +// gas irOptimized code: 311000 // gas legacy: 115817 // gas legacy code: 797600 -// gas legacyOptimized: 84924 -// gas legacyOptimized code: 392000 +// gas legacyOptimized: 84956 +// gas legacyOptimized code: 392400 // reserve(string), 69 ether: 0x20, 3, "abc" -> // ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 // gas irOptimized: 45967 diff --git a/test/libsolidity/semanticTests/externalContracts/base64.sol b/test/libsolidity/semanticTests/externalContracts/base64.sol index b712092ed022..bdc4b2a4876c 100644 --- a/test/libsolidity/semanticTests/externalContracts/base64.sol +++ b/test/libsolidity/semanticTests/externalContracts/base64.sol @@ -33,8 +33,8 @@ contract test { // EVMVersion: >=constantinople // ---- // constructor() -// gas irOptimized: 79428 -// gas irOptimized code: 326400 +// gas irOptimized: 79607 +// gas irOptimized code: 328400 // gas legacy: 102450 // gas legacy code: 632600 // gas legacyOptimized: 88318 @@ -54,10 +54,10 @@ contract test { // encode_no_asm(bytes): 0x20, 5, "fooba" -> 0x20, 8, "Zm9vYmE=" // encode_no_asm(bytes): 0x20, 6, "foobar" -> 0x20, 8, "Zm9vYmFy" // encode_inline_asm_large() -// gas irOptimized: 1322025 +// gas irOptimized: 1437028 // gas legacy: 1554031 // gas legacyOptimized: 1132031 // encode_no_asm_large() -// gas irOptimized: 3206081 +// gas irOptimized: 3594084 // gas legacy: 4587075 // gas legacyOptimized: 2823075 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 0ef87edd4f08..6a4fcf43c00b 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -176,38 +176,38 @@ contract DepositContract is IDepositContract, ERC165 { } // ---- // constructor() -// gas irOptimized: 815686 -// gas irOptimized code: 571200 +// gas irOptimized: 819329 +// gas irOptimized code: 597000 // gas legacy: 925933 // gas legacy code: 1442800 -// gas legacyOptimized: 854404 -// gas legacyOptimized code: 885600 +// gas legacyOptimized: 855302 +// gas legacyOptimized code: 894400 // supportsInterface(bytes4): 0x0 -> 0 // supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 # // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # // supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 115231 +// gas irOptimized: 118485 // gas legacy: 148205 // gas legacyOptimized: 122303 // get_deposit_count() -> 0x20, 8, 0 # TODO: check balance and logs after each deposit # // deposit(bytes,bytes,bytes,bytes32), 32 ether: 0 -> FAILURE # Empty input # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 115231 +// gas irOptimized: 118485 // gas legacy: 148205 // gas legacyOptimized: 122303 // get_deposit_count() -> 0x20, 8, 0 // deposit(bytes,bytes,bytes,bytes32), 1 ether: 0x80, 0xe0, 0x120, 0xaa4a8d0b7d9077248630f1a4701ae9764e42271d7f22b7838778411857fd349e, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0x00f50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8 -> # txhash: 0x7085c586686d666e8bb6e9477a0f0b09565b2060a11f1c4209d3a52295033832 # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00 // get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438 -// gas irOptimized: 115216 +// gas irOptimized: 118464 // gas legacy: 148214 // gas legacyOptimized: 122315 // get_deposit_count() -> 0x20, 8, 0x0100000000000000000000000000000000000000000000000000000000000000 // deposit(bytes,bytes,bytes,bytes32), 32 ether: 0x80, 0xe0, 0x120, 0xdbd986dc85ceb382708cf90a3500f500f0a393c5ece76963ac3ed72eccd2c301, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x00344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d -> # txhash: 0x404d8e109822ce448e68f45216c12cb051b784d068fbe98317ab8e50c58304ac # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000 // get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee -// gas irOptimized: 115216 +// gas irOptimized: 118464 // gas legacy: 148214 // gas legacyOptimized: 122315 // get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol index ddd63971836c..75dcd257ca2f 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -48,8 +48,8 @@ contract test { } // ---- // constructor() -// gas irOptimized: 177336 -// gas irOptimized code: 1664400 +// gas irOptimized: 176270 +// gas irOptimized code: 1651400 // gas legacy: 209687 // gas legacy code: 2204400 // gas legacyOptimized: 178012 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol index deacfd05641b..d50f175c3a5e 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol @@ -48,8 +48,8 @@ contract test { } // ---- // constructor() -// gas irOptimized: 168523 -// gas irOptimized code: 1547800 +// gas irOptimized: 168706 +// gas irOptimized code: 1550000 // gas legacy: 195146 // gas legacy code: 1998400 // gas legacyOptimized: 168857 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index cdaec8797eb7..aba8112ec2ca 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -33,8 +33,8 @@ contract test { } // ---- // constructor() -// gas irOptimized: 79503 -// gas irOptimized code: 328000 +// gas irOptimized: 83457 +// gas irOptimized code: 379200 // gas legacy: 92086 // gas legacy code: 523000 // gas legacyOptimized: 82667 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index d3492a5c6b06..9d59b685e7b2 100644 --- a/test/libsolidity/semanticTests/externalContracts/snark.sol +++ b/test/libsolidity/semanticTests/externalContracts/snark.sol @@ -294,11 +294,11 @@ contract Test { // f() -> true // g() -> true // pair() -> true -// gas irOptimized: 269697 +// gas irOptimized: 271262 // gas legacy: 275206 // gas legacyOptimized: 266925 // verifyTx() -> true // ~ emit Verified(string): 0x20, 0x16, "Successfully verified." -// gas irOptimized: 782210 +// gas irOptimized: 790677 // gas legacy: 801868 // gas legacyOptimized: 770942 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index a4b0f9fd353d..9cac2d58b94d 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -49,12 +49,12 @@ contract test { } // ---- // constructor() -// gas irOptimized: 96420 -// gas irOptimized code: 533800 +// gas irOptimized: 97679 +// gas irOptimized code: 551400 // gas legacy: 126553 // gas legacy code: 935400 -// gas legacyOptimized: 102933 -// gas legacyOptimized code: 616000 +// gas legacyOptimized: 103643 +// gas legacyOptimized code: 624800 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 // gas irOptimized: 22660 // gas legacy: 23190 @@ -72,6 +72,6 @@ contract test { // gas legacy: 31621 // gas legacyOptimized: 27914 // benchmark(string,bytes32): 0x40, 0x0842021, 8, "solidity" -> 0x2020 -// gas irOptimized: 1980944 +// gas irOptimized: 2139814 // gas legacy: 4233999 // gas legacyOptimized: 2318684 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol index 1133dc2be300..6685c1810f0a 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -15,8 +15,8 @@ contract D { } // ---- // constructor(): 2 -> -// gas irOptimized: 138863 -// gas irOptimized code: 53800 +// gas irOptimized: 138860 +// gas irOptimized code: 54000 // gas legacy: 145570 // gas legacy code: 95600 // gas legacyOptimized: 138297 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol index ba90a8ecd5a6..6f2c8858f0aa 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -17,8 +17,8 @@ contract D { // EVMVersion: >=constantinople // ---- // constructor(): 2 -> -// gas irOptimized: 139026 -// gas irOptimized code: 53800 +// gas irOptimized: 139023 +// gas irOptimized code: 54000 // gas legacy: 145936 // gas legacy code: 95600 // gas legacyOptimized: 138529 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol index 9d521f7777f9..37f352628dbc 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol @@ -22,8 +22,8 @@ contract C { } // ---- // constructor(), 1 ether -> -// gas irOptimized: 89555 -// gas irOptimized code: 172800 +// gas irOptimized: 88927 +// gas irOptimized code: 166600 // gas legacy: 103042 // gas legacy code: 338400 // gas legacyOptimized: 91862 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol index 9baacd812773..d7412dc53016 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol @@ -25,8 +25,8 @@ contract C { // revertStrings: debug // ---- // constructor(), 1 ether -> -// gas irOptimized: 99264 -// gas irOptimized code: 291200 +// gas irOptimized: 98810 +// gas irOptimized code: 285600 // gas legacy: 123585 // gas legacy code: 686400 // gas legacyOptimized: 107331 diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index b6c077753a51..ddf46d7fd856 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -17,8 +17,8 @@ contract C { // EVMVersion: >=byzantium // ---- // constructor(), 20 wei -// gas irOptimized: 61548 -// gas irOptimized code: 104600 +// gas irOptimized: 61576 +// gas irOptimized code: 105400 // gas legacy: 70147 // gas legacy code: 215400 // gas legacyOptimized: 61715 @@ -28,7 +28,7 @@ contract C { // f(uint256): 20 -> FAILURE // x() -> 1 // stack(uint256): 1023 -> FAILURE -// gas irOptimized: 252410 +// gas irOptimized: 253780 // gas legacy: 477722 // gas legacyOptimized: 299567 // x() -> 1 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol index 806c8eb41b9d..6861a8d7c220 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -38,8 +38,8 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 120226 -// gas irOptimized code: 132400 +// gas irOptimized: 120391 +// gas irOptimized code: 135000 // gas legacy: 130568 // gas legacy code: 261000 // gas legacyOptimized: 121069 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol index c186fc40b22c..2055519c1a11 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol @@ -37,8 +37,8 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 120226 -// gas irOptimized code: 132400 +// gas irOptimized: 120391 +// gas irOptimized code: 135000 // gas legacy: 130568 // gas legacy code: 261000 // gas legacyOptimized: 121069 diff --git a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol index 28c1822d77b7..8445e028036e 100644 --- a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol +++ b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol @@ -18,7 +18,7 @@ contract test { } // ---- // set(uint8,uint8,uint8,uint8,uint8): 1, 21, 22, 42, 43 -> 0, 0, 0, 0 -// gas irOptimized: 111628 +// gas irOptimized: 112172 // gas legacy: 113748 // gas legacyOptimized: 111772 // get(uint8): 1 -> 21, 22, 42, 43 diff --git a/test/libsolidity/semanticTests/immutable/multi_creation.sol b/test/libsolidity/semanticTests/immutable/multi_creation.sol index c8806c50d060..5248f799456c 100644 --- a/test/libsolidity/semanticTests/immutable/multi_creation.sol +++ b/test/libsolidity/semanticTests/immutable/multi_creation.sol @@ -27,7 +27,7 @@ contract C { } // ---- // f() -> 3, 7, 5 -// gas irOptimized: 86821 +// gas irOptimized: 86885 // gas irOptimized code: 37200 // gas legacy: 87728 // gas legacy code: 60800 diff --git a/test/libsolidity/semanticTests/immutable/use_scratch.sol b/test/libsolidity/semanticTests/immutable/use_scratch.sol index dc07086c29c3..dee63d010ab3 100644 --- a/test/libsolidity/semanticTests/immutable/use_scratch.sol +++ b/test/libsolidity/semanticTests/immutable/use_scratch.sol @@ -15,8 +15,8 @@ contract C { } // ---- // constructor(): 3 -> -// gas irOptimized: 81126 -// gas irOptimized code: 42400 +// gas irOptimized: 81353 +// gas irOptimized code: 43200 // gas legacy: 88245 // gas legacy code: 109400 // gas legacyOptimized: 81858 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index fdd0bafaadfe..a0d9cc97d18a 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -39,8 +39,8 @@ contract Main { } // ---- // constructor(), 22 wei -> -// gas irOptimized: 143864 -// gas irOptimized code: 118000 +// gas irOptimized: 144177 +// gas irOptimized code: 119200 // gas legacy: 156586 // gas legacy code: 236200 // gas legacyOptimized: 143593 diff --git a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol index 0ad55b5ddff1..064254eef8bb 100644 --- a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol +++ b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol @@ -16,8 +16,8 @@ contract ClientReceipt { } // ---- // constructor(), 2000 wei -> -// gas irOptimized: 114107 -// gas irOptimized code: 55800 +// gas irOptimized: 114168 +// gas irOptimized code: 56800 // gas legacy: 118618 // gas legacy code: 111400 // gas legacyOptimized: 114067 diff --git a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol index 79d53273ba7e..3d664bd71967 100644 --- a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol +++ b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol @@ -22,6 +22,6 @@ contract Test { // ---- // library: Lib // f() -> 4, 0x11 -// gas irOptimized: 111560 +// gas irOptimized: 117064 // gas legacy: 132935 // gas legacyOptimized: 118023 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol index b3e06c5bcfb8..7de2f7cb0ea8 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol @@ -19,6 +19,6 @@ contract Test { // ---- // library: Lib // f() -> 1, 0, 0x2a, 0x17, 0, 0x63 -// gas irOptimized: 119635 +// gas irOptimized: 119735 // gas legacy: 124674 // gas legacyOptimized: 119669 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol index e9d855969afd..3eb22efc2f31 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol @@ -17,6 +17,6 @@ contract Test { // ---- // library: Lib // f() -> 1, 0, 0x2a, 0x17, 0, 0x63 -// gas irOptimized: 120194 +// gas irOptimized: 120460 // gas legacy: 125109 // gas legacyOptimized: 120128 diff --git a/test/libsolidity/semanticTests/libraries/using_library_structs.sol b/test/libsolidity/semanticTests/libraries/using_library_structs.sol index e709a5b5b93c..a206d878bebb 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_structs.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_structs.sol @@ -20,5 +20,5 @@ contract Test { // ---- // library: Lib // f() -> 7, 8 -// gas irOptimized: 101818 +// gas irOptimized: 101891 // gas legacy: 101429 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create.sol b/test/libsolidity/semanticTests/salted_create/salted_create.sol index 535a2813c17c..81eae23eb7a9 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create.sol @@ -21,7 +21,7 @@ contract A { // ---- // different_salt() -> true // same_salt() -> true -// gas irOptimized: 98438295 +// gas irOptimized: 98438301 // gas irOptimized code: 600 // gas legacy: 98437509 // gas legacy code: 1600 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol index 735731c8abf7..32b3a7bf2972 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol @@ -21,8 +21,8 @@ contract A { // EVMVersion: >=constantinople // ---- // f(), 10 ether -> 3007, 3008, 3009 -// gas irOptimized: 187005 -// gas irOptimized code: 66000 +// gas irOptimized: 187081 +// gas irOptimized code: 65400 // gas legacy: 190863 // gas legacy code: 190200 // gas legacyOptimized: 187258 diff --git a/test/libsolidity/semanticTests/smoke/constructor.sol b/test/libsolidity/semanticTests/smoke/constructor.sol index 2783fe4a8c9c..718614d8d042 100644 --- a/test/libsolidity/semanticTests/smoke/constructor.sol +++ b/test/libsolidity/semanticTests/smoke/constructor.sol @@ -12,8 +12,8 @@ contract C { } // ---- // constructor(), 2 wei: 3 -> -// gas irOptimized: 78996 -// gas irOptimized code: 25400 +// gas irOptimized: 79012 +// gas irOptimized code: 25600 // gas legacy: 83056 // gas legacy code: 65200 // gas legacyOptimized: 78899 diff --git a/test/libsolidity/semanticTests/state/blockhash_basic.sol b/test/libsolidity/semanticTests/state/blockhash_basic.sol index 64b8d55a26b6..0d931c22417e 100644 --- a/test/libsolidity/semanticTests/state/blockhash_basic.sol +++ b/test/libsolidity/semanticTests/state/blockhash_basic.sol @@ -12,8 +12,8 @@ contract C { } // ---- // constructor() -// gas irOptimized: 80338 -// gas irOptimized code: 27800 +// gas irOptimized: 80370 +// gas irOptimized code: 28200 // gas legacy: 83571 // gas legacy code: 68600 // gas legacyOptimized: 80338 diff --git a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol index 5f32421657cd..7897144d52d6 100644 --- a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol +++ b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol @@ -22,7 +22,7 @@ contract Test { // set(bytes): 0x20, 0 // storageEmpty -> 1 // set(bytes): 0x20, 66, "12345678901234567890123456789012", "12345678901234567890123456789012", "12" -// gas irOptimized: 111886 +// gas irOptimized: 111878 // gas legacy: 112734 // gas legacyOptimized: 112115 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol index 2c29abc79bb0..bc16815e4a03 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol @@ -42,6 +42,6 @@ contract C { } // ---- // test() -> true -// gas irOptimized: 132493 +// gas irOptimized: 132578 // gas legacy: 136009 // gas legacyOptimized: 133478 diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol index add42a8f3b18..e17775d477d4 100644 --- a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol @@ -16,6 +16,6 @@ contract C { } // ---- // f(uint32,(uint128,uint256[][2],uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 77, 1, 2, 88 -// gas irOptimized: 202843 +// gas irOptimized: 203160 // gas legacy: 207384 -// gas legacyOptimized: 203584 +// gas legacyOptimized: 203662 diff --git a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol index 699836179be2..71c882ff996f 100644 --- a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol +++ b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol @@ -23,6 +23,6 @@ contract CopyTest { } // ---- // run() -> 2, 23, 42 -// gas irOptimized: 193677 +// gas irOptimized: 195913 // gas legacy: 185731 // gas legacyOptimized: 184458 diff --git a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol index 1d1783a16291..336f8fc47d4f 100644 --- a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol @@ -36,8 +36,8 @@ contract C { } // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121481 +// gas irOptimized: 121578 // gas legacy: 123069 -// gas legacyOptimized: 121756 +// gas legacyOptimized: 121764 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 // to_memory() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol b/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol index 937eeeaf437e..e7ebdd2d866c 100644 --- a/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol +++ b/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol @@ -87,7 +87,7 @@ contract Test { // EVMVersion: >homestead // ---- // test1() -> true -// gas irOptimized: 152882 +// gas irOptimized: 153253 // gas legacy: 153012 // gas legacyOptimized: 152637 // test2() -> true diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol index a1b0999ff5b1..c46f89d09428 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol @@ -44,8 +44,8 @@ contract C { } // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121598 +// gas irOptimized: 121694 // gas legacy: 123208 -// gas legacyOptimized: 121763 +// gas legacyOptimized: 121771 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 // to_memory() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol index b88466113408..f2841552e6f9 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol @@ -52,14 +52,14 @@ contract C { } // ---- // from_memory() -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 123039 +// gas irOptimized: 123195 // gas legacy: 130227 -// gas legacyOptimized: 128758 +// gas legacyOptimized: 128766 // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121709 +// gas irOptimized: 121843 // gas legacy: 123282 -// gas legacyOptimized: 121868 +// gas legacyOptimized: 121876 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 115130 +// gas irOptimized: 115249 // gas legacy: 122516 -// gas legacyOptimized: 120804 +// gas legacyOptimized: 120812 diff --git a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol index e6b569922c5f..489a9c169cfe 100644 --- a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol @@ -45,18 +45,18 @@ contract C { } // ---- // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121686 +// gas irOptimized: 121789 // gas legacy: 123144 -// gas legacyOptimized: 121808 +// gas legacyOptimized: 121816 // from_storage() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121731 +// gas irOptimized: 121833 // gas legacy: 123193 -// gas legacyOptimized: 121860 +// gas legacyOptimized: 121868 // from_memory() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 122947 +// gas irOptimized: 123044 // gas legacy: 130088 -// gas legacyOptimized: 128754 +// gas legacyOptimized: 128762 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 21, 3, 0x666f6f0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 115045 +// gas irOptimized: 115115 // gas legacy: 118301 -// gas legacyOptimized: 115432 +// gas legacyOptimized: 115473 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol index e5b139d5c3c7..6c15a5aaa03c 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol @@ -66,7 +66,7 @@ contract Test { } // ---- // load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 -// gas irOptimized: 110317 +// gas irOptimized: 110798 // gas legacy: 112964 // gas legacyOptimized: 110876 // store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 diff --git a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol index 856edc27be48..6ad79f5d2719 100644 --- a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol +++ b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol @@ -23,7 +23,7 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133592 +// gas irOptimized: 133624 // gas legacy: 134628 // gas legacyOptimized: 133871 // test(uint256): 32 -> "3" @@ -31,7 +31,7 @@ contract c { // copy() -> true // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133592 +// gas irOptimized: 133624 // gas legacy: 134628 // gas legacyOptimized: 133871 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/structs/struct_copy.sol b/test/libsolidity/semanticTests/structs/struct_copy.sol index a321f0686897..9e2cbc12e56c 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy.sol @@ -35,12 +35,12 @@ contract c { } // ---- // set(uint256): 7 -> true -// gas irOptimized: 109893 +// gas irOptimized: 110091 // gas legacy: 110597 // gas legacyOptimized: 110003 // retrieve(uint256): 7 -> 1, 3, 4, 2 // copy(uint256,uint256): 7, 8 -> true -// gas irOptimized: 118582 +// gas irOptimized: 118586 // gas legacy: 119147 // gas legacyOptimized: 118619 // retrieve(uint256): 7 -> 1, 3, 4, 2 diff --git a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol index 71b40acc80f6..db1c9ad262fb 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> true -// gas irOptimized: 109706 +// gas irOptimized: 109970 // gas legacy: 110615 // gas legacyOptimized: 109705 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol index d76618bbc9fc..0d2e112127e8 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol @@ -42,10 +42,10 @@ contract C { } // ---- // f() -> -// gas irOptimized: 113210 +// gas irOptimized: 113748 // gas legacy: 113591 // gas legacyOptimized: 113103 // g() -> -// gas irOptimized: 118580 +// gas irOptimized: 119312 // gas legacy: 118764 // gas legacyOptimized: 118172 diff --git a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol index 9af3774692a9..3d24f3189047 100644 --- a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol +++ b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol @@ -28,6 +28,6 @@ contract C { } // ---- // f() -> 42, 23, 34, 42, 42 -// gas irOptimized: 110382 +// gas irOptimized: 110784 // gas legacy: 111993 // gas legacyOptimized: 110546 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index b5e9d10bb844..29d7601aa3ac 100644 --- a/test/libsolidity/semanticTests/structs/structs.sol +++ b/test/libsolidity/semanticTests/structs/structs.sol @@ -30,7 +30,7 @@ contract test { // ---- // check() -> false // set() -> -// gas irOptimized: 134417 +// gas irOptimized: 134445 // gas legacy: 135246 // gas legacyOptimized: 134062 // check() -> true diff --git a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol index b17ba6d9160b..740dbe0a5fa8 100644 --- a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol +++ b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol @@ -29,6 +29,6 @@ contract C { } // ---- // f() -> 0x20, 7, 8, 9, 0xa0, 13, 2, 0x40, 0xa0, 2, 3, 4, 2, 3, 4 -// gas irOptimized: 197082 +// gas irOptimized: 197208 // gas legacy: 199891 -// gas legacyOptimized: 196817 +// gas legacyOptimized: 196840 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol index 9ed64be08bcf..abcf48025426 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol @@ -49,11 +49,11 @@ contract C { } // ---- // test_f() -> true -// gas irOptimized: 122078 +// gas irOptimized: 122209 // gas legacy: 125322 // gas legacyOptimized: 122709 // test_g() -> true -// gas irOptimized: 106215 +// gas irOptimized: 106287 // gas legacy: 111120 // gas legacyOptimized: 106964 // addresses(uint256): 0 -> 0x18 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 8976cf3c52cc..fb60a6ffce67 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -113,12 +113,12 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 121082 -// gas irOptimized code: 231600 +// gas irOptimized: 121859 +// gas irOptimized code: 240200 // gas legacy: 163352 // gas legacy code: 671400 -// gas legacyOptimized: 127448 -// gas legacyOptimized code: 285200 +// gas legacyOptimized: 127352 +// gas legacyOptimized code: 284000 // totalSupply() -> 20 // gas irOptimized: 23415 // gas legacy: 23653 diff --git a/test/libsolidity/semanticTests/various/address_code.sol b/test/libsolidity/semanticTests/various/address_code.sol index 6a97c0bf7ee2..a8e141da3a9a 100644 --- a/test/libsolidity/semanticTests/various/address_code.sol +++ b/test/libsolidity/semanticTests/various/address_code.sol @@ -14,8 +14,8 @@ contract C { } // ---- // constructor() -> -// gas irOptimized: 70873 -// gas irOptimized code: 102400 +// gas irOptimized: 70738 +// gas irOptimized code: 100800 // gas legacy: 82796 // gas legacy code: 159000 // gas legacyOptimized: 69870 diff --git a/test/libsolidity/semanticTests/various/create_calldata.sol b/test/libsolidity/semanticTests/various/create_calldata.sol index 2db42adebb86..f8186b18014f 100644 --- a/test/libsolidity/semanticTests/various/create_calldata.sol +++ b/test/libsolidity/semanticTests/various/create_calldata.sol @@ -8,8 +8,8 @@ contract C { } // ---- // constructor(): 42 -> -// gas irOptimized: 68378 -// gas irOptimized code: 77200 +// gas irOptimized: 68273 +// gas irOptimized code: 76200 // gas legacy: 78445 // gas legacy code: 95400 // gas legacyOptimized: 68677 diff --git a/test/libsolidity/semanticTests/various/destructuring_assignment.sol b/test/libsolidity/semanticTests/various/destructuring_assignment.sol index b8236e2cd5ff..1e708ddf2463 100644 --- a/test/libsolidity/semanticTests/various/destructuring_assignment.sol +++ b/test/libsolidity/semanticTests/various/destructuring_assignment.sol @@ -33,6 +33,6 @@ contract C { } // ---- // f(bytes): 0x20, 0x5, "abcde" -> 0 -// gas irOptimized: 241837 +// gas irOptimized: 242770 // gas legacy: 243284 // gas legacyOptimized: 242420 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index f7956c4c50eb..5ddd46ab97a1 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -96,12 +96,12 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 121248 -// gas irOptimized code: 232000 +// gas irOptimized: 122255 +// gas irOptimized code: 243400 // gas legacy: 159959 // gas legacy code: 647600 -// gas legacyOptimized: 126918 -// gas legacyOptimized code: 281800 +// gas legacyOptimized: 126816 +// gas legacyOptimized code: 280600 // totalSupply() -> 20 // gas irOptimized: 23415 // gas legacy: 23524 diff --git a/test/libsolidity/semanticTests/various/negative_stack_height.sol b/test/libsolidity/semanticTests/various/negative_stack_height.sol index 44fd0089cf70..12e49bce3982 100644 --- a/test/libsolidity/semanticTests/various/negative_stack_height.sol +++ b/test/libsolidity/semanticTests/various/negative_stack_height.sol @@ -67,5 +67,5 @@ contract C { // constructor() -> // gas legacy: 92268 // gas legacy code: 483000 -// gas legacyOptimized: 75022 -// gas legacyOptimized code: 270000 +// gas legacyOptimized: 75166 +// gas legacyOptimized code: 271800 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun.sol b/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun.sol index a39b6c42355c..f5b12e015aee 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun.sol @@ -62,8 +62,8 @@ contract D { // EVMVersion: =shanghai // ---- // constructor(), 1 ether -> -// gas irOptimized: 67028 -// gas irOptimized code: 175400 +// gas irOptimized: 67076 +// gas irOptimized code: 176000 // gas legacy: 76163 // gas legacy code: 297400 // gas legacyOptimized: 66516 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_multiple_beneficiaries.sol b/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_multiple_beneficiaries.sol index a09a7cac68b1..1d11b6f2e5b9 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_multiple_beneficiaries.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_multiple_beneficiaries.sol @@ -35,8 +35,8 @@ contract D { // EVMVersion: <=shanghai // ---- // constructor(), 2 ether -> -// gas irOptimized: 107718 -// gas irOptimized code: 116200 +// gas irOptimized: 107753 +// gas irOptimized code: 116400 // gas legacy: 120424 // gas legacy code: 253600 // gas legacyOptimized: 109015 @@ -46,7 +46,7 @@ contract D { // balance -> 2000000000000000000 // exists() -> false // test_deploy_and_terminate_twice() -> -// gas irOptimized: 121350 +// gas irOptimized: 121389 // gas irOptimized code: 14000 // gas legacy: 122384 // gas legacy code: 43200 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_redeploy.sol b/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_redeploy.sol index fc650ebba741..247b2c130826 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_redeploy.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_pre_cancun_redeploy.sol @@ -79,20 +79,20 @@ contract D { // EVMVersion: =shanghai // ---- // constructor(), 1 ether -> -// gas irOptimized: 133253 -// gas irOptimized code: 297000 +// gas irOptimized: 134044 +// gas irOptimized code: 307200 // gas legacy: 151644 // gas legacy code: 538600 -// gas legacyOptimized: 131799 -// gas legacyOptimized code: 281000 +// gas legacyOptimized: 131831 +// gas legacyOptimized code: 281400 // exists() -> false // test_deploy_and_terminate() -> // ~ emit Deployed(address,bytes32) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: 0x7e6580007e709ac52945fae182c61131d42634e8, 0x1234000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 96689 +// gas irOptimized: 96817 // gas irOptimized code: 20800 // gas legacy: 98095 // gas legacy code: 20800 -// gas legacyOptimized: 96337 +// gas legacyOptimized: 96342 // gas legacyOptimized code: 20800 // exists() -> false // deploy_create2() -> diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index 5b4371149f42..01daae2f7ed4 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -16,8 +16,8 @@ contract D { } // ---- // constructor(), 27 wei -> -// gas irOptimized: 114057 -// gas irOptimized code: 53800 +// gas irOptimized: 114054 +// gas irOptimized code: 54000 // gas legacy: 117835 // gas legacy code: 100600 // gas legacyOptimized: 113676 diff --git a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol index ce8946c55c4e..5a8f28e5b91f 100644 --- a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol +++ b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol @@ -19,6 +19,6 @@ contract C { } // ---- // g() -> 2, 6 -// gas irOptimized: 178475 +// gas irOptimized: 178530 // gas legacy: 180839 -// gas legacyOptimized: 179374 +// gas legacyOptimized: 179389 diff --git a/test/libsolidity/semanticTests/various/value_complex.sol b/test/libsolidity/semanticTests/various/value_complex.sol index 427a006dc102..c8e043fa920b 100644 --- a/test/libsolidity/semanticTests/various/value_complex.sol +++ b/test/libsolidity/semanticTests/various/value_complex.sol @@ -19,8 +19,8 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 114399 -// gas irOptimized code: 58000 +// gas irOptimized: 114460 +// gas irOptimized code: 59000 // gas legacy: 120076 // gas legacy code: 132200 // gas legacyOptimized: 114536 diff --git a/test/libsolidity/semanticTests/various/value_insane.sol b/test/libsolidity/semanticTests/various/value_insane.sol index 97fbbab1e634..432ec026b2ca 100644 --- a/test/libsolidity/semanticTests/various/value_insane.sol +++ b/test/libsolidity/semanticTests/various/value_insane.sol @@ -18,8 +18,8 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 114463 -// gas irOptimized code: 58800 +// gas irOptimized: 114524 +// gas irOptimized code: 59800 // gas legacy: 120200 // gas legacy code: 133600 // gas legacyOptimized: 114568 diff --git a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol index 5a85ba07591a..4a65a353f02c 100644 --- a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol +++ b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol @@ -21,6 +21,6 @@ contract C { } // ---- // f() -> -// gas irOptimized: 112969 +// gas irOptimized: 113171 // gas legacy: 112890 // gas legacyOptimized: 112580 diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul index d8c8e90558ef..f8c24b21b8c8 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul @@ -1070,8 +1070,10 @@ result := and(add(value_389, 31), not(31)) } } +// TODO: Create variants for different EVM versions. +// After changing the optimizer sequence the output here became EVM-version dependent. // ==== -// EVMVersion: >=constantinople +// EVMVersion: =shanghai // ---- // step: fullSuite // @@ -1102,9 +1104,11 @@ // if gt(add(add(_2, length), 32), dataEnd) { revert(0, 0) } // value2 := add(_2, 32) // value3 := length -// let _3 := calldataload(add(headStart, 96)) -// if iszero(lt(_3, 3)) { revert(0, 0) } -// value4 := _3 +// value4 := cleanup_revert_enum_Operation(calldataload(add(headStart, 96))) +// } +// function abi_encode_address(value, pos) +// { +// mstore(pos, and(value, sub(shl(160, 1), 1))) // } // function abi_encode_bytes32_address_uint256_bytes32_enum_Operation_uint256_uint256_uint256_address_address_uint256(headStart, value10, value9, value8, value7, value6, value5, value4, value3, value2, value1, value0) -> tail // { @@ -1120,7 +1124,12 @@ // mstore(add(headStart, 192), value6) // mstore(add(headStart, 224), value7) // mstore(add(headStart, 256), and(value8, _1)) -// mstore(add(headStart, 288), and(value9, _1)) +// abi_encode_address(value9, add(headStart, 288)) // mstore(add(headStart, 320), value10) // } +// function cleanup_revert_enum_Operation(value) -> cleaned +// { +// if iszero(lt(value, 3)) { revert(0, 0) } +// cleaned := value +// } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index 2abdf6d9c283..eb9bf452efb2 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -463,29 +463,31 @@ // // { // { -// let _1 := mload(0) -// let pos := 0x20 -// let length := mload(_1) -// mstore(pos, length) +// let _1 := 0x20 +// let _2 := mload(0) +// let pos := _1 +// let length := mload(_2) +// mstore(_1, length) // pos := 64 -// let srcPtr := add(_1, 0x20) +// let srcPtr := add(_2, _1) // let i := 0 // for { } lt(i, length) { i := add(i, 1) } // { -// let _2 := mload(srcPtr) +// let _3 := mload(srcPtr) // let pos_1 := pos -// let srcPtr_1 := _2 +// let length_1 := 0x3 +// let srcPtr_1 := _3 // let i_1 := 0 -// for { } lt(i_1, 0x3) { i_1 := add(i_1, 1) } +// for { } lt(i_1, length_1) { i_1 := add(i_1, 1) } // { // mstore(pos_1, and(mload(srcPtr_1), sub(shl(160, 1), 1))) -// srcPtr_1 := add(srcPtr_1, 0x20) -// pos_1 := add(pos_1, 0x20) +// srcPtr_1 := add(srcPtr_1, _1) +// pos_1 := add(pos_1, _1) // } -// srcPtr := add(srcPtr, 0x20) +// srcPtr := add(srcPtr, _1) // pos := add(pos, 0x60) // } -// let a, b, c, d := abi_decode_uint256t_uint256t_array_uint256_dynt_array_array_uint256_memory_dyn(mload(0x20), mload(64)) +// let a, b, c, d := abi_decode_uint256t_uint256t_array_uint256_dynt_array_array_uint256_memory_dyn(mload(_1), mload(64)) // sstore(a, b) // sstore(c, d) // sstore(0, pos) @@ -506,21 +508,22 @@ // for { } lt(i, length) { i := add(i, 1) } // { // if iszero(slt(add(src, _1), end)) { revert(0, 0) } +// let _3 := 0x2 // let dst_1 := allocateMemory_967() -// let dst_2 := dst_1 +// let array_1 := dst_1 // let src_1 := src -// let _3 := add(src, 64) -// if gt(_3, end) { revert(0, 0) } +// let _4 := add(src, 64) +// if gt(_4, end) { revert(0, 0) } // let i_1 := 0 -// for { } lt(i_1, 0x2) { i_1 := add(i_1, 1) } +// for { } lt(i_1, _3) { i_1 := add(i_1, 1) } // { // mstore(dst_1, calldataload(src_1)) // dst_1 := add(dst_1, _2) // src_1 := add(src_1, _2) // } -// mstore(dst, dst_2) +// mstore(dst, array_1) // dst := add(dst, _2) -// src := _3 +// src := _4 // } // } // function abi_decode_uint256t_uint256t_array_uint256_dynt_array_array_uint256_memory_dyn(headStart, dataEnd) -> value0, value1, value2, value3 @@ -536,7 +539,7 @@ // if iszero(slt(add(_3, 0x1f), dataEnd)) { revert(0, 0) } // let length := calldataload(_3) // let dst := allocateMemory(array_allocation_size_array_address_dyn_memory(length)) -// let dst_1 := dst +// let array := dst // mstore(dst, length) // dst := add(dst, _1) // let src := add(_3, _1) @@ -548,7 +551,7 @@ // dst := add(dst, _1) // src := add(src, _1) // } -// value2 := dst_1 +// value2 := array // let offset_1 := calldataload(add(headStart, 96)) // if gt(offset_1, _2) { revert(0, 0) } // value3 := abi_decode_array_array_uint256_memory_dyn(add(headStart, offset_1), dataEnd) diff --git a/test/libyul/yulOptimizerTests/fullSuite/and_or_combination.yul b/test/libyul/yulOptimizerTests/fullSuite/and_or_combination.yul index b5f45605498d..5068043fc4ac 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/and_or_combination.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/and_or_combination.yul @@ -20,6 +20,8 @@ // // { // { -// sstore(sload(0), 0xad9c000000000000823500000000000056ce0000000000002b67) +// let a := sload(0) +// let x := sload(a) +// sstore(a, or(or(and(x, 0), and(0x56ce0000000000002b67, 0xffffffffffffffffffffffffffffffff)), shl(128, 0xad9c0000000000008235))) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul index 2b22055794c6..2686016be1f2 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul @@ -238,29 +238,31 @@ // mstore(0x80, 7673901602397024137095011250362199966051872585513276903826533215767972925880) // mstore(0xa0, 8489654445897228341090914135473290831551238522473825886865492707826370766375) // let notes := add(0x04, calldataload(0x04)) +// let _1 := 0x24 // let n := calldataload(notes) +// let challenge := mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // if gt(calldataload(0x24), n) // { // mstore(0x00, 404) // revert(0x00, 0x20) // } // let kn := calldataload(add(calldatasize(), not(191))) -// let _1 := 0x2a0 -// mstore(_1, caller()) +// let _2 := 0x2a0 +// mstore(_2, caller()) // mstore(0x2c0, kn) // mstore(0x2e0, calldataload(0x24)) -// kn := mulmod(sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, kn), mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// kn := mulmod(sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, kn), challenge, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // hashCommitments(notes, n) // let b := add(0x300, shl(7, n)) // let i := 0 // for { } lt(i, n) { i := add(i, 0x01) } // { -// let noteIndex := add(add(calldataload(0x04), mul(i, 0xc0)), 0x24) +// let noteIndex := add(add(calldataload(0x04), mul(i, 0xc0)), _1) // let k := 0 // let a := calldataload(add(add(calldataload(0x04), mul(i, 0xc0)), 0x44)) -// let c := mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) -// let _2 := add(i, 0x01) -// switch eq(_2, n) +// let c := challenge +// let _3 := add(i, 0x01) +// switch eq(_3, n) // case 1 { // k := kn // if eq(calldataload(0x24), n) @@ -270,13 +272,13 @@ // } // case 0 { k := calldataload(noteIndex) } // validateCommitment(noteIndex, k, a) -// switch gt(_2, calldataload(0x24)) +// switch gt(_3, calldataload(0x24)) // case 1 { // kn := addmod(kn, sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, k), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // let x := mod(mload(0), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // k := mulmod(k, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // a := mulmod(a, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) -// c := mulmod(mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// c := mulmod(challenge, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // mstore(0, keccak256(0, 0x20)) // } // case 0 { @@ -302,9 +304,9 @@ // if gt(i, calldataload(0x24)) // { // mstore(0x60, c) -// let _3 := 0x220 -// let result_4 := and(result, call(gas(), 7, 0, 0x20, 0x60, _3, 0x40)) -// let result_5 := and(result_4, call(gas(), 6, 0, _3, 0x80, 0x260, 0x40)) +// let _4 := 0x220 +// let result_4 := and(result, call(gas(), 7, 0, 0x20, 0x60, _4, 0x40)) +// let result_5 := and(result_4, call(gas(), 6, 0, _4, 0x80, 0x260, 0x40)) // result := and(result_5, call(gas(), 6, 0, 0x1a0, 0x80, 0x1e0, 0x40)) // } // if iszero(result) @@ -315,7 +317,7 @@ // b := add(b, 0x40) // } // if lt(calldataload(0x24), n) { validatePairing() } -// if iszero(eq(mod(keccak256(_1, add(b, not(671))), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001))) +// if iszero(eq(mod(keccak256(_2, add(b, not(671))), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), challenge)) // { // mstore(0, 404) // revert(0, 0x20) @@ -326,38 +328,37 @@ // function validatePairing() // { // let t2_x := calldataload(0x64) -// let t2_x_1 := calldataload(132) -// let t2_y := calldataload(164) -// let t2_y_1 := calldataload(196) -// let _1 := 0x90689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b -// let _2 := 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa -// let _3 := 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2 -// let _4 := 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed -// if or(or(or(or(or(or(or(iszero(t2_x), iszero(t2_x_1)), iszero(t2_y)), iszero(t2_y_1)), eq(t2_x, _4)), eq(t2_x_1, _3)), eq(t2_y, _2)), eq(t2_y_1, _1)) +// let _1 := 0x20 +// let t2_x_1 := calldataload(add(0x64, _1)) +// let t2_y := calldataload(add(0x64, 0x40)) +// let t2_y_1 := calldataload(add(0x64, 0x60)) +// let _2 := 0x90689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b +// let _3 := 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa +// let _4 := 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2 +// let _5 := 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed +// if or(or(or(or(or(or(or(iszero(t2_x), iszero(t2_x_1)), iszero(t2_y)), iszero(t2_y_1)), eq(t2_x, _5)), eq(t2_x_1, _4)), eq(t2_y, _3)), eq(t2_y_1, _2)) // { // mstore(0x00, 400) -// revert(0x00, 0x20) +// revert(0x00, _1) // } -// let _5 := mload(0x1e0) -// let _6 := 0x20 -// mstore(_6, _5) +// mstore(_1, mload(0x1e0)) // mstore(0x40, mload(0x200)) -// mstore(0x80, _4) -// mstore(0x60, _3) -// mstore(0xc0, _2) -// mstore(0xa0, _1) +// mstore(0x80, _5) +// mstore(0x60, _4) +// mstore(0xc0, _3) +// mstore(0xa0, _2) // mstore(0xe0, mload(0x260)) // mstore(0x100, mload(0x280)) // mstore(0x140, t2_x) // mstore(0x120, t2_x_1) -// let _7 := 0x180 -// mstore(_7, t2_y) +// let _6 := 0x180 +// mstore(_6, t2_y) // mstore(0x160, t2_y_1) -// let success := call(gas(), 8, 0, _6, _7, _6, _6) -// if or(iszero(success), iszero(mload(_6))) +// let success := call(gas(), 8, 0, _1, _6, _1, _1) +// if or(iszero(success), iszero(mload(_1))) // { // mstore(0, 400) -// revert(0, _6) +// revert(0, _1) // } // } // function validateCommitment(note, k, a) diff --git a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and.yul b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and.yul index 1abea23e7802..e8a3c1d665aa 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and.yul @@ -12,6 +12,6 @@ // { // { // let x := calldataload(0) -// sstore(shr(248, x), and(shr(4, x), 3855)) +// sstore(shr(248, x), and(shr(12, shl(8, x)), 3855)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_2.yul b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_2.yul index 513a23aa5066..825e9ed5c9f8 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_2.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_2.yul @@ -22,13 +22,13 @@ // // { // { -// let x := calldataload(0) -// let b := and(shl(8, x), 15790080) +// let _1 := shr(4, calldataload(0)) +// let b := and(shl(12, _1), 15790080) // sstore(10, 0) // sstore(11, b) // sstore(12, b) // sstore(13, 0) -// sstore(14, and(shl(251, x), shl(255, 1))) +// sstore(14, and(shl(0xff, _1), shl(255, 1))) // sstore(0xf, 0) // sstore(16, 0) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul index 17de07de7cd7..589fe1d293de 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul @@ -27,6 +27,6 @@ // sstore(17, and(_2, sub(shl(248, 1), 16))) // sstore(18, and(_2, sub(shl(244, 1), 1))) // sstore(19, and(_1, sub(shl(252, 1), 256))) -// sstore(20, 0) +// sstore(20, and(shl(150, shl(148, x)), 0)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_unsplit.yul b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_unsplit.yul index 923a18f4fd91..32dedf48537a 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_unsplit.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_unsplit.yul @@ -14,6 +14,6 @@ // { // { // let x := calldataload(0) -// sstore(shr(248, x), and(shr(4, x), 3855)) +// sstore(shr(248, x), and(shr(12, shl(8, x)), 3855)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul b/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul index fe06f1629bc3..a2db4df3a5af 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul @@ -14,8 +14,10 @@ v := calldataload(add(data, mul(i, 0x20))) } } +// TODO: Create variants for different EVM versions. +// After changing the optimizer sequence the output here became EVM-version dependent. // ==== -// EVMVersion: >=istanbul +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -25,8 +27,11 @@ // let sum := 0 // let length := calldataload(_1) // let i := 0 -// for { } lt(i, length) { i := add(i, 1) } +// for { } true { i := add(i, 1) } // { +// let _2 := iszero(lt(i, length)) +// if _2 { break } +// if _2 { revert(0, 0) } // sum := add(sum, calldataload(add(add(_1, shl(5, i)), 0x20))) // } // sstore(0, sum) diff --git a/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul b/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul index 86329c3275f0..2dc2dced2fb2 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul @@ -17,8 +17,10 @@ v := add(v, calldataload(7)) } } +// TODO: Create variants for different EVM versions. +// After changing the optimizer sequence the output here became EVM-version dependent. // ==== -// EVMVersion: >=istanbul +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -28,10 +30,12 @@ // let sum := 0 // let length := calldataload(_1) // let i := 0 -// let _2 := calldataload(7) -// for { } lt(i, length) { i := add(i, 1) } +// for { } true { i := add(i, 1) } // { -// sum := add(sum, add(calldataload(add(add(_1, shl(5, i)), 0x20)), _2)) +// let _2 := iszero(lt(i, length)) +// if _2 { break } +// if _2 { revert(0, 0) } +// sum := add(sum, add(calldataload(add(add(_1, shl(5, i)), 0x20)), calldataload(7))) // } // sstore(0, sum) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/medium.yul b/test/libyul/yulOptimizerTests/fullSuite/medium.yul index 9a6381d79913..1691fbeec815 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/medium.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/medium.yul @@ -23,7 +23,10 @@ // // { // { -// sstore(0, add(mload(0x40), 128)) -// sstore(1, 0x20) +// let p := add(add(mload(0x40), 0x20), 96) +// mstore(p, 2) +// mstore(0x40, 0x20) +// sstore(0, p) +// sstore(1, mload(0x40)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_1_pre_shanghai.yul b/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_1_pre_shanghai.yul index d041cff1041f..ce0f31d12c67 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_1_pre_shanghai.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_1_pre_shanghai.yul @@ -32,15 +32,15 @@ // // { // { +// let _1 := 0 // let a := 0 -// let a_1 := 0 -// for { } a_1 { } +// for { } a { } // { -// let _1 := add(a_1, a_1) -// let var := add(_1, _1) -// switch a_1 -// case 0 { a_1 := var } -// default { sstore(a, var) } +// let _2 := add(a, a) +// let var := add(_2, _2) +// switch a +// case 0 { a := var } +// default { sstore(_1, var) } // } // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_2_pre_shanghai.yul b/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_2_pre_shanghai.yul index 06965e3ca695..8038af678e6f 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_2_pre_shanghai.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/name_dependent_cse_bug_part_2_pre_shanghai.yul @@ -32,15 +32,15 @@ // // { // { +// let _1 := 0 // let a := 0 -// let a_1 := 0 -// for { } a_1 { } +// for { } a { } // { -// let _1 := add(a_1, a_1) -// let var := add(_1, _1) -// switch a_1 -// case 0 { a_1 := var } -// default { sstore(a, var) } +// let _2 := add(a, a) +// let var := add(_2, _2) +// switch a +// case 0 { a := var } +// default { sstore(_1, var) } // } // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/no_move_loop_orig.yul b/test/libyul/yulOptimizerTests/fullSuite/no_move_loop_orig.yul index f0ee054b9a01..4771a9be5762 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/no_move_loop_orig.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/no_move_loop_orig.yul @@ -12,10 +12,10 @@ // // { // { -// let _1 := iszero(caller()) // for { } // true // { +// let _1 := iszero(caller()) // for { } iszero(_1) { } // { } // mstore(192, 0) diff --git a/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul b/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul index 75e2ff4c2010..a401c59439f5 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul @@ -53,7 +53,7 @@ // mstore(lt(or(gt(_1, or(or(gt(or(or(or(gt(or(gt(_6, _9), _1), _8), _7), _5), _1), _1), _4), _1)), _1), _1), _1) // sstore(not(gcd(_3, _2)), _1) // sstore(2, _1) -// extcodecopy(_1, msize(), _1, _1) +// foo_singlereturn() // sstore(0, 0) // sstore(3, _1) // } @@ -63,4 +63,6 @@ // case 0 { out := _a } // default { out := gcd(_b, mod(_a, _b)) } // } +// function foo_singlereturn() +// { extcodecopy(1, msize(), 1, 1) } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul index f0b7546d0592..59dd9572073a 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul @@ -19,11 +19,22 @@ // // { // { +// f_63() // f() -// f() -// f() +// f_65() // sstore(0, 1) // } +// function f_63() +// { +// let b := 10 +// let a := calldataload(0) +// let _1 := iszero(a) +// for { } iszero(b) { b := add(b, not(0)) } +// { +// mstore(a, 0) +// if _1 { leave } +// } +// } // function f() // { // let b := 10 @@ -35,4 +46,15 @@ // if _1 { leave } // } // } +// function f_65() +// { +// let b := 10 +// let a := calldataload(0) +// let _1 := iszero(a) +// for { } iszero(b) { b := add(b, not(0)) } +// { +// mstore(a, 0) +// if _1 { leave } +// } +// } // }