From 22c679b981ae8106e1da7c64633f7fd6d28b69bc Mon Sep 17 00:00:00 2001 From: Nikola Matic Date: Mon, 12 Jun 2023 17:32:57 +0200 Subject: [PATCH] Do not optimize zero literals if PUSH0 iz available cmdline tests --- .../CommonSubexpressionEliminator.cpp | 17 +- test/cmdlineTests/ast_ir/output | 56 +++- .../constant_optimizer_yul/output | 1 + .../output | 10 +- .../output | 10 +- .../output | 10 +- .../debug_info_in_yul_snippet_escaping/output | 57 ++-- .../output | 2 + .../ir_compiler_subobjects/output | 27 +- .../output | 14 +- .../output | 13 +- .../keccak_optimization_deploy_code/output | 5 +- .../keccak_optimization_low_runs/output | 1 + test/cmdlineTests/name_simplifier/output | 100 +++--- test/cmdlineTests/no_cbor_metadata/output | 2 +- test/cmdlineTests/object_compiler/output | 8 +- .../cmdlineTests/optimizer_array_sload/output | 41 ++- .../output.json | 313 ++++++++---------- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 174 +++++----- .../standard_yul_optimized/output.json | 2 +- .../viair_subobject_optimization/output | 123 ++++--- test/cmdlineTests/viair_subobjects/output | 27 +- test/cmdlineTests/yul_optimize_runs/output | 2 +- .../yul_optimizer_steps_short_sequence/output | 2 +- test/libsolidity/gasTests/abiv2_optimised.sol | 6 +- .../abiEncoderV1/abi_decode_v2_storage.sol | 4 +- .../abi_encode_calldata_slice.sol | 4 +- .../struct/struct_storage_ptr.sol | 2 +- .../abi_encode_calldata_slice.sol | 4 +- .../abiEncoderV2/abi_encode_v2.sol | 2 +- ...2_in_function_inherited_in_v1_contract.sol | 2 +- .../abiEncoderV2/calldata_array.sol | 2 +- .../calldata_overlapped_dynamic_arrays.sol | 2 +- .../abiEncoderV2/storage_array_encoding.sol | 4 +- .../abi_decode_simple_storage.sol | 4 +- .../array/array_memory_index_access.sol | 2 +- .../array/array_storage_index_access.sol | 18 +- .../array_storage_index_boundary_test.sol | 4 +- .../array/array_storage_index_zeroed_test.sol | 8 +- .../array/array_storage_length_access.sol | 4 +- .../array/array_storage_push_empty.sol | 4 +- ...rray_storage_push_empty_length_address.sol | 4 +- .../array/array_storage_push_pop.sol | 4 +- .../arrays_complex_from_and_to_storage.sol | 2 +- .../array/byte_array_transitional_2.sol | 2 +- .../array/bytes_length_member.sol | 4 +- .../array/constant_var_as_array_length.sol | 2 +- .../copying/array_copy_calldata_storage.sol | 2 +- .../copying/array_copy_cleanup_uint40.sol | 2 +- .../copying/array_copy_clear_storage.sol | 2 +- .../copying/array_copy_different_packing.sol | 2 +- .../copying/array_copy_including_array.sol | 4 +- .../array/copying/array_copy_nested_array.sol | 2 +- ...ay_copy_storage_storage_different_base.sol | 2 +- ..._storage_storage_different_base_nested.sol | 2 +- .../array_copy_storage_storage_dyn_dyn.sol | 2 +- ...y_copy_storage_storage_dynamic_dynamic.sol | 2 +- ...ay_copy_storage_storage_static_dynamic.sol | 2 +- ...ray_copy_storage_storage_static_static.sol | 2 +- .../array_copy_storage_storage_struct.sol | 2 +- .../array_copy_storage_to_memory_nested.sol | 4 +- .../copying/array_copy_target_leftover.sol | 2 +- .../copying/array_copy_target_simple.sol | 2 +- .../copying/array_copy_target_simple_2.sol | 2 +- .../copying/array_elements_to_mapping.sol | 4 +- .../array_nested_calldata_to_storage.sol | 8 +- .../array_nested_memory_to_storage.sol | 4 +- ...on_external_storage_to_storage_dynamic.sol | 2 +- ...o_storage_dynamic_different_mutability.sol | 2 +- .../array_of_struct_calldata_to_storage.sol | 2 +- .../array_of_struct_memory_to_storage.sol | 2 +- ..._containing_arrays_calldata_to_storage.sol | 2 +- ...ts_containing_arrays_memory_to_storage.sol | 2 +- .../array_storage_multi_items_per_slot.sol | 2 +- .../array/copying/array_to_mapping.sol | 4 +- .../array/copying/bytes_inside_mappings.sol | 8 +- .../copying/bytes_storage_to_storage.sol | 18 +- .../calldata_array_dynamic_to_storage.sol | 2 +- .../copying/calldata_array_to_mapping.sol | 2 +- ...nup_during_multi_element_per_slot_copy.sol | 2 +- .../copy_byte_array_in_struct_to_storage.sol | 8 +- .../copying/copy_byte_array_to_storage.sol | 4 +- .../copy_function_internal_storage_array.sol | 2 +- .../array/copying/copy_removes_bytes_data.sol | 4 +- .../copying/copying_bytes_multiassign.sol | 4 +- ...d_array_of_structs_calldata_to_storage.sol | 6 +- ...ted_array_of_structs_memory_to_storage.sol | 6 +- .../function_type_array_to_storage.sol | 4 +- .../memory_dyn_2d_bytes_to_storage.sol | 4 +- ...ested_array_element_storage_to_storage.sol | 6 +- ...d_array_of_structs_calldata_to_storage.sol | 6 +- ...ted_array_of_structs_memory_to_storage.sol | 6 +- ...ed_array_of_structs_storage_to_storage.sol | 4 +- ...amic_array_element_calldata_to_storage.sol | 4 +- .../array/copying/storage_memory_nested.sol | 2 +- .../copying/storage_memory_nested_bytes.sol | 4 +- .../storage_memory_nested_from_pointer.sol | 2 +- .../copying/storage_memory_nested_struct.sol | 2 +- .../copying/storage_memory_packed_dyn.sol | 2 +- .../array/create_memory_array.sol | 2 +- .../array/delete/bytes_delete_element.sol | 4 +- .../array/dynamic_array_cleanup.sol | 2 +- .../array/dynamic_arrays_in_storage.sol | 2 +- .../array/dynamic_multi_array_cleanup.sol | 2 +- .../array/fixed_array_cleanup.sol | 2 +- .../array/fixed_arrays_as_return_type.sol | 2 +- .../array/fixed_arrays_in_constructors.sol | 2 +- .../array/function_array_cross_calls.sol | 2 +- ...nvalid_encoding_for_storage_byte_array.sol | 4 +- .../array/pop/array_pop_array_transition.sol | 2 +- .../array/pop/array_pop_uint16_transition.sol | 2 +- .../array/pop/array_pop_uint24_transition.sol | 2 +- .../pop/byte_array_pop_long_storage_empty.sol | 2 +- ...ray_pop_long_storage_empty_garbage_ref.sol | 2 +- .../array/pop/byte_array_pop_masking_long.sol | 2 +- .../semanticTests/array/push/array_push.sol | 2 +- .../push/array_push_nested_from_calldata.sol | 2 +- .../array/push/array_push_struct.sol | 2 +- .../push/array_push_struct_from_calldata.sol | 2 +- .../array/push/byte_array_push_transition.sol | 2 +- .../array/push/nested_bytes_push.sol | 4 +- .../array/push/push_no_args_2d.sol | 4 +- .../array/push/push_no_args_bytes.sol | 2 +- .../semanticTests/array/reusing_memory.sol | 2 +- .../byte_array_to_storage_cleanup.sol | 2 +- .../copy_from_calldata_removes_bytes_data.sol | 4 +- .../constructor/arrays_in_constructors.sol | 2 +- .../bytes_in_constructors_packer.sol | 4 +- .../bytes_in_constructors_unpacker.sol | 4 +- .../constructor_arguments_external.sol | 2 +- .../constructor_static_array_argument.sol | 2 +- .../constructor/no_callvalue_check.sol | 2 +- .../constructor_inheritance_init_order.sol | 2 +- .../constructor_inheritance_init_order_2.sol | 2 +- .../semanticTests/constructor_with_params.sol | 2 +- ...ructor_with_params_diamond_inheritance.sol | 2 +- .../constructor_with_params_inheritance.sol | 2 +- .../events/event_dynamic_array_storage.sol | 2 +- .../events/event_dynamic_array_storage_v2.sol | 2 +- .../event_dynamic_nested_array_storage_v2.sol | 4 +- .../events/event_emit_from_other_contract.sol | 2 +- .../events/event_indexed_string.sol | 4 +- .../externalContracts/FixedFeeRegistrar.sol | 2 +- .../externalContracts/base64.sol | 6 +- .../externalContracts/deposit_contract.sol | 10 +- .../externalContracts/prbmath_signed.sol | 2 +- .../externalContracts/prbmath_unsigned.sol | 2 +- .../externalContracts/ramanujan_pi.sol | 2 +- .../semanticTests/externalContracts/snark.sol | 4 +- .../externalContracts/strings.sol | 4 +- .../creation_function_call_with_args.sol | 2 +- .../creation_function_call_with_salt.sol | 2 +- .../external_call_to_nonexisting.sol | 2 +- ...ernal_call_to_nonexisting_debugstrings.sol | 2 +- .../functionCall/failed_create.sol | 4 +- .../functionCall/gas_and_value_basic.sol | 2 +- .../gas_and_value_brace_syntax.sol | 2 +- .../mapping_array_internal_argument.sol | 2 +- .../immutable/multi_creation.sol | 2 +- .../semanticTests/immutable/use_scratch.sol | 2 +- .../inheritance/value_for_constructor.sol | 2 +- .../balance_other_contract.sol | 2 +- .../libraries/internal_types_in_library.sol | 2 +- .../using_library_mappings_public.sol | 2 +- .../using_library_mappings_return.sol | 2 +- .../salted_create/salted_create.sol | 2 +- .../salted_create_with_value.sol | 2 +- .../semanticTests/smoke/constructor.sol | 2 +- .../semanticTests/state/blockhash_basic.sol | 2 +- .../storage/empty_nonempty_empty.sol | 4 +- .../storage/packed_storage_structs_bytes.sol | 2 +- ...ta_struct_with_nested_array_to_storage.sol | 2 +- .../conversion/recursive_storage_memory.sol | 2 +- .../structs/copy_from_mapping.sol | 4 +- .../copy_struct_array_from_storage.sol | 2 +- .../copy_substructures_from_mapping.sol | 4 +- .../structs/copy_substructures_to_mapping.sol | 12 +- .../semanticTests/structs/copy_to_mapping.sol | 8 +- .../structs/memory_structs_nested_load.sol | 2 +- ...truct_containing_bytes_copy_and_delete.sol | 8 +- .../semanticTests/structs/struct_copy.sol | 4 +- .../structs/struct_copy_via_local.sol | 2 +- .../struct_delete_storage_with_array.sol | 4 +- .../semanticTests/structs/structs.sol | 2 +- .../userDefinedValueType/calldata.sol | 4 +- .../userDefinedValueType/erc20.sol | 2 +- .../semanticTests/various/address_code.sol | 4 +- .../semanticTests/various/create_calldata.sol | 4 +- .../various/destructuring_assignment.sol | 4 +- .../semanticTests/various/erc20.sol | 2 +- .../various/negative_stack_height.sol | 2 +- .../semanticTests/various/selfdestruct.sol | 2 +- .../semanticTests/various/senders_balance.sol | 2 +- .../skip_dynamic_types_for_structs.sol | 4 +- .../various/staticcall_for_view_and_pure.sol | 4 +- .../various/swap_in_storage_overwrite.sol | 2 +- .../semanticTests/various/value_complex.sol | 2 +- .../semanticTests/various/value_insane.sol | 2 +- .../viaYul/copy_struct_invalid_ir_bug.sol | 2 +- .../objectCompiler/nested_optimizer.yul | 6 +- .../objectCompiler/simple_optimizer.yul | 4 +- .../replace_return_nonzero.yul | 4 +- .../unassigned_return.yul | 6 +- .../combine_add_and_mod_constant.yul | 6 +- .../combine_mul_and_mod_constant.yul | 6 +- .../expressionSimplifier/create2_and_mask.yul | 6 +- .../expressionSimplifier/create_and_mask.yul | 7 +- .../exp_simplifications.yul | 7 +- .../identity_rules_complex.yul | 8 +- .../identity_rules_negative.yul | 5 +- .../expressionSimplifier/iszero_sub_to_eq.yul | 7 +- .../large_byte_access.yul | 7 +- .../expressionSimplifier/mod_and_1.yul | 5 +- .../expressionSimplifier/mod_and_2.yul | 5 +- ...lied_function_call_different_arguments.yul | 8 +- ...d_removes_non_constant_and_not_movable.yul | 8 +- .../pop_byte_shr_call.yul | 7 +- .../expressionSimplifier/reassign.yul | 9 +- .../remove_redundant_shift_masking.yul | 8 +- .../expressionSimplifier/reversed.yul | 9 +- .../unassigend_vars_multi.yul | 9 +- .../expressionSimplifier/zero_length_read.yul | 14 +- .../fullSimplify/constant_propagation.yul | 9 +- .../fullSimplify/identity_rules_complex.yul | 8 +- .../fullSimplify/identity_rules_negative.yul | 5 +- .../fullSimplify/invariant.yul | 5 +- .../fullSimplify/mod_and_1.yul | 5 +- .../fullSimplify/mod_and_2.yul | 5 +- ...lied_function_call_different_arguments.yul | 8 +- ...d_removes_non_constant_and_not_movable.yul | 7 +- .../fullSimplify/reversed.yul | 9 +- .../fullSuite/abi_example1.yul | 19 +- .../yulOptimizerTests/fullSuite/aztec.yul | 24 +- .../fullSuite/clear_after_if_continue.yul | 12 +- .../fullSuite/create2_and_mask.yul | 7 +- .../fullSuite/devcon_example.yul | 4 +- .../fullSuite/loopInvariantCodeMotion.yul | 4 +- .../fullSuite/stack_compressor_msize.yul | 3 +- .../static_array_slot_computation.yul | 18 +- .../unusedFunctionParameterPruner.yul | 3 + .../unusedFunctionParameterPruner_loop.yul | 13 +- .../unusedFunctionParameterPruner_return.yul | 4 + .../unusedFunctionParameterPruner_simple.yul | 4 + .../yulOptimizerTests/loadResolver/keccak.yul | 8 +- .../loadResolver/keccak_fail1.yul | 10 +- .../loadResolver/keccak_reuse_basic.yul | 9 +- .../loadResolver/keccak_reuse_expr_mstore.yul | 13 +- .../keccak_reuse_in_expression.yul | 7 +- .../loadResolver/keccak_reuse_msize.yul | 9 +- .../loadResolver/keccak_reuse_mstore.yul | 7 +- .../loadResolver/keccak_short.yul | 16 +- .../loadResolver/keccak_string_literal.yul | 8 +- .../loadResolver/keccak_symbolic_memory.yul | 7 +- .../loadResolver/keccak_with_msize.yul | 10 +- .../yulOptimizerTests/loadResolver/loop.yul | 10 +- ...y_with_different_kinds_of_invalidation.yul | 16 +- .../loadResolver/memory_with_msize.yul | 8 +- .../loadResolver/merge_known_write.yul | 13 +- .../merge_known_write_with_distance.yul | 14 +- .../merge_mload_with_known_distance.yul | 12 +- .../merge_mload_without_rewrite.yul | 8 +- .../loadResolver/merge_unknown_write.yul | 13 +- .../loadResolver/mload_in_function.yul | 13 +- .../loadResolver/mload_self.yul | 7 +- .../mstore_in_function_loop_body.yul | 15 +- .../mstore_in_function_loop_init.yul | 11 +- .../loadResolver/multi_sload_loop.yul | 13 +- .../loadResolver/re_store_memory.yul | 4 +- .../loadResolver/re_store_storage.yul | 4 +- .../loadResolver/reassign.yul | 7 +- .../loadResolver/second_store.yul | 8 +- .../loadResolver/second_store_same_value.yul | 7 +- .../side_effects_of_user_functions.yul | 8 +- .../yulOptimizerTests/loadResolver/simple.yul | 5 +- .../loadResolver/simple_memory.yul | 5 +- .../loadResolver/staticcall.yul | 6 +- .../loadResolver/zero_length_reads.yul | 32 +- 280 files changed, 1188 insertions(+), 1097 deletions(-) diff --git a/libyul/optimiser/CommonSubexpressionEliminator.cpp b/libyul/optimiser/CommonSubexpressionEliminator.cpp index 5d085cdd4..2e3a800a3 100644 --- a/libyul/optimiser/CommonSubexpressionEliminator.cpp +++ b/libyul/optimiser/CommonSubexpressionEliminator.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -110,14 +111,22 @@ void CommonSubexpressionEliminator::visit(Expression& _e) if (AssignedValue const* value = variableValue(variable)) { assertThrow(value->value, OptimizerException, ""); - // Prevent using the default value of return variables - // instead of literal zeros. if ( - m_returnVariables.count(variable) && holds_alternative(*value->value) && valueOfLiteral(get(*value->value)) == 0 ) - continue; + { + // Prevent using the default value of return variables + // instead of literal zeros. + if (m_returnVariables.count(variable)) + continue; + // Do not replace literal zeros when PUSH0 command is available. + if (auto&& evmDialect = dynamic_cast(&m_dialect)) + { + if (evmDialect->evmVersion().hasPush0()) + continue; + } + } // We check for syntactic equality again because the value might have changed. if (inScope(variable) && SyntacticallyEqual{}(_e, *value->value)) { diff --git a/test/cmdlineTests/ast_ir/output b/test/cmdlineTests/ast_ir/output index cca31349e..35d70a162 100644 --- a/test/cmdlineTests/ast_ir/output +++ b/test/cmdlineTests/ast_ir/output @@ -815,7 +815,7 @@ Optimized IR AST: [ { "kind": "number", - "nativeSrc": "650:1:0", + "nativeSrc": "647:1:0", "nodeType": "YulLiteral", "src": "60:13:0", "type": "", @@ -1028,7 +1028,59 @@ Optimized IR AST: [ { "kind": "number", - "nativeSrc": "1490:1:0", + "nativeSrc": "996:2:0", + "nodeType": "YulLiteral", + "src": "60:13:0", + "type": "", + "value": "64" + }, + { + "arguments": + [ + { + "kind": "number", + "nativeSrc": "1012:3:0", + "nodeType": "YulLiteral", + "src": "60:13:0", + "type": "", + "value": "0x80" + } + ], + "functionName": + { + "name": "memoryguard", + "nativeSrc": "1000:11:0", + "nodeType": "YulIdentifier", + "src": "60:13:0" + }, + "nativeSrc": "1000:16:0", + "nodeType": "YulFunctionCall", + "src": "60:13:0" + } + ], + "functionName": + { + "name": "mstore", + "nativeSrc": "989:6:0", + "nodeType": "YulIdentifier", + "src": "60:13:0" + }, + "nativeSrc": "989:28:0", + "nodeType": "YulFunctionCall", + "src": "60:13:0" + }, + "nativeSrc": "989:28:0", + "nodeType": "YulExpressionStatement", + "src": "60:13:0" + }, + { + "expression": + { + "arguments": + [ + { + "kind": "number", + "nativeSrc": "1487:1:0", "nodeType": "YulLiteral", "src": "60:13:0", "type": "", diff --git a/test/cmdlineTests/constant_optimizer_yul/output b/test/cmdlineTests/constant_optimizer_yul/output index 9c7faa732..40cb56cb6 100644 --- a/test/cmdlineTests/constant_optimizer_yul/output +++ b/test/cmdlineTests/constant_optimizer_yul/output @@ -20,6 +20,7 @@ object "C_12" { code { { /// @src 0:61:418 "contract C {..." + mstore(64, memoryguard(0x80)) if callvalue() { revert(0, 0) } /// @src 0:279:410 "assembly {..." sstore(0, 0x1000000000000000000000000000000000000000000000) diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output index 115bf34cc..74faeee70 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output @@ -187,14 +187,14 @@ object "C_6" { code { { /// @src 0:60:101 "contract C {..." + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output index 33faf3cf1..c5197a5d7 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output @@ -186,14 +186,14 @@ object "C_6" { code { { /// @src 0:60:101 + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output index 330715023..0cead7005 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output @@ -175,14 +175,14 @@ object "C_6" { object "C_6_deployed" { code { { + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output b/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output index 9fb9a2dbc..bac223fa5 100644 --- a/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output +++ b/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output @@ -81,6 +81,7 @@ object "C_2" { code { { /// @src 0:265:278 "contract C {}" + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -434,65 +435,64 @@ object "D_27" { mstore(_2, _1) if iszero(lt(calldatasize(), 4)) { - let _3 := 0 - if eq(0x26121ff0, shr(224, calldataload(_3))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } /// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." - let _4 := datasize("C_2") - let _5 := add(_1, _4) - let _6 := 0xffffffffffffffff - if or(gt(_5, _6), lt(_5, _1)) + let _3 := datasize("C_2") + let _4 := add(_1, _3) + let _5 := 0xffffffffffffffff + if or(gt(_4, _5), lt(_4, _1)) { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." - mstore(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_3, 0x24) + revert(0, 0x24) } /// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." - datacopy(_1, dataoffset("C_2"), _4) - if iszero(create(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ _3, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _1, sub(_5, _1))) + datacopy(_1, dataoffset("C_2"), _3) + if iszero(create(0, _1, sub(_4, _1))) { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." let pos := mload(_2) - returndatacopy(pos, _3, returndatasize()) + 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()\"..." */ _6), /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ lt(newFreePtr, memPtr)) + 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(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_3, 0x24) + revert(0, 0x24) } mstore(_2, newFreePtr) mstore(memPtr, 2) - let _7 := 32 - mstore(add(memPtr, _7), "/*") + 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()\"..." */ _6), /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ lt(newFreePtr_1, memPtr_1)) + 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(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_3, 0x24) + revert(0, 0x24) } mstore(_2, newFreePtr_1) mstore(memPtr_1, 39) - mstore(add(memPtr_1, _7), 0x2f2a2a204073726320303a39363a313635202022636f6e74726163742044207b) + mstore(add(memPtr_1, _6), 0x2f2a2a204073726320303a39363a313635202022636f6e74726163742044207b) mstore(add(memPtr_1, _2), shl(200, 0x2e2e2e22202a2f)) let memPos := mload(_2) - mstore(memPos, _7) + mstore(memPos, _6) let length := mload(memPtr_1) - mstore(add(memPos, _7), length) - let i := _3 - for { } lt(i, length) { i := add(i, _7) } + mstore(add(memPos, _6), length) + let i := 0 + for { } lt(i, length) { i := add(i, _6) } { - mstore(add(add(memPos, i), _2), mload(add(add(memPtr_1, i), _7))) + mstore(add(add(memPos, i), _2), mload(add(add(memPtr_1, i), _6))) } - mstore(add(add(memPos, length), _2), _3) + mstore(add(add(memPos, length), _2), 0) return(memPos, add(sub(add(memPos, and(add(length, 31), not(31))), memPos), _2)) } } @@ -517,6 +517,7 @@ object "D_27" { code { { /// @src 0:265:278 "contract C {}" + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output b/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output index 84fd9d0bc..1c9c3ca3c 100644 --- a/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output +++ b/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output @@ -17,6 +17,7 @@ object "C_7" { code { { /// @src 0:82:117 "contract C {..." + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -43,6 +44,7 @@ object "D_10" { code { { /// @src 0:118:137 "contract D is C {..." + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/ir_compiler_subobjects/output b/test/cmdlineTests/ir_compiler_subobjects/output index 0a505a4ac..4b206a9a5 100644 --- a/test/cmdlineTests/ir_compiler_subobjects/output +++ b/test/cmdlineTests/ir_compiler_subobjects/output @@ -17,6 +17,7 @@ object "C_3" { code { { /// @src 0:82:95 "contract C {}" + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -47,31 +48,30 @@ object "D_16" { mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _2 := 0 - if eq(0x26121ff0, shr(224, calldataload(_2))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_2, _2) } - if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } /// @src 0:149:156 "new C()" - let _3 := datasize("C_3") - let _4 := add(_1, _3) - if or(gt(_4, 0xffffffffffffffff), lt(_4, _1)) + let _2 := datasize("C_3") + let _3 := add(_1, _2) + if or(gt(_3, 0xffffffffffffffff), lt(_3, _1)) { /// @src 0:96:165 "contract D {..." - mstore(_2, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_2, 0x24) + revert(0, 0x24) } /// @src 0:149:156 "new C()" - datacopy(_1, dataoffset("C_3"), _3) - if iszero(create(/** @src 0:96:165 "contract D {..." */ _2, /** @src 0:149:156 "new C()" */ _1, sub(_4, _1))) + datacopy(_1, dataoffset("C_3"), _2) + if iszero(create(0, _1, sub(_3, _1))) { /// @src 0:96:165 "contract D {..." let pos := mload(64) - returndatacopy(pos, _2, returndatasize()) + returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } - return(_2, _2) + return(0, 0) } } revert(0, 0) @@ -95,6 +95,7 @@ object "D_16" { code { { /// @src 0:82:95 "contract C {}" + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output b/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output index 50915c8dc..d82d30d68 100644 --- a/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output +++ b/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output @@ -4,7 +4,11 @@ object "D_12" { code { { /// @src 0:82:175 "contract D {..." + mstore(64, 128) if callvalue() { revert(0, 0) } + /// @src 0:115:139 "assembly { mstore(0,0) }" + mstore(0, 0) + /// @src 0:82:175 "contract D {..." let _1 := datasize("D_12_deployed") codecopy(128, dataoffset("D_12_deployed"), _1) return(128, _1) @@ -15,14 +19,14 @@ object "D_12" { code { { /// @src 0:82:175 "contract D {..." + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output b/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output index b81febf73..5e02b84d5 100644 --- a/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output +++ b/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output @@ -17,14 +17,17 @@ object "D_8" { code { { /// @src 0:82:166 "contract D {..." + mstore(64, 128) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + /// @src 0:134:158 "assembly { mstore(0,0) }" + mstore(0, 0) + /// @src 0:82:166 "contract D {..." + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/keccak_optimization_deploy_code/output b/test/cmdlineTests/keccak_optimization_deploy_code/output index 8b89ea5b6..5fbeed3ed 100644 --- a/test/cmdlineTests/keccak_optimization_deploy_code/output +++ b/test/cmdlineTests/keccak_optimization_deploy_code/output @@ -4,6 +4,7 @@ object "C_12" { code { { /// @src 0:62:463 "contract C {..." + mstore(64, 128) if callvalue() { revert(0, 0) } /// @src 0:103:275 "assembly {..." mstore(0, 100) @@ -19,9 +20,11 @@ object "C_12" { code { { /// @src 0:62:463 "contract C {..." + mstore(64, 128) if callvalue() { revert(0, 0) } /// @src 0:317:454 "assembly {..." - sstore(0, 17385872270140913825666367956517731270094621555228275961425792378517567244498) + mstore(0, 100) + sstore(0, keccak256(0, 32)) /// @src 0:62:463 "contract C {..." stop() } diff --git a/test/cmdlineTests/keccak_optimization_low_runs/output b/test/cmdlineTests/keccak_optimization_low_runs/output index c308d737b..4f026b45e 100644 --- a/test/cmdlineTests/keccak_optimization_low_runs/output +++ b/test/cmdlineTests/keccak_optimization_low_runs/output @@ -17,6 +17,7 @@ object "C_7" { code { { /// @src 0:62:285 "contract C {..." + mstore(64, 128) if callvalue() { revert(0, 0) } /// @src 0:109:277 "assembly {..." mstore(0, 100) diff --git a/test/cmdlineTests/name_simplifier/output b/test/cmdlineTests/name_simplifier/output index 170e58ffb..e162e313d 100644 --- a/test/cmdlineTests/name_simplifier/output +++ b/test/cmdlineTests/name_simplifier/output @@ -18,104 +18,104 @@ object "C_59" { { /// @src 0:346:625 "contract C {..." let _1 := memoryguard(0x80) - let _2 := 4 - if iszero(lt(calldatasize(), _2)) + let _2 := 64 + mstore(_2, _1) + let _3 := 4 + if iszero(lt(calldatasize(), _3)) { - let _3 := 0 - if eq(0xf8eddcc6, shr(224, calldataload(_3))) + if eq(0xf8eddcc6, shr(224, calldataload(0))) { - if callvalue() { revert(_3, _3) } + if callvalue() { revert(0, 0) } let _4 := 32 - if slt(add(calldatasize(), not(3)), _4) { revert(_3, _3) } - let offset := calldataload(_2) + if slt(add(calldatasize(), not(3)), _4) { revert(0, 0) } + let offset := calldataload(_3) let _5 := 0xffffffffffffffff - if gt(offset, _5) { revert(_3, _3) } - if iszero(slt(add(offset, 35), calldatasize())) { revert(_3, _3) } - let _6 := calldataload(add(_2, offset)) + if gt(offset, _5) { revert(0, 0) } + if iszero(slt(add(offset, 35), calldatasize())) { revert(0, 0) } + let _6 := calldataload(add(_3, offset)) let _7 := 36 if gt(_6, _5) { - mstore(_3, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(_3, _7) + mstore(0, shl(224, 0x4e487b71)) + mstore(_3, 0x41) + revert(0, _7) } let _8 := shl(5, _6) let _9 := not(31) let newFreePtr := add(_1, and(add(_8, 63), _9)) if or(gt(newFreePtr, _5), lt(newFreePtr, _1)) { - mstore(_3, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(_3, _7) + mstore(0, shl(224, 0x4e487b71)) + mstore(_3, 0x41) + revert(0, _7) } - let _10 := 64 - mstore(_10, newFreePtr) + mstore(_2, newFreePtr) let dst := _1 mstore(_1, _6) dst := add(_1, _4) let dst_1 := dst let srcEnd := add(add(offset, _8), _7) - if gt(srcEnd, calldatasize()) { revert(_3, _3) } + if gt(srcEnd, calldatasize()) { revert(0, 0) } let src := add(offset, _7) for { } lt(src, srcEnd) { src := add(src, _4) } { - if slt(sub(calldatasize(), src), _4) { revert(_3, _3) } - let memPtr := mload(_10) + if slt(sub(calldatasize(), src), _4) { revert(0, 0) } + let memPtr := mload(_2) let newFreePtr_1 := add(memPtr, _4) if or(gt(newFreePtr_1, _5), lt(newFreePtr_1, memPtr)) { - mstore(_3, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(_3, _7) + mstore(0, shl(224, 0x4e487b71)) + mstore(_3, 0x41) + revert(0, _7) } - mstore(_10, newFreePtr_1) + mstore(_2, newFreePtr_1) mstore(memPtr, calldataload(src)) mstore(dst, memPtr) dst := add(dst, _4) } if iszero(mload(_1)) { - mstore(_3, shl(224, 0x4e487b71)) - mstore(_2, 0x32) - revert(_3, _7) + mstore(0, shl(224, 0x4e487b71)) + mstore(_3, 0x32) + revert(0, _7) } - sstore(_3, mload(/** @src 0:469:474 "_s[0]" */ mload(dst_1))) + sstore(0, mload(/** @src 0:469:474 "_s[0]" */ mload(dst_1))) /// @src 0:346:625 "contract C {..." if iszero(lt(/** @src 0:492:493 "1" */ 0x01, /** @src 0:346:625 "contract C {..." */ mload(_1))) { - mstore(_3, shl(224, 0x4e487b71)) - mstore(_2, 0x32) - revert(_3, _7) + mstore(0, shl(224, 0x4e487b71)) + mstore(_3, 0x32) + revert(0, _7) } - let _11 := mload(/** @src 0:489:494 "_s[1]" */ mload(/** @src 0:346:625 "contract C {..." */ add(_1, _10))) - sstore(0x02, _11) - let memPtr_1 := mload(_10) + let _10 := mload(/** @src 0:489:494 "_s[1]" */ mload(/** @src 0:346:625 "contract C {..." */ add(_1, _2))) + sstore(0x02, _10) + let memPtr_1 := mload(_2) let newFreePtr_2 := add(memPtr_1, 160) if or(gt(newFreePtr_2, _5), lt(newFreePtr_2, memPtr_1)) { - mstore(_3, shl(224, 0x4e487b71)) - mstore(_2, 0x41) - revert(_3, _7) + mstore(0, shl(224, 0x4e487b71)) + mstore(_3, 0x41) + revert(0, _7) } - mstore(_10, newFreePtr_2) + mstore(_2, newFreePtr_2) mstore(memPtr_1, 100) mstore(add(memPtr_1, _4), "longstringlongstringlongstringlo") - mstore(add(memPtr_1, _10), "ngstringlongstringlongstringlong") - let _12 := 96 - mstore(add(memPtr_1, _12), "stringlongstringlongstringlongst") + mstore(add(memPtr_1, _2), "ngstringlongstringlongstringlong") + let _11 := 96 + mstore(add(memPtr_1, _11), "stringlongstringlongstringlongst") mstore(add(memPtr_1, 128), "ring") - let memPos := mload(_10) - mstore(memPos, _11) - mstore(add(memPos, _4), _10) + let memPos := mload(_2) + mstore(memPos, _10) + mstore(add(memPos, _4), _2) let length := mload(memPtr_1) - mstore(add(memPos, _10), length) - let i := _3 + mstore(add(memPos, _2), length) + let i := 0 for { } lt(i, length) { i := add(i, _4) } { - mstore(add(add(memPos, i), _12), mload(add(add(memPtr_1, i), _4))) + mstore(add(add(memPos, i), _11), mload(add(add(memPtr_1, i), _4))) } - mstore(add(add(memPos, length), _12), _3) - return(memPos, add(sub(add(memPos, and(add(length, 31), _9)), memPos), _12)) + mstore(add(add(memPos, length), _11), 0) + return(memPos, add(sub(add(memPos, and(add(length, 31), _9)), memPos), _11)) } } revert(0, 0) diff --git a/test/cmdlineTests/no_cbor_metadata/output b/test/cmdlineTests/no_cbor_metadata/output index 0328ece3f..cc971f314 100644 --- a/test/cmdlineTests/no_cbor_metadata/output +++ b/test/cmdlineTests/no_cbor_metadata/output @@ -1,4 +1,4 @@ ======= no_cbor_metadata/input.sol:C ======= Binary: -608080604052346013576003908160188239f35b5f80fdfe5f80fd +608080604052346013576008908160188239f35b5f80fdfe60806040525f80fd diff --git a/test/cmdlineTests/object_compiler/output b/test/cmdlineTests/object_compiler/output index 5dd572272..4ec7e00e7 100644 --- a/test/cmdlineTests/object_compiler/output +++ b/test/cmdlineTests/object_compiler/output @@ -37,11 +37,11 @@ Text representation: /* "object_compiler/input.yul":217:238 */ dup1 dataOffset(sub_0) - /* "object_compiler/input.yul":125:126 */ + /* "object_compiler/input.yul":214:215 */ 0x00 /* "object_compiler/input.yul":205:260 */ codecopy - /* "object_compiler/input.yul":125:126 */ + /* "object_compiler/input.yul":272:273 */ 0x00 /* "object_compiler/input.yul":265:295 */ return @@ -52,13 +52,13 @@ sub_0: assembly { 0x00 /* "object_compiler/input.yul":391:399 */ sload - /* "object_compiler/input.yul":397:398 */ + /* "object_compiler/input.yul":388:389 */ 0x00 /* "object_compiler/input.yul":381:400 */ mstore /* "object_compiler/input.yul":417:421 */ 0x20 - /* "object_compiler/input.yul":397:398 */ + /* "object_compiler/input.yul":414:415 */ 0x00 /* "object_compiler/input.yul":407:422 */ return diff --git a/test/cmdlineTests/optimizer_array_sload/output b/test/cmdlineTests/optimizer_array_sload/output index 98b23306a..ea2e6e995 100644 --- a/test/cmdlineTests/optimizer_array_sload/output +++ b/test/cmdlineTests/optimizer_array_sload/output @@ -21,26 +21,30 @@ object "Arraysum_34" { let _1 := 4 if iszero(lt(calldatasize(), _1)) { - let _2 := 0 - if eq(0x81d73423, shr(224, calldataload(_2))) + if eq(0x81d73423, shr(224, calldataload(0))) { - if callvalue() { revert(_2, _2) } - if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } - let var_sum := _2 + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + let var_sum := /** @src -1:-1:-1 */ 0 + /// @src 0:175:182 "sum = 0" + var_sum := /** @src 0:181:182 "0" */ 0x00 /// @src 0:368:378 "uint i = 0" - let var_i := /** @src 0:80:429 "contract Arraysum {..." */ _2 - let _3 := sload(_2) + let var_i := /** @src 0:181:182 "0" */ 0x00 + /// @src 0:80:429 "contract Arraysum {..." + let _2 := sload(/** @src 0:384:390 "values" */ 0x00) + /// @src 0:80:429 "contract Arraysum {..." + let _3 := sload(/** @src 0:414:420 "values" */ 0x00) /// @src 0:364:423 "for(uint i = 0; i < values.length; i++)..." for { } - /** @src 0:380:397 "i < values.length" */ lt(var_i, _3) + /** @src 0:380:397 "i < values.length" */ lt(var_i, _2) /// @src 0:368:378 "uint i = 0" { /// @src 0:80:429 "contract Arraysum {..." if eq(var_i, not(0)) { - mstore(_2, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(_1, 0x11) - revert(_2, 0x24) + revert(0, 0x24) } /// @src 0:399:402 "i++" var_i := /** @src 0:80:429 "contract Arraysum {..." */ add(var_i, 1) @@ -48,13 +52,20 @@ object "Arraysum_34" { /// @src 0:399:402 "i++" { /// @src 0:80:429 "contract Arraysum {..." - mstore(_2, _2) - let sum := add(var_sum, sload(add(18569430475105882587588266137607568536673111973893317399460219858819262702947, var_i))) + if iszero(lt(var_i, _3)) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(_1, 0x32) + revert(0, 0x24) + } + mstore(0, /** @src 0:414:420 "values" */ 0x00) + /// @src 0:80:429 "contract Arraysum {..." + let sum := add(var_sum, sload(add(keccak256(0, 0x20), var_i))) if gt(var_sum, sum) { - mstore(_2, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(_1, 0x11) - revert(_2, 0x24) + revert(0, 0x24) } /// @src 0:407:423 "sum += values[i]" var_sum := sum @@ -62,7 +73,7 @@ object "Arraysum_34" { /// @src 0:80:429 "contract Arraysum {..." let memPos := mload(64) mstore(memPos, var_sum) - return(memPos, 32) + return(memPos, 0x20) } } 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 28a76eb95..1c2cf2f30 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 @@ -9,6 +9,9 @@ { "assembly": " /* \"C\":79:428 contract C... */ 0xa0 + dup1 + 0x40 + mstore jumpi(tag_5, callvalue) 0x1f bytecodeSize @@ -51,6 +54,7 @@ mload /* \"C\":147:149 42 */ mstore(0x80, 0x2a) + /* \"C\":203:219 stateVar = _init */ 0x00 /* \"C\":79:428 contract C... */ sstore @@ -82,20 +86,16 @@ sub_0: assembly { /* \"C\":79:428 contract C... */ 0x80 0x40 - dup2 - dup2 + swap1 + dup1 + dup3 mstore jumpi(tag_2, iszero(lt(calldatasize, 0x04))) 0x00 dup1 revert tag_2: - 0x00 - swap2 - dup3 - calldataload - 0xe0 - shr + shr(0xe0, calldataload(0x00)) swap1 dup2 0x26121ff0 @@ -116,13 +116,11 @@ sub_0: assembly { dup1 revert tag_8: - jumpi(tag_12, callvalue) - dup2 - add(calldatasize, not(0x03)) - slt - tag_12 - jumpi - dup2 + jumpi(tag_26, callvalue) + jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) + /* \"C\":322:332 stateVar++ */ + 0x00 + /* \"C\":79:428 contract C... */ sload sub(shl(0xff, 0x01), 0x01) dup2 @@ -131,9 +129,11 @@ sub_0: assembly { jumpi 0x01 add - swap2 - dup3 + /* \"C\":322:332 stateVar++ */ + 0x00 + /* \"C\":79:428 contract C... */ dup2 + swap1 sstore dup2 mload @@ -141,48 +141,52 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ dup2 mstore - 0x20 - /* \"C\":403:407 this */ - dup2 /* \"C\":79:428 contract C... */ + swap2 + swap1 + /* \"C\":403:411 this.f() */ + 0x20 + /* \"C\":79:428 contract C... */ + dup4 0x04 - /* \"C\":403:407 this */ dup2 + /* \"C\":403:407 this */ address /* \"C\":403:411 this.f() */ gas staticcall - swap2 - dup3 + swap3 + dup4 iszero tag_16 jumpi - dup1 - swap3 + 0x00 + swap4 tag_18 jumpi /* \"C\":79:428 contract C... */ tag_19: + /* \"C\":392:411 stateVar + this.f() */ + pop + tag_20 /* \"C\":403:411 this.f() */ 0x20 /* \"C\":392:411 stateVar + this.f() */ - dup5 + swap4 /* \"C\":392:422 stateVar + this.f() + immutVar */ - tag_20 - /* \"C\":392:411 stateVar + this.f() */ tag_21 - dup7 - dup10 + /* \"C\":392:411 stateVar + this.f() */ + swap3 tag_1 jump\t// in - tag_21: + tag_20: /* \"C\":414:422 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":392:422 stateVar + this.f() + immutVar */ swap1 tag_1 jump\t// in - tag_20: + tag_21: /* \"C\":79:428 contract C... */ swap1 mload @@ -192,8 +196,7 @@ sub_0: assembly { return /* \"C\":403:411 this.f() */ tag_18: - swap1 - swap2 + swap3 pop 0x20 returndatasize @@ -208,12 +211,12 @@ sub_0: assembly { add not(0x1f) and - dup4 + dup5 add 0xffffffffffffffff dup2 gt - dup5 + dup6 dup3 lt or @@ -223,9 +226,9 @@ sub_0: assembly { 0x20 /* \"C\":79:428 contract C... */ swap2 - dup5 + dup6 swap2 - dup7 + dup6 mstore /* \"C\":403:411 this.f() */ dup2 @@ -235,27 +238,26 @@ sub_0: assembly { slt tag_26 jumpi - pop + swap2 mload + swap2 /* \"C\":392:411 stateVar + this.f() */ - tag_21 + tag_20 /* \"C\":403:411 this.f() */ - 0x20 jump(tag_19) /* \"C\":79:428 contract C... */ tag_26: + 0x00 dup1 revert tag_24: + /* \"C\":117:119 41 */ shl(0xe0, 0x4e487b71) - dup4 + /* \"C\":79:428 contract C... */ + 0x00 mstore mstore(0x04, 0x41) - 0x24 - /* \"C\":117:119 41 */ - dup4 - /* \"C\":79:428 contract C... */ - revert + revert(0x00, 0x24) /* \"C\":403:411 this.f() */ tag_22: pop @@ -263,44 +265,34 @@ sub_0: assembly { jump(tag_23) tag_16: /* \"C\":79:428 contract C... */ - dup4 + dup3 mload - swap1 returndatasize - swap1 + 0x00 dup3 returndatacopy returndatasize swap1 revert tag_14: - shl(0xe0, 0x4e487b71) /* \"C\":117:119 41 */ - dup4 - mstore + mstore(0x00, shl(0xe0, 0x4e487b71)) 0x11 /* \"C\":79:428 contract C... */ 0x04 /* \"C\":117:119 41 */ mstore - 0x24 - dup4 - revert + revert(0x00, 0x24) /* \"C\":79:428 contract C... */ - tag_12: - pop - dup1 - revert tag_6: pop - jumpi(tag_12, callvalue) - dup2 - add(calldatasize, not(0x03)) - slt - tag_12 - jumpi + jumpi(tag_26, callvalue) + jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) 0x20 - swap2 + swap1 + /* \"C\":152:171 int public stateVar */ + 0x00 + /* \"C\":79:428 contract C... */ sload swap1 mload @@ -309,22 +301,17 @@ sub_0: assembly { mstore return tag_4: - dup4 - swap1 - jumpi(tag_12, callvalue) - dup2 - add(calldatasize, not(0x03)) - slt - tag_12 - jumpi + jumpi(tag_26, callvalue) + jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) /* \"C\":290:298 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":117:119 41 */ - dup1 - 0x29 - add swap1 dup2 + 0x29 + add + swap2 + dup3 slt 0x01 and @@ -332,8 +319,7 @@ sub_0: assembly { jumpi /* \"C\":79:428 contract C... */ 0x20 - swap3 - pop + swap2 dup2 mstore return @@ -360,13 +346,9 @@ sub_0: assembly { iszero and or - tag_38 + tag_14 jumpi jump\t// out - tag_38: - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, 0x11) - revert(0x00, 0x24) auxdata: } @@ -382,6 +364,9 @@ sub_0: assembly { { "assembly": " /* \"D\":91:166 contract D is C(3)... */ 0xa0 + dup1 + 0x40 + mstore jumpi(tag_5, callvalue) 0x1f bytecodeSize @@ -424,11 +409,15 @@ 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 + /* \"C\":203:219 stateVar = _init */ + 0x00 /* \"D\":91:166 contract D is C(3)... */ + dup2 + swap1 + sstore + dup2 add swap1 dup2 @@ -437,7 +426,9 @@ sub_0: assembly { and tag_7 jumpi + /* \"D\":142:160 stateVar += _init2 */ 0x00 + /* \"D\":91:166 contract D is C(3)... */ sstore mload(0x40) dataSize(sub_0) @@ -471,20 +462,16 @@ sub_0: assembly { /* \"D\":91:166 contract D is C(3)... */ 0x80 0x40 - dup2 - dup2 + swap1 + dup1 + dup3 mstore jumpi(tag_2, iszero(lt(calldatasize, 0x04))) 0x00 dup1 revert tag_2: - 0x00 - swap2 - dup3 - calldataload - 0xe0 - shr + shr(0xe0, calldataload(0x00)) swap1 dup2 0x26121ff0 @@ -505,13 +492,11 @@ sub_0: assembly { dup1 revert tag_8: - jumpi(tag_12, callvalue) - dup2 - add(calldatasize, not(0x03)) - slt - tag_12 - jumpi - dup2 + jumpi(tag_26, callvalue) + jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) + /* \"C\":322:332 stateVar++ */ + 0x00 + /* \"D\":91:166 contract D is C(3)... */ sload sub(shl(0xff, 0x01), 0x01) dup2 @@ -520,9 +505,11 @@ sub_0: assembly { jumpi 0x01 add - swap2 - dup3 + /* \"C\":322:332 stateVar++ */ + 0x00 + /* \"D\":91:166 contract D is C(3)... */ dup2 + swap1 sstore dup2 mload @@ -530,48 +517,52 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ dup2 mstore - 0x20 - /* \"C\":403:407 this */ - dup2 /* \"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 0x04 - /* \"C\":403:407 this */ dup2 + /* \"C\":403:407 this */ address /* \"C\":403:411 this.f() */ gas staticcall - swap2 - dup3 + swap3 + dup4 iszero tag_16 jumpi - dup1 - swap3 + 0x00 + swap4 tag_18 jumpi /* \"D\":91:166 contract D is C(3)... */ tag_19: + /* \"C\":392:411 stateVar + this.f() */ + pop + tag_20 /* \"C\":403:411 this.f() */ 0x20 /* \"C\":392:411 stateVar + this.f() */ - dup5 + swap4 /* \"C\":392:422 stateVar + this.f() + immutVar */ - tag_20 - /* \"C\":392:411 stateVar + this.f() */ tag_21 - dup7 - dup10 + /* \"C\":392:411 stateVar + this.f() */ + swap3 tag_1 jump\t// in - tag_21: + tag_20: /* \"C\":414:422 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":392:422 stateVar + this.f() + immutVar */ swap1 tag_1 jump\t// in - tag_20: + tag_21: /* \"D\":91:166 contract D is C(3)... */ swap1 mload @@ -581,8 +572,7 @@ sub_0: assembly { return /* \"C\":403:411 this.f() */ tag_18: - swap1 - swap2 + swap3 pop 0x20 returndatasize @@ -597,12 +587,12 @@ sub_0: assembly { add not(0x1f) and - dup4 + dup5 add 0xffffffffffffffff dup2 gt - dup5 + dup6 dup3 lt or @@ -612,9 +602,9 @@ sub_0: assembly { 0x20 /* \"D\":91:166 contract D is C(3)... */ swap2 - dup5 + dup6 swap2 - dup7 + dup6 mstore /* \"C\":403:411 this.f() */ dup2 @@ -624,27 +614,26 @@ sub_0: assembly { slt tag_26 jumpi - pop + swap2 mload + swap2 /* \"C\":392:411 stateVar + this.f() */ - tag_21 + tag_20 /* \"C\":403:411 this.f() */ - 0x20 jump(tag_19) /* \"D\":91:166 contract D is C(3)... */ tag_26: + 0x00 dup1 revert tag_24: + /* \"C\":117:119 41 */ shl(0xe0, 0x4e487b71) - dup4 + /* \"D\":91:166 contract D is C(3)... */ + 0x00 mstore mstore(0x04, 0x41) - 0x24 - /* \"C\":117:119 41 */ - dup4 - /* \"D\":91:166 contract D is C(3)... */ - revert + revert(0x00, 0x24) /* \"C\":403:411 this.f() */ tag_22: pop @@ -652,44 +641,34 @@ sub_0: assembly { jump(tag_23) tag_16: /* \"D\":91:166 contract D is C(3)... */ - dup4 + dup3 mload - swap1 returndatasize - swap1 + 0x00 dup3 returndatacopy returndatasize swap1 revert tag_14: - shl(0xe0, 0x4e487b71) /* \"C\":117:119 41 */ - dup4 - mstore + mstore(0x00, shl(0xe0, 0x4e487b71)) 0x11 /* \"D\":91:166 contract D is C(3)... */ 0x04 /* \"C\":117:119 41 */ mstore - 0x24 - dup4 - revert + revert(0x00, 0x24) /* \"D\":91:166 contract D is C(3)... */ - tag_12: - pop - dup1 - revert tag_6: pop - jumpi(tag_12, callvalue) - dup2 - add(calldatasize, not(0x03)) - slt - tag_12 - jumpi + jumpi(tag_26, callvalue) + jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) 0x20 - swap2 + swap1 + /* \"C\":152:171 int public stateVar */ + 0x00 + /* \"D\":91:166 contract D is C(3)... */ sload swap1 mload @@ -698,22 +677,17 @@ sub_0: assembly { mstore return tag_4: - dup4 - swap1 - jumpi(tag_12, callvalue) - dup2 - add(calldatasize, not(0x03)) - slt - tag_12 - jumpi + jumpi(tag_26, callvalue) + jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) /* \"C\":290:298 immutVar */ immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") /* \"C\":117:119 41 */ - dup1 - 0x29 - add swap1 dup2 + 0x29 + add + swap2 + dup3 slt 0x01 and @@ -721,8 +695,7 @@ sub_0: assembly { jumpi /* \"D\":91:166 contract D is C(3)... */ 0x20 - swap3 - pop + swap2 dup2 mstore return @@ -749,13 +722,9 @@ sub_0: assembly { iszero and or - tag_38 + tag_14 jumpi jump\t// out - tag_38: - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, 0x11) - revert(0x00, 0x24) auxdata: } diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json index 2fe90b70e..b6d2c053b 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json @@ -192,14 +192,14 @@ object \"C_6\" { code { { /// @src 0:60:101 \"contract C {...\" + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json index 3600f633c..f2c176fa0 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json @@ -191,14 +191,14 @@ object \"C_6\" { code { { /// @src 0:60:101 + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json index 7393f8b44..ccdc589f3 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json @@ -180,14 +180,14 @@ object \"C_6\" { object \"C_6_deployed\" { code { { + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(_1, _1) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + return(0, 0) } } revert(0, 0) 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 d564db75a..c3a23fc49 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json @@ -618,28 +618,25 @@ object \"C_54\" { { /// @src 0:79:435 \"contract C...\" let _1 := memoryguard(0xa0) + mstore(64, _1) if callvalue() { revert(0, 0) } let programSize := datasize(\"C_54\") let argSize := sub(codesize(), programSize) let newFreePtr := add(_1, and(add(argSize, 31), not(31))) if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, _1)) { - mstore(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ 0x24) + revert(0, 0x24) } mstore(64, newFreePtr) codecopy(_1, programSize, argSize) - if slt(sub(add(_1, argSize), _1), 32) - { - revert(/** @src -1:-1:-1 */ 0, 0) - } - /// @src 0:79:435 \"contract C...\" + if slt(sub(add(_1, argSize), _1), 32) { revert(0, 0) } let value := mload(_1) /// @src 0:154:156 \"42\" mstore(128, 0x2a) /// @src 0:79:435 \"contract C...\" - sstore(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ value) + sstore(/** @src 0:210:226 \"stateVar = _init\" */ 0x00, /** @src 0:79:435 \"contract C...\" */ value) let _2 := mload(64) let _3 := datasize(\"C_54_deployed\") codecopy(_2, dataoffset(\"C_54_deployed\"), _3) @@ -658,44 +655,45 @@ object \"C_54\" { mstore(_2, _1) if iszero(lt(calldatasize(), 4)) { - let _3 := 0 - switch shr(224, calldataload(_3)) + switch shr(224, calldataload(0)) case 0x26121ff0 { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } /// @src 0:297:305 \"immutVar\" - let _4 := loadimmutable(\"8\") + let _3 := loadimmutable(\"8\") /// @src 0:79:435 \"contract C...\" - let sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 0:79:435 \"contract C...\" */ _4) - if and(1, slt(sum, _4)) + let sum := add(/** @src 0:124:126 \"41\" */ 0x29, /** @src 0:79:435 \"contract C...\" */ _3) + if and(1, slt(sum, _3)) { - mstore(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) - revert(_3, 0x24) + revert(0, 0x24) } mstore(_1, sum) return(_1, 32) } case 0x793816ec { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } - let _5 := sload(_3) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + let _4 := sload(/** @src 0:159:178 \"int public stateVar\" */ 0) + /// @src 0:79:435 \"contract C...\" let memPos := mload(_2) - mstore(memPos, _5) + mstore(memPos, _4) return(memPos, 32) } case 0x9942ec6f { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } - let _6 := sload(_3) - if eq(_6, sub(shl(255, 1), 1)) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + let _5 := sload(/** @src 0:329:339 \"stateVar++\" */ 0x00) + /// @src 0:79:435 \"contract C...\" + if eq(_5, sub(shl(255, 1), 1)) { - mstore(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) - revert(_3, 0x24) + revert(0, 0x24) } - let ret := add(_6, 1) - sstore(_3, ret) + sstore(/** @src 0:329:339 \"stateVar++\" */ 0x00, /** @src 0:79:435 \"contract C...\" */ add(_5, 1)) + let _6 := sload(/** @src 0:399:407 \"stateVar\" */ 0x00) /// @src 0:410:418 \"this.f()\" let _7 := /** @src 0:79:435 \"contract C...\" */ mload(_2) /// @src 0:410:418 \"this.f()\" @@ -706,11 +704,11 @@ object \"C_54\" { { /// @src 0:79:435 \"contract C...\" let pos := mload(_2) - returndatacopy(pos, _3, returndatasize()) + returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } /// @src 0:410:418 \"this.f()\" - let expr := /** @src 0:79:435 \"contract C...\" */ _3 + let expr := /** @src -1:-1:-1 */ 0 /// @src 0:410:418 \"this.f()\" if _8 { @@ -720,19 +718,19 @@ object \"C_54\" { let newFreePtr := add(_7, and(add(_9, 31), not(31))) if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _7)) { - mstore(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_3, 0x24) + revert(0, 0x24) } mstore(_2, newFreePtr) if slt(sub(/** @src 0:410:418 \"this.f()\" */ add(_7, _9), /** @src 0:79:435 \"contract C...\" */ _7), /** @src 0:410:418 \"this.f()\" */ 32) /// @src 0:79:435 \"contract C...\" - { revert(_3, _3) } + { revert(0, 0) } /// @src 0:410:418 \"this.f()\" expr := /** @src 0:79:435 \"contract C...\" */ mload(_7) } /// @src 0:399:418 \"stateVar + this.f()\" - let expr_1 := checked_add_int256(ret, expr) + let expr_1 := checked_add_int256(_6, 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\")) /// @src 0:79:435 \"contract C...\" @@ -741,8 +739,8 @@ object \"C_54\" { return(memPos_1, /** @src 0:410:418 \"this.f()\" */ 32) } case /** @src 0:79:435 \"contract C...\" */ 0xa00b982b { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } + 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) /// @src 0:79:435 \"contract C...\" @@ -1457,41 +1455,44 @@ object \"D_72\" { { /// @src 1:91:166 \"contract D is C(3)...\" let _1 := memoryguard(0xa0) + mstore(64, _1) if callvalue() { revert(0, 0) } let programSize := datasize(\"D_72\") let argSize := sub(codesize(), programSize) let newFreePtr := add(_1, and(add(argSize, 31), not(31))) if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, _1)) { - mstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ 0x24) + revert(0, 0x24) } mstore(64, newFreePtr) codecopy(_1, programSize, argSize) - if slt(sub(add(_1, argSize), _1), 32) - { - revert(/** @src -1:-1:-1 */ 0, 0) - } - /// @src 1:91:166 \"contract D is C(3)...\" + if slt(sub(add(_1, argSize), _1), 32) { revert(0, 0) } let value := mload(_1) /// @src 0:154:156 \"42\" 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)) - { - 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)) + sstore(/** @src 0:210:226 \"stateVar = _init\" */ 0x00, /** @src 1:107:108 \"3\" */ 0x03) /// @src 1:91:166 \"contract D is C(3)...\" - return(_2, _3) + let _2 := sload(/** @src 1:142:160 \"stateVar += _init2\" */ 0x00) + /// @src 1:91:166 \"contract D is C(3)...\" + let sum := add(_2, value) + let _3 := slt(sum, value) + let _4 := slt(_2, 0) + if or(and(iszero(_4), _3), and(_4, iszero(_3))) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x11) + revert(0, 0x24) + } + sstore(/** @src 1:142:160 \"stateVar += _init2\" */ 0x00, /** @src 1:91:166 \"contract D is C(3)...\" */ sum) + let _5 := mload(64) + let _6 := datasize(\"D_72_deployed\") + codecopy(_5, dataoffset(\"D_72_deployed\"), _6) + setimmutable(_5, \"8\", mload(/** @src 0:154:156 \"42\" */ 128)) + /// @src 1:91:166 \"contract D is C(3)...\" + return(_5, _6) } } /// @use-src 0:\"C\", 1:\"D\" @@ -1504,44 +1505,45 @@ object \"D_72\" { mstore(_2, _1) if iszero(lt(calldatasize(), 4)) { - let _3 := 0 - switch shr(224, calldataload(_3)) + switch shr(224, calldataload(0)) case 0x26121ff0 { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } /// @src 0:297:305 \"immutVar\" - let _4 := loadimmutable(\"8\") + let _3 := 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)...\" */ _4) - if and(1, slt(sum, _4)) + 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(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) - revert(_3, 0x24) + revert(0, 0x24) } mstore(_1, sum) return(_1, 32) } case 0x793816ec { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } - let _5 := sload(_3) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + let _4 := sload(/** @src 0:159:178 \"int public stateVar\" */ 0) + /// @src 1:91:166 \"contract D is C(3)...\" let memPos := mload(_2) - mstore(memPos, _5) + mstore(memPos, _4) return(memPos, 32) } case 0x9942ec6f { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } - let _6 := sload(_3) - if eq(_6, sub(shl(255, 1), 1)) + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + let _5 := sload(/** @src 0:329:339 \"stateVar++\" */ 0x00) + /// @src 1:91:166 \"contract D is C(3)...\" + if eq(_5, sub(shl(255, 1), 1)) { - mstore(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) - revert(_3, 0x24) + revert(0, 0x24) } - let ret := add(_6, 1) - sstore(_3, ret) + sstore(/** @src 0:329:339 \"stateVar++\" */ 0x00, /** @src 1:91:166 \"contract D is C(3)...\" */ add(_5, 1)) + let _6 := sload(/** @src 0:399:407 \"stateVar\" */ 0x00) /// @src 0:410:418 \"this.f()\" let _7 := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(_2) /// @src 0:410:418 \"this.f()\" @@ -1552,11 +1554,11 @@ object \"D_72\" { { /// @src 1:91:166 \"contract D is C(3)...\" let pos := mload(_2) - returndatacopy(pos, _3, returndatasize()) + returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } /// @src 0:410:418 \"this.f()\" - let expr := /** @src 1:91:166 \"contract D is C(3)...\" */ _3 + let expr := /** @src -1:-1:-1 */ 0 /// @src 0:410:418 \"this.f()\" if _8 { @@ -1566,19 +1568,19 @@ object \"D_72\" { let newFreePtr := add(_7, and(add(_9, 31), not(31))) if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, _7)) { - mstore(_3, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_3, 0x24) + revert(0, 0x24) } mstore(_2, newFreePtr) if slt(sub(/** @src 0:410:418 \"this.f()\" */ add(_7, _9), /** @src 1:91:166 \"contract D is C(3)...\" */ _7), /** @src 0:410:418 \"this.f()\" */ 32) /// @src 1:91:166 \"contract D is C(3)...\" - { revert(_3, _3) } + { revert(0, 0) } /// @src 0:410:418 \"this.f()\" expr := /** @src 1:91:166 \"contract D is C(3)...\" */ mload(_7) } /// @src 0:399:418 \"stateVar + this.f()\" - let expr_1 := checked_add_int256(ret, expr) + let expr_1 := checked_add_int256(_6, 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\")) /// @src 1:91:166 \"contract D is C(3)...\" @@ -1587,8 +1589,8 @@ object \"D_72\" { return(memPos_1, /** @src 0:410:418 \"this.f()\" */ 32) } case /** @src 1:91:166 \"contract D is C(3)...\" */ 0xa00b982b { - if callvalue() { revert(_3, _3) } - if slt(add(calldatasize(), not(3)), _3) { revert(_3, _3) } + 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) /// @src 1:91:166 \"contract D is C(3)...\" diff --git a/test/cmdlineTests/standard_yul_optimized/output.json b/test/cmdlineTests/standard_yul_optimized/output.json index b260f72ed..2e37c63b3 100644 --- a/test/cmdlineTests/standard_yul_optimized/output.json +++ b/test/cmdlineTests/standard_yul_optimized/output.json @@ -7,7 +7,7 @@ { "evm": { - "assembly": " /* \"A\":17:18 */ + "assembly": " /* \"A\":38:39 */ 0x00 /* \"A\":11:19 */ dup1 diff --git a/test/cmdlineTests/viair_subobject_optimization/output b/test/cmdlineTests/viair_subobject_optimization/output index 4d5aa7f70..8b7defbe8 100644 --- a/test/cmdlineTests/viair_subobject_optimization/output +++ b/test/cmdlineTests/viair_subobject_optimization/output @@ -3,6 +3,9 @@ EVM assembly: /* "viair_subobject_optimization/input.sol":61:668 contract C {... */ 0x80 + dup1 + 0x40 + mstore jumpi(tag_7, callvalue) 0x1f bytecodeSize @@ -60,8 +63,8 @@ EVM assembly: return /* "viair_subobject_optimization/input.sol":616:661 if (x == 0xFFFFFFFFFFFFFFFF42)... */ tag_7: - 0x00 /* "viair_subobject_optimization/input.sol":653:661 revert() */ + 0x00 dup1 revert /* "viair_subobject_optimization/input.sol":61:668 contract C {... */ @@ -73,6 +76,7 @@ stop sub_0: assembly { /* "viair_subobject_optimization/input.sol":61:668 contract C {... */ + mstore(0x40, 0x80) 0x00 dup1 revert @@ -105,108 +109,98 @@ stop sub_0: assembly { /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ 0x80 + 0x40 + dup2 + dup2 + mstore jumpi(tag_1, iszero(lt(calldatasize, 0x04))) 0x00 dup1 revert tag_1: - 0x00 - dup1 - calldataload - 0xe0 - shr - 0x26121ff0 - eq - tag_3 - jumpi + jumpi(tag_3, eq(0x26121ff0, shr(0xe0, calldataload(0x00)))) 0x00 dup1 revert tag_3: jumpi(tag_7, callvalue) - dup1 - add(calldatasize, not(0x03)) - slt - tag_7 - jumpi + jumpi(tag_7, slt(add(not(0x03), calldatasize), 0x00)) /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ dataSize(sub_0) - /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ swap2 not(0x1f) + /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ swap1 - dup2 0x3f - dup6 + dup5 add + dup3 and dup2 add - swap3 - dup2 - dup5 - lt 0xffffffffffffffff - dup6 + dup2 gt + dup3 + dup3 + lt or tag_9 jumpi - swap1 - swap2 - 0x40 - swap4 - dup5 - mstore - /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ - dup5 dup4 mstore + /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ + dup4 + dup2 + mstore + /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ + swap3 + /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ 0x20 - swap5 + swap2 + /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ + swap1 + /* "viair_subobject_optimization/input.sol":745:765 type(C).creationCode */ dataOffset(sub_0) + dup4 dup7 - dup6 add codecopy /* "viair_subobject_optimization/input.sol":669:772 contract D {... */ - dup4 + dup3 mload - swap5 + swap4 + dup3 dup6 - swap3 - dup2 + swap4 dup5 mstore - dup5 + dup2 mload swap2 dup3 - dup2 + dup3 dup7 add mstore - dup2 - swap6 + 0x00 tag_11: dup4 - dup8 + dup2 lt tag_12 jumpi pop pop + 0x00 + dup5 dup4 - swap5 - pop - dup6 - dup3 - 0x1f - swap5 - swap6 add + dup7 add mstore + pop + 0x1f add and dup2 @@ -216,35 +210,30 @@ sub_0: assembly { swap1 return tag_12: - dup7 + dup2 dup2 add - dup3 + dup4 add mload - dup10 dup9 + dup3 add - dup10 + dup9 add mstore - swap6 - dup2 - add - swap6 - dup9 + dup8 swap6 pop + dup3 + add jump(tag_11) tag_9: - shl(0xe0, 0x4e487b71) - dup2 - mstore + mstore(0x00, shl(0xe0, 0x4e487b71)) mstore(0x04, 0x41) - 0x24 - swap1 - revert + revert(0x00, 0x24) tag_7: + 0x00 dup1 revert stop @@ -252,6 +241,9 @@ sub_0: assembly { sub_0: assembly { /* "viair_subobject_optimization/input.sol":61:668 contract C {... */ 0x80 + dup1 + 0x40 + mstore jumpi(tag_7, callvalue) 0x1f bytecodeSize @@ -309,8 +301,8 @@ sub_0: assembly { return /* "viair_subobject_optimization/input.sol":616:661 if (x == 0xFFFFFFFFFFFFFFFF42)... */ tag_7: - 0x00 /* "viair_subobject_optimization/input.sol":653:661 revert() */ + 0x00 dup1 revert /* "viair_subobject_optimization/input.sol":61:668 contract C {... */ @@ -322,6 +314,7 @@ sub_0: assembly { sub_0: assembly { /* "viair_subobject_optimization/input.sol":61:668 contract C {... */ + mstore(0x40, 0x80) 0x00 dup1 revert diff --git a/test/cmdlineTests/viair_subobjects/output b/test/cmdlineTests/viair_subobjects/output index 500472f8a..c6d7f3256 100644 --- a/test/cmdlineTests/viair_subobjects/output +++ b/test/cmdlineTests/viair_subobjects/output @@ -23,6 +23,7 @@ object "C_3" { code { { /// @src 0:82:95 "contract C {}" + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -59,31 +60,30 @@ object "D_16" { mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _2 := 0 - if eq(0x26121ff0, shr(224, calldataload(_2))) + if eq(0x26121ff0, shr(224, calldataload(0))) { - if callvalue() { revert(_2, _2) } - if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } /// @src 0:149:156 "new C()" - let _3 := datasize("C_3") - let _4 := add(_1, _3) - if or(gt(_4, 0xffffffffffffffff), lt(_4, _1)) + let _2 := datasize("C_3") + let _3 := add(_1, _2) + if or(gt(_3, 0xffffffffffffffff), lt(_3, _1)) { /// @src 0:96:165 "contract D {..." - mstore(_2, shl(224, 0x4e487b71)) + mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_2, 0x24) + revert(0, 0x24) } /// @src 0:149:156 "new C()" - datacopy(_1, dataoffset("C_3"), _3) - if iszero(create(/** @src 0:96:165 "contract D {..." */ _2, /** @src 0:149:156 "new C()" */ _1, sub(_4, _1))) + datacopy(_1, dataoffset("C_3"), _2) + if iszero(create(0, _1, sub(_3, _1))) { /// @src 0:96:165 "contract D {..." let pos := mload(64) - returndatacopy(pos, _2, returndatasize()) + returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } - return(_2, _2) + return(0, 0) } } revert(0, 0) @@ -107,6 +107,7 @@ object "D_16" { code { { /// @src 0:82:95 "contract C {}" + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/yul_optimize_runs/output b/test/cmdlineTests/yul_optimize_runs/output index b7fcabaac..a571fd308 100644 --- a/test/cmdlineTests/yul_optimize_runs/output +++ b/test/cmdlineTests/yul_optimize_runs/output @@ -33,7 +33,7 @@ Text representation: 0x00 /* "yul_optimize_runs/input.yul":71:144 */ codecopy - /* "yul_optimize_runs/input.yul":80:81 */ + /* "yul_optimize_runs/input.yul":160:161 */ 0x00 /* "yul_optimize_runs/input.yul":153:192 */ return diff --git a/test/cmdlineTests/yul_optimizer_steps_short_sequence/output b/test/cmdlineTests/yul_optimizer_steps_short_sequence/output index 0a4a2c5a2..97c3e31cb 100644 --- a/test/cmdlineTests/yul_optimizer_steps_short_sequence/output +++ b/test/cmdlineTests/yul_optimizer_steps_short_sequence/output @@ -7,7 +7,7 @@ object "C_8" { mstore(64, memoryguard(0x80)) /// @src 0:129:213 "assembly (\"memory-safe\") {..." let usr$a := 0 - revert(usr$a, usr$a) + revert(0, 0) } } /// @use-src 0:"yul_optimizer_steps_short_sequence/input.sol" diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index 2d4100df4..608d1c8ba 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -17,9 +17,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 640600 -// executionCost: 674 -// totalCost: 641274 +// codeDepositCost: 638600 +// executionCost: 668 +// totalCost: 639268 // external: // a(): 2283 // b(uint256): 4649 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol index c13f004fb..4f840b60d 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: 203166 +// gas irOptimized: 203228 // gas legacy: 206263 -// gas legacyOptimized: 203151 +// 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 e043853e0..8cbb0ae3b 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: 361321 +// gas irOptimized: 360863 // gas legacy: 411269 // gas legacyOptimized: 317754 // test_uint256() -> -// gas irOptimized: 509988 +// gas irOptimized: 509569 // gas legacy: 577469 // gas legacyOptimized: 440931 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol index 575b75907..ec23f5121 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: 166506 +// gas irOptimized: 166723 // gas legacy: 169283 // gas legacyOptimized: 167248 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol index 8d98179d9..613e41a80 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: 361321 +// gas irOptimized: 360863 // gas legacy: 411269 // gas legacyOptimized: 317754 // test_uint256() -> -// gas irOptimized: 509988 +// gas irOptimized: 509569 // gas legacy: 577469 // gas legacyOptimized: 440931 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol index cdf2d3087..58c77665a 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: 112641 +// gas irOptimized: 112740 // gas legacy: 114794 // gas legacyOptimized: 112572 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 add545896..c83498db0 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,6 +30,6 @@ contract C is B { } // ---- // test() -> 77 -// gas irOptimized: 119177 +// gas irOptimized: 110737 // gas legacy: 151866 // gas legacyOptimized: 110359 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol index 915514754..12920a70a 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: 127012 +// gas irOptimized: 126851 // gas legacy: 139800 // 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 796488a9f..3da6271db 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: 111650 +// gas irOptimized: 111732 // 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 c72ac0075..53643d5d9 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: 180823 +// gas irOptimized: 180889 // gas legacy: 184830 // gas legacyOptimized: 181493 // i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224 -// gas irOptimized: 112459 +// gas irOptimized: 112425 // gas legacy: 115398 // gas legacyOptimized: 112982 diff --git a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol index 03084f0a3..10717392a 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: 135693 +// gas irOptimized: 135738 // gas legacy: 137278 -// gas legacyOptimized: 136043 +// 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 116582415..1e75afeff 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: 135073 +// gas irOptimized: 135060 // gas legacy: 241703 // gas legacyOptimized: 151613 // 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 1b6e461a3..88eb65700 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: 3019936 +// gas irOptimized: 3043899 // gas legacy: 3069098 // gas legacyOptimized: 3013250 // test_indices(uint256): 5 -> -// gas irOptimized: 577789 +// gas irOptimized: 590601 // gas legacy: 574754 // gas legacyOptimized: 572383 // test_indices(uint256): 10 -> -// gas irOptimized: 158291 +// gas irOptimized: 159493 // gas legacy: 162468 // gas legacyOptimized: 158336 // test_indices(uint256): 15 -> -// gas irOptimized: 173296 +// gas irOptimized: 174798 // gas legacy: 179513 // gas legacyOptimized: 173606 // test_indices(uint256): 0xFF -> -// gas irOptimized: 5678606 +// gas irOptimized: 5724353 // gas legacy: 5775928 // gas legacyOptimized: 5666726 // test_indices(uint256): 1000 -> -// gas irOptimized: 18197173 +// gas irOptimized: 18351755 // gas legacy: 18583810 // gas legacyOptimized: 18171248 // test_indices(uint256): 129 -> -// gas irOptimized: 4156312 +// gas irOptimized: 4250972 // gas legacy: 4164468 // gas legacyOptimized: 4122100 // test_indices(uint256): 128 -> -// gas irOptimized: 411289 +// gas irOptimized: 419063 // gas legacy: 463706 // gas legacyOptimized: 418061 // test_indices(uint256): 1 -> -// gas irOptimized: 581362 +// gas irOptimized: 594287 // gas legacy: 576904 // gas legacyOptimized: 575649 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 ffe98ee43..06f1e0ee6 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: 140383 +// gas irOptimized: 171594 // gas legacy: 133633 // gas legacyOptimized: 114354 // test_boundary_check(uint256,uint256): 256, 255 -> 0 -// gas irOptimized: 142515 +// gas irOptimized: 173767 // 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 6b3f4643c..f2a971d4a 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: 131925 +// gas irOptimized: 134360 // gas legacy: 132804 // gas legacyOptimized: 130649 // test_zeroed_indicies(uint256): 10 -> -// gas irOptimized: 225874 +// gas irOptimized: 229960 // gas legacy: 227786 // gas legacyOptimized: 223830 // test_zeroed_indicies(uint256): 15 -> -// gas irOptimized: 323938 +// gas irOptimized: 329572 // gas legacy: 326902 // gas legacyOptimized: 321206 // test_zeroed_indicies(uint256): 0xFF -> -// gas irOptimized: 5116738 +// gas irOptimized: 5221116 // gas legacy: 5165874 // gas legacyOptimized: 5062182 diff --git a/test/libsolidity/semanticTests/array/array_storage_length_access.sol b/test/libsolidity/semanticTests/array/array_storage_length_access.sol index 6a611cc17..41edfb4ee 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: 144589 // gas legacy: 128571 // gas legacyOptimized: 110143 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1220647 +// gas irOptimized: 1957916 // 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 b59afd039..37952e440 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: 406413 +// gas irOptimized: 426490 // gas legacy: 415744 // gas legacyOptimized: 397380 // pushEmpty(uint256): 256 -// gas irOptimized: 693185 +// gas irOptimized: 717102 // gas legacy: 715316 // gas legacyOptimized: 688632 // 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 9c3a426fe..e93c58fab 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: 161440 +// gas irOptimized: 193804 // gas legacy: 696850 // gas legacyOptimized: 134488 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1800622 +// gas irOptimized: 2288281 // 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 91948540f..c1f23be2e 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: 821106 +// gas irOptimized: 890706 // gas legacy: 808020 // gas legacyOptimized: 784467 // set_get_length(uint256): 0xFFF -> 0 -// gas irOptimized: 12828798 +// gas irOptimized: 13946718 // 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 05a663c0b..72d5f4453 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: 186537 +// gas irOptimized: 186560 // 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 554f4361a..b9a961fc4 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: 125584 +// gas irOptimized: 125104 // gas legacy: 150372 // gas legacyOptimized: 146391 diff --git a/test/libsolidity/semanticTests/array/bytes_length_member.sol b/test/libsolidity/semanticTests/array/bytes_length_member.sol index 04dcf2d34..a6d97d40b 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: 110400 +// gas irOptimized: 110408 // gas legacy: 110952 -// gas legacyOptimized: 110580 +// 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 fe6f07a40..3de33cc47 100644 --- a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol +++ b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol @@ -8,7 +8,7 @@ contract C { } // ---- // constructor(): 1, 2, 3 -> -// gas irOptimized: 140952 +// gas irOptimized: 139729 // gas legacy: 180517 // gas legacyOptimized: 150462 // a(uint256): 0 -> 1 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 3be5ba29f..b809fbb2d 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: 648323 +// gas irOptimized: 648352 // 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 d88aaebcd..0534bde97 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: 117369 +// gas irOptimized: 122796 // 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 ebc6dadbe..3df03fa76 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: 107488 +// gas irOptimized: 108354 // 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 6f616f4b5..fe6785874 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: 208122 +// gas irOptimized: 209745 // gas legacy: 221769 // gas legacyOptimized: 220611 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 80364f025..9c46272a4 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: 4548245 +// gas irOptimized: 4549147 // gas legacy: 4476222 // gas legacyOptimized: 4448113 // storageEmpty -> 1 // clear() -> 0, 0 -// gas irOptimized: 4475224 +// gas irOptimized: 4477925 // gas legacy: 4408014 // gas legacyOptimized: 4381784 // 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 7b5b30b79..5d166e7b5 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: 689714 +// gas irOptimized: 689898 // 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 d17e45a2f..1eefdb91a 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: 205062 +// gas irOptimized: 205329 // 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 4ab3d0bd8..e869bc3f6 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: 169602 +// gas irOptimized: 169620 // 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 29c845f13..a57e8270e 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: 111366 +// gas irOptimized: 111370 // 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 fcdcf9c2d..a1b03d239 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: 252986 +// gas irOptimized: 253389 // 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 943a5206e..a4b8d1702 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: 123142 +// gas irOptimized: 123230 // 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 3b0a229c9..0d613e5e9 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: 196278 +// gas irOptimized: 196259 // 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 4339c89b5..7ed43248b 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: 190870 +// gas irOptimized: 192450 // 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 c9c6e3228..205552d87 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: 161715 +// gas irOptimized: 161939 // gas legacy: 162203 -// gas legacyOptimized: 159941 +// 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 31addad5e..b2af9191d 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: 104665 +// gas irOptimized: 104526 // gas legacy: 166874 // gas legacyOptimized: 145474 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 0a306cade..b22905989 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: 273576 +// gas irOptimized: 273564 // gas legacy: 283666 // gas legacyOptimized: 282023 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 de100d096..ad4c5818b 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: 233285 +// gas irOptimized: 233271 // gas legacy: 236523 // gas legacyOptimized: 235592 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 53ca44cdc..6581f5ae8 100644 --- a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol @@ -52,9 +52,9 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 150061 +// gas irOptimized: 150006 // gas legacy: 150745 -// gas legacyOptimized: 148685 +// gas legacyOptimized: 148678 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // 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 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 8cc849ecd..cc4d9bd71 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: 180759 +// gas irOptimized: 181047 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 157562 +// gas irOptimized: 157637 // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 -// gas irOptimized: 134637 +// gas irOptimized: 134723 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 -// gas irOptimized: 111270 +// gas irOptimized: 111252 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 08e427eea..9fd64e2f2 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: 226687 +// gas irOptimized: 226652 // gas legacy: 227084 // gas legacyOptimized: 226529 // test1() -> 3 // test2() -> 6 // test3() -> 24 -// gas irOptimized: 141244 +// gas irOptimized: 141338 // 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 9a2ab14cb..e072cc7f6 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: 104606 +// gas irOptimized: 104770 // gas legacy: 108554 // gas legacyOptimized: 102413 // 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 dc30e44b6..1d33fc3f2 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: 104279 +// gas irOptimized: 104427 // 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 ec193d693..827e72661 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: 119736 +// gas irOptimized: 119937 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 3024f44ad..8bf7b3c0f 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: 118393 +// gas irOptimized: 118565 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 b60a7c3c2..c68777a42 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: 327759 +// gas irOptimized: 328430 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 e175dd87c..1841830f4 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: 181950 +// gas irOptimized: 181908 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 e335d8684..0d5773af5 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: 131932 +// gas irOptimized: 131921 // 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 9fcbbffce..b50bf2c4e 100644 --- a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol @@ -37,8 +37,8 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 147892 +// gas irOptimized: 147915 // gas legacy: 148896 -// gas legacyOptimized: 146908 +// gas legacyOptimized: 146901 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 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 523a0ebeb..19e5ddebd 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol @@ -5,13 +5,13 @@ contract c { } // ---- // set(uint256): 1, 2 -> true -// gas irOptimized: 110574 +// gas irOptimized: 110558 // gas legacy: 111312 -// gas legacyOptimized: 110744 +// gas legacyOptimized: 110741 // set(uint256): 2, 2, 3, 4, 5 -> true -// gas irOptimized: 177525 +// gas irOptimized: 177509 // gas legacy: 178314 -// gas legacyOptimized: 177719 +// gas legacyOptimized: 177716 // storageEmpty -> 0 // copy(uint256,uint256): 1, 2 -> true // 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 9448970b7..4ed590ed9 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: 109255 +// gas irOptimized: 109275 // gas legacy: 123948 // gas legacyOptimized: 118948 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 123936 +// gas irOptimized: 124380 // gas legacy: 140362 -// gas legacyOptimized: 135386 +// gas legacyOptimized: 135384 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 130543 +// gas irOptimized: 130982 // gas legacy: 147916 -// gas legacyOptimized: 142290 +// gas legacyOptimized: 142276 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 139333 +// gas irOptimized: 140042 // gas legacy: 171136 -// gas legacyOptimized: 161550 +// gas legacyOptimized: 161536 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 // gas legacy: 59345 // gas legacyOptimized: 57279 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 441985 +// gas irOptimized: 443206 // gas legacy: 505021 -// gas legacyOptimized: 486997 +// gas legacyOptimized: 486995 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 3f629686f..59cee320b 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: 110970 +// gas irOptimized: 111049 // 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 26f3d587f..e6bf7671a 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: 139905 +// gas irOptimized: 139683 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 9a111e2bc..ef6dac669 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,7 +16,7 @@ contract C { } // ---- // constructor() -// gas irOptimized: 234419 +// gas irOptimized: 210785 // gas legacy: 215757 // gas legacyOptimized: 181760 // f() -> 0 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 edb657ad9..c6924b8f9 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: 179752 +// gas irOptimized: 179696 // gas legacy: 181001 -// gas legacyOptimized: 180014 +// gas legacyOptimized: 180018 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas irOptimized: 106682 +// gas irOptimized: 106631 // gas legacy: 109720 -// gas legacyOptimized: 106937 +// gas legacyOptimized: 106932 // 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 61d5ccf86..10fd90bce 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: 143426 +// gas irOptimized: 144270 // gas legacy: 153395 -// gas legacyOptimized: 146722 +// 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 18795ff79..770719357 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: 122477 +// gas irOptimized: 122662 // 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 58fc1c13d..68fe5b29e 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol @@ -7,9 +7,9 @@ contract c { } // ---- // set(): 1, 2, 3, 4, 5 -> true -// gas irOptimized: 177383 +// gas irOptimized: 177368 // gas legacy: 177954 -// gas legacyOptimized: 177554 +// gas legacyOptimized: 177550 // storageEmpty -> 0 // reset() -> true // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol index 8277df30a..122f1a2db 100644 --- a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol +++ b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol @@ -18,9 +18,9 @@ contract sender { } // ---- // (): 7 -> -// gas irOptimized: 110820 +// gas irOptimized: 110901 // gas legacy: 111388 -// gas legacyOptimized: 111071 +// gas legacyOptimized: 111065 // val() -> 0 // forward(bool): true -> true // val() -> 0x80 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 eb0eb108f..8a5c2f982 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: 327821 +// gas irOptimized: 327934 // 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: 140867 +// gas irOptimized: 140870 // 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: 188473 +// gas irOptimized: 188553 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 9dbc64f73..3c4d9929c 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: 332527 +// gas irOptimized: 332777 // 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: 145155 +// gas irOptimized: 145161 // 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: 192476 +// gas irOptimized: 192680 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 68db47519..2eebbdf9c 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: 116638 +// gas irOptimized: 116438 // gas legacy: 118936 // gas legacyOptimized: 116975 // test2() -> 0x20, 0x14, "[b called][a called]" // test3() -> 0x20, 0x14, "[b called][a called]" -// gas irOptimized: 103241 +// gas irOptimized: 103292 // 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 074ca934f..9c4250d5d 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: 128116 +// gas irOptimized: 129339 // gas legacy: 130584 -// gas legacyOptimized: 129031 +// gas legacyOptimized: 129028 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 c962d815f..5c6da1c3e 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: 150508 +// gas irOptimized: 150502 // gas legacy: 150949 // gas legacyOptimized: 150906 // test2() -> FAILURE -// gas irOptimized: 150385 +// gas irOptimized: 150429 // gas legacy: 150673 // gas legacyOptimized: 150576 // test3() -> -// gas irOptimized: 123776 +// gas irOptimized: 124005 // 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 fe60365e4..52c69429b 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: 304714 +// gas irOptimized: 304746 // 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: 116454 +// gas irOptimized: 116447 // 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: 187962 +// gas irOptimized: 188042 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 ccf2f2a20..d4c239995 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: 309068 +// gas irOptimized: 309070 // 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: 118167 +// gas irOptimized: 118262 // 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: 190961 +// gas irOptimized: 191041 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 fb06b3188..355108e10 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: 123237 +// gas irOptimized: 123207 // test2() -// gas irOptimized: 123043 +// gas irOptimized: 123042 // 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 6e44ed268..57efac2aa 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: 138054 +// gas irOptimized: 138063 // test2(uint8[][]): 0x20, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 164232 +// gas irOptimized: 164291 // 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 f7a863b46..bd8f2f38f 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: 205974 +// gas irOptimized: 206351 // gas legacy: 212237 // gas legacyOptimized: 211425 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 2a7863015..44ec1ae72 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: 202805 +// gas irOptimized: 202852 // gas legacy: 204798 -// gas legacyOptimized: 203368 +// 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 0f3f7783d..a58102a8a 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: 205974 +// gas irOptimized: 206351 // gas legacy: 212242 // gas legacyOptimized: 211430 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 b40bfaced..2d3a8a6aa 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: 291155 +// gas irOptimized: 291253 // 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 341a4c9d9..187200fe4 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: 109804 +// gas irOptimized: 115182 // gas legacy: 126129 // gas legacyOptimized: 120622 diff --git a/test/libsolidity/semanticTests/array/create_memory_array.sol b/test/libsolidity/semanticTests/array/create_memory_array.sol index 0d099815b..297b4bea7 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: 125827 +// gas irOptimized: 125828 // 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 a653db837..a4498bde8 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: 206322 +// gas irOptimized: 219669 // gas legacy: 254056 -// gas legacyOptimized: 246887 +// gas legacyOptimized: 246892 diff --git a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol index 13d510f80..ad35dcb6e 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: 519276 +// gas irOptimized: 520064 // gas legacy: 521414 // gas legacyOptimized: 516983 // 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 bce78baa4..dafef1b61 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: 111301 +// gas irOptimized: 117738 // 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 4c5f64695..791a29b12 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: 122916 +// gas irOptimized: 123321 // 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 337946a20..2014ac060 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: 465324 +// gas irOptimized: 465332 // gas legacy: 471178 // gas legacyOptimized: 467478 // 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 9d8dc0bc7..49c1cabf6 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -18,6 +18,6 @@ contract B { } // ---- // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 -// gas irOptimized: 115828 +// gas irOptimized: 115022 // gas legacy: 230001 // gas legacyOptimized: 130637 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index 71fec7bda..2bb348b78 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -9,7 +9,7 @@ contract Creator { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 127659 +// gas irOptimized: 126372 // gas legacy: 174186 // gas legacyOptimized: 128709 // r() -> 4 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index 7e29d82a8..ec4dc583c 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -42,6 +42,6 @@ contract C { } // ---- // test() -> 5, 6, 7 -// gas irOptimized: 260895 +// gas irOptimized: 256085 // gas legacy: 441556 // gas legacyOptimized: 279321 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 815c1768c..cc69383dd 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,9 +40,9 @@ contract C { // copyFromStorageShort() // x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000 // copyFromStorageLong() -// gas irOptimized: 121123 +// gas irOptimized: 121087 // gas legacy: 121904 -// gas legacyOptimized: 121400 +// gas legacyOptimized: 121398 // x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000 // copyToStorage() // 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 7f80f1bd0..b7def44a5 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: 1828169 +// gas irOptimized: 1831195 // 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 6a657032b..c6d2df307 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: 148168 +// gas irOptimized: 148324 // 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 1a74ea972..f41b9fabd 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: 125933 +// gas irOptimized: 126221 // 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 95a2b012c..5ed3932b3 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: 140325 +// gas irOptimized: 140516 // 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 f6eb8e127..1b2bffaf9 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: 113826 +// gas irOptimized: 113532 // 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 623b58739..a6ef45a53 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: 108053 +// gas irOptimized: 108096 // gas legacy: 125420 // gas legacyOptimized: 122472 diff --git a/test/libsolidity/semanticTests/array/push/array_push.sol b/test/libsolidity/semanticTests/array/push/array_push.sol index 0dbd7c11b..f854f7bf7 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: 111401 +// gas irOptimized: 111825 // 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 87616f1f5..90bdba06c 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: 112825 +// gas irOptimized: 112861 // 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 f7918bbb4..3833b3bc8 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: 135199 +// gas irOptimized: 135218 // 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 91a6a0b37..1d80e25ed 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: 137087 +// gas irOptimized: 137167 // gas legacy: 142423 // gas legacyOptimized: 137993 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 08cfe58a3..33988a628 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: 173252 +// gas irOptimized: 178108 // gas legacy: 215891 // gas legacyOptimized: 203615 diff --git a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol index b2fbbc977..31bfabf8a 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: 179165 +// gas irOptimized: 179640 // gas legacy: 181014 -// gas legacyOptimized: 180413 +// 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 4b5a2b89d..5ef4bbf9f 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: 112290 +// gas irOptimized: 112304 // 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: 118710 +// gas irOptimized: 118724 // 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 8ba57af02..5b25fa638 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: 182362 +// gas irOptimized: 183637 // gas legacy: 183445 // gas legacyOptimized: 178995 // l() -> 70 diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index b690fad1d..0c751ebc6 100644 --- a/test/libsolidity/semanticTests/array/reusing_memory.sol +++ b/test/libsolidity/semanticTests/array/reusing_memory.sol @@ -24,6 +24,6 @@ contract Main { } // ---- // f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1 -// gas irOptimized: 112161 +// gas irOptimized: 112093 // gas legacy: 125162 // gas legacyOptimized: 113012 diff --git a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol index d76260c9a..6c5ad28df 100644 --- a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol +++ b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol @@ -28,7 +28,7 @@ contract C { // compileViaYul: also // ---- // constructor() -> -// gas irOptimized: 442746 +// gas irOptimized: 429569 // gas legacy: 711299 // gas legacyOptimized: 481080 // h() -> 0x20, 0x40, 0x00, 0 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 3dd93c12e..b5d4bcd03 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,9 +9,9 @@ contract c { // EVMVersion: >=byzantium // ---- // (): 1, 2, 3, 4, 5 -> -// gas irOptimized: 155155 +// gas irOptimized: 155133 // gas legacy: 155473 -// gas legacyOptimized: 155299 +// gas legacyOptimized: 155295 // checkIfDataIsEmpty() -> false // sendMessage() -> true, 0x40, 0 // checkIfDataIsEmpty() -> true diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index 24c33facb..7600a7b58 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -24,6 +24,6 @@ contract Creator { } // ---- // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 -// gas irOptimized: 429160 +// gas irOptimized: 424529 // gas legacy: 581443 // gas legacyOptimized: 444588 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index 3df201222..f15519990 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -24,6 +24,6 @@ contract Creator { } // ---- // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" -// gas irOptimized: 278528 +// gas irOptimized: 268926 // gas legacy: 418462 -// gas legacyOptimized: 291755 +// gas legacyOptimized: 291760 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol index 99260d2ef..4f93a6631 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: 269441 +// gas irOptimized: 261875 // gas legacy: 311324 -// gas legacyOptimized: 258351 +// gas legacyOptimized: 258388 // m_x() -> 7 // m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index 4f8ebefea..8c4a81c78 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -17,7 +17,7 @@ contract Main { } // ---- // constructor(): "abc", true -// gas irOptimized: 105906 +// gas irOptimized: 104804 // gas legacy: 143300 // gas legacyOptimized: 102961 // getFlag() -> true diff --git a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol index dd91c86a2..6451646d7 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol @@ -9,7 +9,7 @@ contract C { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 172314 +// gas irOptimized: 171091 // gas legacy: 218378 // gas legacyOptimized: 176195 // a() -> 1 diff --git a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol index 9319d592a..525dabcd8 100644 --- a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol +++ b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f(), 2000 ether -> true -// gas irOptimized: 119457 +// gas irOptimized: 122441 // gas legacy: 122621 // gas legacyOptimized: 122490 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol index 00dfef4ab..f9f48f072 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol @@ -14,5 +14,5 @@ contract B is A { // compileViaYul: true // ---- // constructor() -> -// gas irOptimized: 120936 +// gas irOptimized: 119739 // 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 9b982d6e9..249621d11 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol @@ -9,7 +9,7 @@ contract B is A { } // ---- // constructor() -> -// gas irOptimized: 120936 +// gas irOptimized: 119739 // gas legacy: 133594 // gas legacyOptimized: 115341 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_with_params.sol b/test/libsolidity/semanticTests/constructor_with_params.sol index 13bdb625b..213c6e82f 100644 --- a/test/libsolidity/semanticTests/constructor_with_params.sol +++ b/test/libsolidity/semanticTests/constructor_with_params.sol @@ -9,7 +9,7 @@ contract C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 102902 +// gas irOptimized: 101463 // gas legacy: 115678 // i() -> 2 // k() -> 0 diff --git a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol index fc2dd8f71..b4e4d39aa 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol @@ -21,7 +21,7 @@ contract D is B, C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 153694 +// gas irOptimized: 152039 // gas legacy: 168623 // gas legacyOptimized: 144577 // i() -> 2 diff --git a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol index a0b4c772d..caa532a37 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol @@ -12,7 +12,7 @@ contract D is C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 123317 +// gas irOptimized: 121878 // gas legacy: 137193 // gas legacyOptimized: 118548 // i() -> 2 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol index 057496c6d..35aa86c98 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: 113510 +// gas irOptimized: 114613 // 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 5c5138742..93d17e868 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: 113510 +// gas irOptimized: 114613 // 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 7b9a9400b..f6b4e91ad 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: 185095 +// gas irOptimized: 185351 // gas legacy: 187495 -// gas legacyOptimized: 184534 +// 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 5b8827ce7..1688b28a4 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: 165398 +// gas irOptimized: 164078 // gas legacy: 244800 // gas legacyOptimized: 171615 // deposit(bytes32), 18 wei: 0x1234 -> diff --git a/test/libsolidity/semanticTests/events/event_indexed_string.sol b/test/libsolidity/semanticTests/events/event_indexed_string.sol index a6283f274..c222d3c0d 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: 332157 +// gas irOptimized: 336545 // gas legacy: 387608 -// gas legacyOptimized: 373772 +// gas legacyOptimized: 373771 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index f2ee4894f..f9f53275b 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -74,7 +74,7 @@ contract FixedFeeRegistrar is Registrar { } // ---- // constructor() -// gas irOptimized: 413501 +// gas irOptimized: 384610 // gas legacy: 913421 // gas legacyOptimized: 476928 // reserve(string), 69 ether: 0x20, 3, "abc" -> diff --git a/test/libsolidity/semanticTests/externalContracts/base64.sol b/test/libsolidity/semanticTests/externalContracts/base64.sol index 328b55ec9..ea7fda7d4 100644 --- a/test/libsolidity/semanticTests/externalContracts/base64.sol +++ b/test/libsolidity/semanticTests/externalContracts/base64.sol @@ -33,7 +33,7 @@ contract test { // EVMVersion: >=constantinople // ---- // constructor() -// gas irOptimized: 409367 +// gas irOptimized: 406475 // gas legacy: 737652 // gas legacyOptimized: 526820 // encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0 @@ -51,10 +51,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: 1373038 +// gas irOptimized: 1373025 // gas legacy: 1672031 // gas legacyOptimized: 1199031 // encode_no_asm_large() -// gas irOptimized: 3276098 +// gas irOptimized: 3255081 // gas legacy: 4705075 // gas legacyOptimized: 2890075 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 38bb47759..6ae161345 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -176,7 +176,7 @@ contract DepositContract is IDepositContract, ERC165 { } // ---- // constructor() -// gas irOptimized: 1415659 +// gas irOptimized: 1391860 // gas legacy: 2391952 // gas legacyOptimized: 1752320 // supportsInterface(bytes4): 0x0 -> 0 @@ -184,27 +184,27 @@ contract DepositContract is IDepositContract, ERC165 { // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # // supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 117264 +// gas irOptimized: 116863 // gas legacy: 151981 // gas legacyOptimized: 124447 // 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: 117264 +// gas irOptimized: 116863 // gas legacy: 151981 // gas legacyOptimized: 124447 // 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: 117249 +// gas irOptimized: 116848 // gas legacy: 151990 // gas legacyOptimized: 124459 // 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: 117249 +// gas irOptimized: 116848 // gas legacy: 151990 // gas legacyOptimized: 124459 // 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 7860560f6..8d0a99382 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -48,7 +48,7 @@ contract test { } // ---- // constructor() -// gas irOptimized: 1870040 +// gas irOptimized: 1847920 // gas legacy: 2430726 // gas legacyOptimized: 1854979 // div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol index 6cda4f1e9..5e0707ee7 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol @@ -48,7 +48,7 @@ contract test { } // ---- // constructor() -// gas irOptimized: 1731900 +// gas irOptimized: 1722178 // gas legacy: 2210160 // gas legacyOptimized: 1734152 // div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index b3ba44964..19a79f537 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -33,7 +33,7 @@ contract test { } // ---- // constructor() -// gas irOptimized: 424583 +// gas irOptimized: 406643 // gas legacy: 631753 // gas legacyOptimized: 459425 // prb_pi() -> 3141592656369545286 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index 254befe01..e92f95b4a 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: 269918 +// gas irOptimized: 269901 // gas legacy: 275678 // gas legacyOptimized: 267193 // verifyTx() -> true // ~ emit Verified(string): 0x20, 0x16, "Successfully verified." -// gas irOptimized: 783371 +// gas irOptimized: 783281 // gas legacy: 804346 // gas legacyOptimized: 772349 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index c2ad61557..d22f38deb 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -49,7 +49,7 @@ contract test { } // ---- // constructor() -// gas irOptimized: 636074 +// gas irOptimized: 632804 // gas legacy: 1065857 // gas legacyOptimized: 725207 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 @@ -69,6 +69,6 @@ contract test { // gas legacy: 31621 // gas legacyOptimized: 27914 // benchmark(string,bytes32): 0x40, 0x0842021, 8, "solidity" -> 0x2020 -// gas irOptimized: 1981693 +// gas irOptimized: 1981664 // gas legacy: 4235651 // gas legacyOptimized: 2319622 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 0fd2efeb9..e6657e090 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -15,7 +15,7 @@ contract D { } // ---- // constructor(): 2 -> -// gas irOptimized: 193999 +// gas irOptimized: 192633 // gas legacy: 241234 // gas legacyOptimized: 192961 // f() -> 2 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 5952a88e0..df5c9a834 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -17,7 +17,7 @@ contract D { // EVMVersion: >=constantinople // ---- // constructor(): 2 -> -// gas irOptimized: 194162 +// gas irOptimized: 192796 // gas legacy: 241606 // gas legacyOptimized: 193193 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol index 86d3dcc8f..e7a2ef4ec 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol @@ -22,7 +22,7 @@ contract C { } // ---- // constructor(), 1 ether -> -// gas irOptimized: 265110 +// gas irOptimized: 249641 // gas legacy: 441442 // gas legacyOptimized: 292862 // f(uint256): 0 -> FAILURE 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 96f097ce7..5f2467584 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol @@ -25,7 +25,7 @@ contract C { // revertStrings: debug // ---- // constructor(), 1 ether -> -// gas irOptimized: 390464 +// gas irOptimized: 377924 // gas legacy: 809985 // gas legacyOptimized: 498331 // f(uint256): 0 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index ffe7a7f37..e851f6f66 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -17,7 +17,7 @@ contract C { // EVMVersion: >=byzantium // ---- // constructor(), 20 wei -// gas irOptimized: 177446 +// gas irOptimized: 167012 // gas legacy: 285547 // gas legacyOptimized: 168515 // f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a @@ -25,7 +25,7 @@ contract C { // f(uint256): 20 -> FAILURE // x() -> 1 // stack(uint256): 1023 -> FAILURE -// gas irOptimized: 259624 +// gas irOptimized: 252410 // 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 9c73e208e..e6c0ad6a2 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -38,7 +38,7 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 260052 +// gas irOptimized: 252426 // gas legacy: 391588 // gas legacyOptimized: 268089 // sendAmount(uint256): 5 -> 5 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 801b22d17..c3a00c34d 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol @@ -37,7 +37,7 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 260052 +// gas irOptimized: 252426 // gas legacy: 391588 // gas legacyOptimized: 268089 // sendAmount(uint256): 5 -> 5 diff --git a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol index bb2221f2c..79f52c5b0 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: 111668 +// gas irOptimized: 111656 // 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 8aaf961aa..4ad6cd354 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: 124849 +// gas irOptimized: 124000 // gas legacy: 148528 // gas legacyOptimized: 123971 // x() -> 7 diff --git a/test/libsolidity/semanticTests/immutable/use_scratch.sol b/test/libsolidity/semanticTests/immutable/use_scratch.sol index ff10c13aa..f84574615 100644 --- a/test/libsolidity/semanticTests/immutable/use_scratch.sol +++ b/test/libsolidity/semanticTests/immutable/use_scratch.sol @@ -15,7 +15,7 @@ contract C { } // ---- // constructor(): 3 -> -// gas irOptimized: 124838 +// gas irOptimized: 123554 // gas legacy: 197645 // gas legacyOptimized: 137678 // f() -> 84, 23 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index 5390f64db..31c7ce487 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -39,7 +39,7 @@ contract Main { } // ---- // constructor(), 22 wei -> -// gas irOptimized: 266886 +// gas irOptimized: 261890 // gas legacy: 392786 // gas legacyOptimized: 261633 // getFlag() -> true diff --git a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol index 39f3c2d0f..ff4f3d1fc 100644 --- a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol +++ b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol @@ -16,7 +16,7 @@ contract ClientReceipt { } // ---- // constructor(), 2000 wei -> -// gas irOptimized: 171865 +// gas irOptimized: 169699 // gas legacy: 230038 // gas legacyOptimized: 173883 // balance -> 1500 diff --git a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol index 169f2e295..35687e736 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: 112209 +// gas irOptimized: 112133 // gas legacy: 135413 // gas legacyOptimized: 119325 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol index b180d52e4..c172dbc09 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: 119654 +// gas irOptimized: 119599 // 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 d46ed0a56..f849f238d 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: 120265 +// gas irOptimized: 120223 // gas legacy: 125109 // gas legacyOptimized: 120128 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create.sol b/test/libsolidity/semanticTests/salted_create/salted_create.sol index 11b74168d..aa7be5fd4 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create.sol @@ -21,6 +21,6 @@ contract A { // ---- // different_salt() -> true // same_salt() -> true -// gas irOptimized: 98438897 +// gas irOptimized: 98438910 // gas legacy: 98439109 // gas legacyOptimized: 98438967 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 025c8259d..90b14ef11 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol @@ -21,6 +21,6 @@ contract A { // EVMVersion: >=constantinople // ---- // f(), 10 ether -> 3007, 3008, 3009 -// gas irOptimized: 254238 +// gas irOptimized: 253041 // gas legacy: 381063 // gas legacyOptimized: 279694 diff --git a/test/libsolidity/semanticTests/smoke/constructor.sol b/test/libsolidity/semanticTests/smoke/constructor.sol index eb1d73a44..7e69a3bcf 100644 --- a/test/libsolidity/semanticTests/smoke/constructor.sol +++ b/test/libsolidity/semanticTests/smoke/constructor.sol @@ -12,7 +12,7 @@ contract C { } // ---- // constructor(), 2 wei: 3 -> -// gas irOptimized: 106374 +// gas irOptimized: 104504 // gas legacy: 148308 // gas legacyOptimized: 106727 // state() -> 3 diff --git a/test/libsolidity/semanticTests/state/blockhash_basic.sol b/test/libsolidity/semanticTests/state/blockhash_basic.sol index 62138a9b2..01069aa0c 100644 --- a/test/libsolidity/semanticTests/state/blockhash_basic.sol +++ b/test/libsolidity/semanticTests/state/blockhash_basic.sol @@ -12,7 +12,7 @@ contract C { } // ---- // constructor() -// gas irOptimized: 109878 +// gas irOptimized: 108150 // gas legacy: 152179 // gas legacyOptimized: 106750 // genesisHash() -> 0x3737373737373737373737373737373737373737373737373737373737373737 diff --git a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol index 20755a069..7898a915f 100644 --- a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol +++ b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol @@ -22,9 +22,9 @@ contract Test { // set(bytes): 0x20, 0 // storageEmpty -> 1 // set(bytes): 0x20, 66, "12345678901234567890123456789012", "12345678901234567890123456789012", "12" -// gas irOptimized: 111895 +// gas irOptimized: 111925 // gas legacy: 112734 -// gas legacyOptimized: 112110 +// gas legacyOptimized: 112115 // storageEmpty -> 0 // set(bytes): 0x20, 3, "abc" // 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 b1686d907..7b178018c 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: 132505 +// gas irOptimized: 132589 // 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 0bcc74b6b..6e335a86a 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: 202829 +// gas irOptimized: 202847 // gas legacy: 207384 // gas legacyOptimized: 203584 diff --git a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol index 52ad00649..699836179 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: 193687 +// gas irOptimized: 193677 // 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 df118de32..337c9f693 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: 121497 +// gas irOptimized: 121510 // gas legacy: 123069 -// gas legacyOptimized: 121758 +// gas legacyOptimized: 121759 // 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 aed54f98b..e7abe311d 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: 152954 +// gas irOptimized: 153025 // 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 66954a7f5..46334ae91 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: 121607 // gas legacy: 123208 -// gas legacyOptimized: 121765 +// gas legacyOptimized: 121766 // 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 065187cdc..52a0497a7 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: 123029 +// gas irOptimized: 123113 // gas legacy: 130227 -// gas legacyOptimized: 128762 +// gas legacyOptimized: 128761 // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121721 +// gas irOptimized: 121780 // gas legacy: 123282 -// gas legacyOptimized: 121870 +// gas legacyOptimized: 121871 // 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: 115116 +// gas irOptimized: 115157 // gas legacy: 122516 -// gas legacyOptimized: 120806 +// gas legacyOptimized: 120807 diff --git a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol index 5b99efc64..4c05ebc9f 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: 121693 +// gas irOptimized: 121708 // gas legacy: 123144 // gas legacyOptimized: 121811 // from_storage() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121737 +// gas irOptimized: 121753 // gas legacy: 123193 // gas legacyOptimized: 121863 // from_memory() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 122942 +// gas irOptimized: 122975 // gas legacy: 130088 // gas legacyOptimized: 128757 // 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: 115056 +// gas irOptimized: 115031 // gas legacy: 118301 // gas legacyOptimized: 115435 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol index 3089f97b5..4943e969b 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: 110326 +// gas irOptimized: 110428 // 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 4a64f0813..5e87f6905 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,17 +23,17 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133596 +// gas irOptimized: 133632 // gas legacy: 134628 -// gas legacyOptimized: 133875 +// gas legacyOptimized: 133871 // test(uint256): 32 -> "3" // storageEmpty -> 0 // copy() -> true // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133596 +// gas irOptimized: 133632 // gas legacy: 134628 -// gas legacyOptimized: 133875 +// gas legacyOptimized: 133871 // storageEmpty -> 0 // del() -> true // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/structs/struct_copy.sol b/test/libsolidity/semanticTests/structs/struct_copy.sol index 6da42ebec..fc2ca2070 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: 109896 +// gas irOptimized: 110073 // gas legacy: 110597 // gas legacyOptimized: 110003 // retrieve(uint256): 7 -> 1, 3, 4, 2 // copy(uint256,uint256): 7, 8 -> true -// gas irOptimized: 118593 +// gas irOptimized: 118590 // 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 22d9dd29d..de3623c8b 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: 109713 +// gas irOptimized: 109715 // 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 7ec85c929..1a325ee35 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: 113232 +// gas irOptimized: 113092 // gas legacy: 113591 // gas legacyOptimized: 113103 // g() -> -// gas irOptimized: 118604 +// gas irOptimized: 118467 // gas legacy: 118764 // gas legacyOptimized: 118172 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index 61456cd7e..878b51f3f 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: 134435 +// gas irOptimized: 134439 // gas legacy: 135246 // gas legacyOptimized: 134062 // check() -> true diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol index 1e58c9b03..b5bcd0f84 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: 122489 +// gas irOptimized: 122354 // gas legacy: 126030 // gas legacyOptimized: 123120 // test_g() -> true -// gas irOptimized: 106871 +// gas irOptimized: 106622 // gas legacy: 112300 // gas legacyOptimized: 107649 // addresses(uint256): 0 -> 0x18 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 31e754a9b..1e155a6d5 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -113,7 +113,7 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 360201 +// gas irOptimized: 353562 // gas legacy: 834932 // gas legacyOptimized: 412648 // totalSupply() -> 20 diff --git a/test/libsolidity/semanticTests/various/address_code.sol b/test/libsolidity/semanticTests/various/address_code.sol index 2712503a4..cf2d203e0 100644 --- a/test/libsolidity/semanticTests/various/address_code.sol +++ b/test/libsolidity/semanticTests/various/address_code.sol @@ -14,9 +14,9 @@ contract C { } // ---- // constructor() -> -// gas irOptimized: 175145 +// gas irOptimized: 166662 // gas legacy: 241796 -// gas legacyOptimized: 153411 +// gas legacyOptimized: 153454 // initCode() -> 0x20, 0 // f() -> true // g() -> 0 diff --git a/test/libsolidity/semanticTests/various/create_calldata.sol b/test/libsolidity/semanticTests/various/create_calldata.sol index fc4e885ff..3167b2b2d 100644 --- a/test/libsolidity/semanticTests/various/create_calldata.sol +++ b/test/libsolidity/semanticTests/various/create_calldata.sol @@ -8,7 +8,7 @@ contract C { } // ---- // constructor(): 42 -> -// gas irOptimized: 146699 +// gas irOptimized: 139585 // gas legacy: 173845 -// gas legacyOptimized: 137736 +// gas legacyOptimized: 137661 // s() -> 0x20, 0 diff --git a/test/libsolidity/semanticTests/various/destructuring_assignment.sol b/test/libsolidity/semanticTests/various/destructuring_assignment.sol index 1534891dc..e288ce5e9 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: 241853 +// gas irOptimized: 242337 // gas legacy: 243284 -// gas legacyOptimized: 242421 +// gas legacyOptimized: 242420 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index 47f4005e3..f734f841a 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -96,7 +96,7 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 355485 +// gas irOptimized: 353924 // gas legacy: 807683 // gas legacyOptimized: 408718 // totalSupply() -> 20 diff --git a/test/libsolidity/semanticTests/various/negative_stack_height.sol b/test/libsolidity/semanticTests/various/negative_stack_height.sol index 92b6b5650..3c9130e9f 100644 --- a/test/libsolidity/semanticTests/various/negative_stack_height.sol +++ b/test/libsolidity/semanticTests/various/negative_stack_height.sol @@ -66,4 +66,4 @@ contract C { // ---- // constructor() -> // gas legacy: 575272 -// gas legacyOptimized: 346970 +// gas legacyOptimized: 345026 diff --git a/test/libsolidity/semanticTests/various/selfdestruct.sol b/test/libsolidity/semanticTests/various/selfdestruct.sol index 366bac41d..958d71995 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct.sol @@ -30,7 +30,7 @@ contract D { } // ---- // constructor(), 1 ether -> -// gas irOptimized: 186970 +// gas irOptimized: 185818 // gas legacy: 255973 // gas legacyOptimized: 178919 // c() -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index 6a8da2778..301dc0de1 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -16,7 +16,7 @@ contract D { } // ---- // constructor(), 27 wei -> -// gas irOptimized: 169377 +// gas irOptimized: 167649 // gas legacy: 218459 // gas legacyOptimized: 167292 // f() -> 27 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 efff7a950..cb172017f 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: 178542 +// gas irOptimized: 178525 // gas legacy: 180839 -// gas legacyOptimized: 179375 +// gas legacyOptimized: 179374 diff --git a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol index d95a2cd7c..1306529d4 100644 --- a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol +++ b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol @@ -37,10 +37,10 @@ contract D { // f() -> 0x1 # This should work, next should throw # // gas legacy: 102095 // fview() -> FAILURE -// gas irOptimized: 98438596 +// gas irOptimized: 98438588 // gas legacy: 98438774 // gas legacyOptimized: 98438580 // fpure() -> FAILURE -// gas irOptimized: 98438596 +// gas irOptimized: 98438589 // gas legacy: 98438774 // gas legacyOptimized: 98438580 diff --git a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol index 482847b67..bd5a59519 100644 --- a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol +++ b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol @@ -26,7 +26,7 @@ contract c { // x() -> 0, 0 // y() -> 0, 0 // set() -> -// gas irOptimized: 109690 +// gas irOptimized: 109684 // gas legacy: 109728 // gas legacyOptimized: 109680 // x() -> 1, 2 diff --git a/test/libsolidity/semanticTests/various/value_complex.sol b/test/libsolidity/semanticTests/various/value_complex.sol index 80f8bb55c..9f262fbde 100644 --- a/test/libsolidity/semanticTests/various/value_complex.sol +++ b/test/libsolidity/semanticTests/various/value_complex.sol @@ -19,7 +19,7 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 174351 +// gas irOptimized: 172407 // gas legacy: 252296 // gas legacyOptimized: 180352 // sendAmount(uint256): 5 -> 8 diff --git a/test/libsolidity/semanticTests/various/value_insane.sol b/test/libsolidity/semanticTests/various/value_insane.sol index 4a4432758..1e591050c 100644 --- a/test/libsolidity/semanticTests/various/value_insane.sol +++ b/test/libsolidity/semanticTests/various/value_insane.sol @@ -18,7 +18,7 @@ contract test { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 175215 +// gas irOptimized: 173271 // gas legacy: 253820 // gas legacyOptimized: 180784 // sendAmount(uint256): 5 -> 8 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 4b8f599a8..31d62306b 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: 113010 +// gas irOptimized: 113051 // gas legacy: 112890 // gas legacyOptimized: 112580 diff --git a/test/libyul/objectCompiler/nested_optimizer.yul b/test/libyul/objectCompiler/nested_optimizer.yul index cde1210ff..2e9ad3ccb 100644 --- a/test/libyul/objectCompiler/nested_optimizer.yul +++ b/test/libyul/objectCompiler/nested_optimizer.yul @@ -18,7 +18,7 @@ object "a" { // optimizationPreset: full // ---- // Assembly: -// /* "source":48:49 */ +// /* "source":93:102 */ // 0x00 // /* "source":35:50 */ // dup1 @@ -30,7 +30,7 @@ object "a" { // stop // // sub_0: assembly { -// /* "source":188:189 */ +// /* "source":237:246 */ // 0x00 // /* "source":175:190 */ // dup1 @@ -42,4 +42,4 @@ object "a" { // } // Bytecode: 5f80355500fe // Opcodes: PUSH0 DUP1 CALLDATALOAD SSTORE STOP INVALID -// SourceMappings: 48:1:0:-:0;35:15;;107:20;20:111 +// SourceMappings: 93:9:0:-:0;35:15;;107:20;20:111 diff --git a/test/libyul/objectCompiler/simple_optimizer.yul b/test/libyul/objectCompiler/simple_optimizer.yul index 3ce4b7a4b..3bd5f3aa1 100644 --- a/test/libyul/objectCompiler/simple_optimizer.yul +++ b/test/libyul/objectCompiler/simple_optimizer.yul @@ -8,7 +8,7 @@ // optimizationPreset: full // ---- // Assembly: -// /* "source":26:27 */ +// /* "source":67:76 */ // 0x00 // /* "source":13:28 */ // dup1 @@ -19,4 +19,4 @@ // stop // Bytecode: 5f80355500 // Opcodes: PUSH0 DUP1 CALLDATALOAD SSTORE STOP -// SourceMappings: 26:1:0:-:0;13:15;;79:20;0:101 +// SourceMappings: 67:9:0:-:0;13:15;;79:20;0:101 diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/replace_return_nonzero.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/replace_return_nonzero.yul index 8c6096629..71c18757e 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/replace_return_nonzero.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/replace_return_nonzero.yul @@ -6,6 +6,8 @@ let b := 1 } } +// ==== +// EVMVersion: >=shanghai // ---- // step: commonSubexpressionEliminator // @@ -14,7 +16,7 @@ // { // let t := 0 // x := 1 -// let a := t +// let a := 0 // let b := x // } // } diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul index 35891b459..598d3a16d 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul @@ -9,13 +9,15 @@ let b := 0 sstore(a, b) } +// ==== +// EVMVersion: >=shanghai // ---- // step: commonSubexpressionEliminator // // { // let a -// let b := a -// sstore(a, a) +// let b := 0 +// sstore(a, b) // function f() -> x // { // let y := 0 diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/combine_add_and_mod_constant.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/combine_add_and_mod_constant.yul index f462486ea..231241729 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/combine_add_and_mod_constant.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/combine_add_and_mod_constant.yul @@ -1,13 +1,13 @@ { mstore(0, mod(add(mload(0), mload(1)), 32)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _3 := mload(1) -// let _4 := 0 -// mstore(_4, addmod(mload(_4), _3, 32)) +// mstore(0, addmod(mload(0), mload(1), 32)) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/combine_mul_and_mod_constant.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/combine_mul_and_mod_constant.yul index 93edb5319..26beda860 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/combine_mul_and_mod_constant.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/combine_mul_and_mod_constant.yul @@ -1,13 +1,13 @@ { mstore(0, mod(mul(mload(0), mload(1)), 32)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _3 := mload(1) -// let _4 := 0 -// mstore(_4, mulmod(mload(_4), _3, 32)) +// mstore(0, mulmod(mload(0), mload(1), 32)) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/create2_and_mask.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/create2_and_mask.yul index a431c57a6..086eb1c21 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/create2_and_mask.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/create2_and_mask.yul @@ -7,7 +7,7 @@ sstore(a, b) } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // @@ -16,7 +16,7 @@ // let _1 := 0xffffffffffffffffffffffffffffffffffffffff // let _2 := 0 // let _3 := 0x20 -// let a := and(create2(_2, _2, _3, _2), _1) -// sstore(a, and(_1, create2(_2, _2, _3, _2))) +// let a := and(create2(0, 0, _3, _2), _1) +// sstore(a, and(_1, create2(0, 0, _3, 0))) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/create_and_mask.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/create_and_mask.yul index 3710cbebd..24ac42eee 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/create_and_mask.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/create_and_mask.yul @@ -7,16 +7,17 @@ let b := and(0xffffffffffffffffffffffffffffffffffffffff, create(0, 0, 0x20)) sstore(a, b) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { // let _1 := 0x20 -// let _2 := 0 -// let c := create(_2, _2, _1) +// let c := create(0, 0, _1) // let _4 := 0xffffffffffffffffffffffffffffffffffffffff // let a := and(c, _4) -// sstore(a, and(_4, create(_2, _2, _1))) +// sstore(a, and(_4, create(0, 0, _1))) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/exp_simplifications.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/exp_simplifications.yul index 4a5d21805..0e98c3d5a 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/exp_simplifications.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/exp_simplifications.yul @@ -8,15 +8,14 @@ sstore(4, exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, t)) } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// let t := calldataload(_1) -// sstore(_1, iszero(t)) +// let t := calldataload(0) +// sstore(0, iszero(t)) // sstore(1, 1) // let _8 := 2 // sstore(_8, shl(t, 1)) diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul index af88cbac6..b506d206e 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul @@ -2,7 +2,13 @@ let a := sub(calldataload(0), calldataload(0)) sstore(0, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // -// { { sstore(0, 0) } } +// { +// { +// sstore(0, sub(calldataload(0), calldataload(0))) +// } +// } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul index 80f19a1b5..e3aa8fad0 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul @@ -2,12 +2,13 @@ let a := sub(calldataload(1), calldataload(0)) sstore(0, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// sstore(_1, sub(calldataload(1), calldataload(_1))) +// sstore(0, sub(calldataload(1), calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul index 3e0f785e9..443c0b17d 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/iszero_sub_to_eq.yul @@ -6,13 +6,14 @@ sstore(0, 1) } } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// let a := calldataload(_1) -// if eq(a, calldataload(0x20)) { sstore(_1, 1) } +// let a := calldataload(0) +// if eq(a, calldataload(0x20)) { sstore(0, 1) } // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/large_byte_access.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/large_byte_access.yul index 19d65dca4..a8a4d0134 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/large_byte_access.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/large_byte_access.yul @@ -9,16 +9,17 @@ sstore(9, c) sstore(10, d) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// let a := calldataload(_1) +// let a := calldataload(0) // let b := 0 // let c := byte(20, a) -// pop(create(_1, _1, 0x20)) +// pop(create(0, 0, 0x20)) // let d := 0 // sstore(7, a) // sstore(8, b) diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul index 88ed926b1..416ee2410 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul @@ -1,12 +1,13 @@ { mstore(0, mod(calldataload(0), exp(2, 8))) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _4 := 0 -// mstore(_4, and(calldataload(_4), 255)) +// mstore(0, and(calldataload(0), 255)) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul index a62c5904c..1987c59d2 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul @@ -1,12 +1,13 @@ { mstore(0, mod(calldataload(0), exp(2, 255))) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _4 := 0 -// mstore(_4, and(calldataload(_4), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) +// mstore(0, and(calldataload(0), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul index c42693521..d60b6b147 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul @@ -3,15 +3,13 @@ let c := sub(f(0), f(1)) sstore(0, c) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { -// { -// let _2 := f(1) -// let _3 := 0 -// sstore(_3, sub(f(_3), _2)) -// } +// { sstore(0, sub(f(0), f(1))) } // function f(a) -> b // { } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul index a7be174e3..d343f2e5f 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul @@ -5,15 +5,15 @@ let a := div(keccak256(0, 0), 0) sstore(20, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := msize() -// let _2 := 0 -// sstore(_2, _1) -// pop(keccak256(_2, _2)) +// sstore(0, msize()) +// pop(keccak256(0, 0)) // sstore(20, 0) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/pop_byte_shr_call.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/pop_byte_shr_call.yul index abd1b1743..d9fcde9b6 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/pop_byte_shr_call.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/pop_byte_shr_call.yul @@ -2,14 +2,13 @@ sstore(0, byte(0, shr(0x8, call(0, 0, 0, 0, 0, 0, 0)))) } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// pop(call(_1, _1, _1, _1, _1, _1, _1)) -// sstore(_1, 0) +// pop(call(0, 0, 0, 0, 0, 0, 0)) +// sstore(0, 0) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul index d0cf0a6ee..c771dbbcb 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul @@ -3,14 +3,15 @@ x := 0 mstore(0, add(7, x)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// let x := mload(_1) -// x := _1 -// mstore(_1, 7) +// let x := mload(0) +// x := 0 +// mstore(0, 7) // } // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/remove_redundant_shift_masking.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/remove_redundant_shift_masking.yul index a4d3012c3..d3adb749c 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/remove_redundant_shift_masking.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/remove_redundant_shift_masking.yul @@ -7,7 +7,7 @@ sstore(c, d) } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // @@ -16,9 +16,9 @@ // let _2 := calldataload(0) // let _5 := 0xff // let a := shr(248, _2) -// let b := shr(248, _2) -// let c := and(shr(249, _2), 0xfa) -// let d := and(shr(247, _2), _5) +// let b := shr(248, calldataload(0)) +// let c := and(shr(249, calldataload(0)), 0xfa) +// let d := and(shr(247, calldataload(0)), _5) // sstore(a, b) // sstore(c, d) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul index b83b77c21..9fce89758 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul @@ -2,12 +2,9 @@ let a := add(0, mload(0)) sstore(0, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // -// { -// { -// let _1 := 0 -// sstore(_1, mload(_1)) -// } -// } +// { { sstore(0, mload(0)) } } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul index a15cca231..300ed606f 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul @@ -4,12 +4,9 @@ let y := add(d, add(c, 7)) sstore(0, y) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // -// { -// { -// let c, d -// sstore(d, 7) -// } -// } +// { { sstore(0, 7) } } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/zero_length_read.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/zero_length_read.yul index ee7464932..77b7bd5a4 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/zero_length_read.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/zero_length_read.yul @@ -5,17 +5,19 @@ return(calldataload(3), 0) codecopy(calldataload(4), calldataload(5), sub(42,42)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: expressionSimplifier // // { // { -// let _1 := 0 -// revert(0, _1) -// pop(call(_1, _1, _1, _1, _1, _1, _1)) -// revert(0, _1) -// calldatacopy(0, calldataload(2), _1) -// return(0, _1) +// revert(0, 0) +// let _4 := 0 +// pop(call(0, 0, 0, 0, 0, 0, 0)) +// revert(0, _4) +// calldatacopy(0, calldataload(2), 0) +// return(0, 0) // codecopy(0, calldataload(5), 0) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul b/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul index a13ad9395..1f5b19591 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul @@ -2,12 +2,9 @@ let a := add(7, sub(mload(0), 7)) mstore(a, 0) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // -// { -// { -// let _2 := 0 -// mstore(mload(_2), _2) -// } -// } +// { { mstore(mload(0), 0) } } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul index eb104f633..3e1e4a158 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul @@ -2,7 +2,13 @@ let a := sub(calldataload(0), calldataload(0)) mstore(a, 0) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // -// { { mstore(0, 0) } } +// { +// { +// mstore(sub(calldataload(0), calldataload(0)), 0) +// } +// } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul index daf34eed5..e2ba9e34a 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul @@ -2,12 +2,13 @@ let a := sub(calldataload(1), calldataload(0)) mstore(0, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // // { // { -// let _1 := 0 -// mstore(_1, sub(calldataload(1), calldataload(_1))) +// mstore(0, sub(calldataload(1), calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul b/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul index 0ab5cc6ed..98e59413e 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul @@ -7,14 +7,15 @@ // run of CSE afterwards. mstore(b, eq(calldataload(0), a)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // // { // { // let a := calldataload(0) -// let _4 := 0 // let b := a -// mstore(b, eq(calldataload(_4), a)) +// mstore(b, eq(calldataload(0), a)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul index c10345e4e..213399877 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul @@ -1,12 +1,13 @@ { mstore(0, mod(calldataload(0), exp(2, 8))) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // // { // { -// let _4 := 0 -// mstore(_4, and(calldataload(_4), 255)) +// mstore(0, and(calldataload(0), 255)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul index fc171337f..70f0e41cc 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul @@ -1,12 +1,13 @@ { mstore(0, mod(calldataload(0), exp(2, 255))) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // // { // { -// let _4 := 0 -// mstore(_4, and(calldataload(_4), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) +// mstore(0, and(calldataload(0), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul index e42b6c098..f3184d652 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul @@ -2,15 +2,13 @@ function f(a) -> b { } mstore(0, sub(f(0), f(1))) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // // { -// { -// let _2 := f(1) -// let _3 := 0 -// mstore(_3, sub(f(_3), _2)) -// } +// { mstore(0, sub(f(0), f(1))) } // function f(a) -> b // { } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul index 0e366e6d4..a51598f14 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul @@ -3,13 +3,14 @@ let a := div(create(0, 0, 0), 0) mstore(0, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // // { // { -// let _1 := 0 -// pop(create(_1, _1, _1)) -// mstore(_1, 0) +// pop(create(0, 0, 0)) +// mstore(0, 0) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul b/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul index b3b98d061..0b536dd84 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul @@ -2,12 +2,9 @@ let a := add(0, mload(0)) mstore(0, a) } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSimplify // -// { -// { -// let _1 := 0 -// mstore(_1, mload(_1)) -// } -// } +// { { mstore(0, mload(0)) } } diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index b69d19cdb..8a453e004 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -457,26 +457,25 @@ } } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { -// let _1 := 0 -// let _2 := mload(_1) +// let _1 := mload(0) // let pos := 0x20 -// let length := mload(_2) +// let length := mload(_1) // mstore(pos, length) // pos := 64 -// let srcPtr := add(_2, 0x20) -// let i := _1 +// let srcPtr := add(_1, 0x20) +// let i := 0 // for { } lt(i, length) { i := add(i, 1) } // { -// let _3 := mload(srcPtr) +// let _2 := mload(srcPtr) // let pos_1 := pos -// let srcPtr_1 := _3 -// let i_1 := _1 +// let srcPtr_1 := _2 +// let i_1 := 0 // for { } lt(i_1, 0x3) { i_1 := add(i_1, 1) } // { // mstore(pos_1, and(mload(srcPtr_1), sub(shl(160, 1), 1))) @@ -489,7 +488,7 @@ // let a, b, c, d := abi_decode_uint256t_uint256t_array_uint256_dynt_array_array_uint256_memory_dyn(mload(0x20), mload(64)) // sstore(a, b) // sstore(c, d) -// sstore(_1, pos) +// sstore(0, pos) // } // function abi_decode_array_array_uint256_memory_dyn(offset, end) -> array // { diff --git a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul index 2b2205579..65f04e8c6 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul @@ -229,7 +229,7 @@ } } // ==== -// EVMVersion: >=istanbul +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -273,11 +273,11 @@ // switch gt(_2, calldataload(0x24)) // case 1 { // kn := addmod(kn, sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, k), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) -// let x := mod(mload(0), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// let x := mod(mload(0x00), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // k := mulmod(k, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // a := mulmod(a, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // c := mulmod(mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) -// mstore(0, keccak256(0, 0x20)) +// mstore(0x00, keccak256(0x00, 0x20)) // } // case 0 { // kn := addmod(kn, k, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) @@ -309,19 +309,19 @@ // } // if iszero(result) // { -// mstore(0, 400) -// revert(0, 0x20) +// mstore(0x00, 400) +// revert(0x00, 0x20) // } // 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))) // { -// mstore(0, 404) -// revert(0, 0x20) +// mstore(0x00, 404) +// revert(0x00, 0x20) // } -// mstore(0, 0x01) -// return(0, 0x20) +// mstore(0x00, 0x01) +// return(0x00, 0x20) // } // function validatePairing() // { @@ -356,8 +356,8 @@ // let success := call(gas(), 8, 0, _6, _7, _6, _6) // if or(iszero(success), iszero(mload(_6))) // { -// mstore(0, 400) -// revert(0, _6) +// mstore(0x00, 400) +// revert(0x00, _6) // } // } // function validateCommitment(note, k, a) @@ -381,6 +381,6 @@ // { // calldatacopy(add(0x300, shl(7, i)), add(add(notes, mul(i, 0xc0)), 0x60), 0x80) // } -// mstore(0, keccak256(0x300, shl(7, n))) +// mstore(0x00, keccak256(0x300, shl(7, n))) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/clear_after_if_continue.yul b/test/libyul/yulOptimizerTests/fullSuite/clear_after_if_continue.yul index 71ed36d97..d5a5af833 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/clear_after_if_continue.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/clear_after_if_continue.yul @@ -6,6 +6,8 @@ } if y { revert(0, 0) } } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -13,15 +15,7 @@ // { // let y := mload(0x20) // let _1 := iszero(and(y, 8)) -// for { } -// iszero(_1) -// { -// if y -// { -// let _2 := 0 -// revert(_2, _2) -// } -// } +// for { } iszero(_1) { if y { revert(0, 0) } } // { // if y { continue } // sstore(1, 0) diff --git a/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul b/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul index 813c2706e..f9d248e2f 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul @@ -7,15 +7,14 @@ sstore(a, b) } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { // let _1 := sub(shl(160, 1), 1) -// let _2 := 0 -// let a := and(create2(_2, _2, 0x20, _2), _1) -// sstore(a, and(_1, create2(_2, _2, 0x20, _2))) +// let a := and(create2(0, 0, 0x20, 0), _1) +// sstore(a, and(_1, create2(0, 0, 0x20, 0))) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul b/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul index 9cdf20193..a02128ebe 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/devcon_example.yul @@ -15,7 +15,7 @@ } } // ==== -// EVMVersion: >=istanbul +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -24,7 +24,7 @@ // let _1 := calldataload(0) // let sum := 0 // let length := calldataload(_1) -// let i := sum +// let i := 0 // for { } lt(i, length) { i := add(i, 1) } // { // sum := add(sum, calldataload(add(add(_1, shl(5, i)), 0x20))) diff --git a/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul b/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul index 5bd34186e..1c6125a33 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/loopInvariantCodeMotion.yul @@ -18,7 +18,7 @@ } } // ==== -// EVMVersion: >=istanbul +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -27,7 +27,7 @@ // let _1 := calldataload(0) // let sum := 0 // let length := calldataload(_1) -// let i := sum +// let i := 0 // let _2 := calldataload(7) // for { } lt(i, length) { i := add(i, 1) } // { diff --git a/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul b/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul index 75e2ff4c2..c49de5109 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul @@ -34,7 +34,7 @@ sstore(3,1) } // ==== -// EVMVersion: >homestead +// EVMVersion: >=shanghai // ---- // step: fullSuite // @@ -52,6 +52,7 @@ // pop(keccak256(gcd(_3, _2), or(gt(not(gcd(_3, _2)), _1), _1))) // 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(0, 0) // sstore(2, _1) // extcodecopy(_1, msize(), _1, _1) // sstore(0, 0) diff --git a/test/libyul/yulOptimizerTests/fullSuite/static_array_slot_computation.yul b/test/libyul/yulOptimizerTests/fullSuite/static_array_slot_computation.yul index 72c09d3dc..b4affc2f3 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/static_array_slot_computation.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/static_array_slot_computation.yul @@ -22,24 +22,24 @@ } } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { -// let _1 := 0 -// if eq(0x26121ff0, shr(224, calldataload(_1))) +// if eq(0x26121ff0, shr(224, calldataload(0))) // { -// if callvalue() { revert(_1, _1) } -// if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } -// if iszero(lt(0x0a, sload(_1))) +// if callvalue() { revert(0, 0) } +// if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } +// if iszero(lt(0x0a, sload(0))) // { -// mstore(_1, shl(224, 0x4e487b71)) +// mstore(0, shl(224, 0x4e487b71)) // mstore(4, 0x32) -// revert(_1, 0x24) +// revert(0, 0x24) // } -// sstore(0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56d, 0x05) +// mstore(0, 0) +// sstore(add(keccak256(0, 0x20), 0x0a), 0x05) // } // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner.yul b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner.yul index 6f82ab27a..a12240ea6 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner.yul @@ -14,12 +14,15 @@ if iszero(out1) { leave } } } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { // let out1, out2 := foo(sload(32)) +// sstore(0, out1) // sstore(0, out2) // let out1_1, out2_1 := foo(sload(8)) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul index 7955ee12e..5e1b437df 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul @@ -12,26 +12,29 @@ } } } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { // f() +// sstore(0, 1) // f() +// sstore(0, 1) // f() // sstore(0, 1) // } // function f() // { // let b := 10 -// let _1 := 0 -// let a := calldataload(_1) -// let _2 := iszero(a) +// let a := calldataload(0) +// let _1 := iszero(a) // for { } iszero(b) { b := add(b, not(0)) } // { -// mstore(a, _1) -// if _2 { leave } +// mstore(a, 0) +// if _1 { leave } // } // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_return.yul b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_return.yul index b066d998b..b013f6fd7 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_return.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_return.yul @@ -16,12 +16,16 @@ if iszero(out1) { leave } } } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { // let out1, out2 := foo(sload(32)) +// sstore(0, out1) +// sstore(0, out2) // sstore(0, 0) // let out1_1, out2_1 := foo(sload(8)) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_simple.yul b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_simple.yul index 785840baa..ec88df6b8 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_simple.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_simple.yul @@ -10,13 +10,17 @@ if iszero(a) { leave } } } +// ==== +// EVMVersion: >=shanghai // ---- // step: fullSuite // // { // { // f() +// sstore(0, 1) // f() +// sstore(0, 1) // f() // sstore(0, 1) // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak.yul index 25b36f5fe..32c29c281 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak.yul @@ -5,14 +5,14 @@ let val := keccak256(0, 32) sstore(0, val) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 10 -// let _2 := 0 -// mstore(_2, _1) -// sstore(_2, 89717814153306320011181716697424560163256864414616650038987186496166826726056) +// mstore(0, 10) +// sstore(0, keccak256(0, 32)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_fail1.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_fail1.yul index e4fe6484f..7fbf7d2c0 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_fail1.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_fail1.yul @@ -6,15 +6,15 @@ let val := keccak256(0, 32) sstore(0, val) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 30 -// let _2 := 0 -// mstore(_2, _1) -// if calldataload(_2) { mstore(_2, 20) } -// sstore(_2, keccak256(_2, 32)) +// mstore(0, 30) +// if calldataload(0) { mstore(0, 20) } +// sstore(0, keccak256(0, 32)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_basic.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_basic.yul index b838c87e0..39cfe13d4 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_basic.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_basic.yul @@ -6,14 +6,15 @@ let b := keccak256(0, x) sstore(b, 3) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let a := keccak256(_1, calldataload(_1)) -// sstore(a, 2) -// sstore(a, 3) +// let x := calldataload(0) +// sstore(keccak256(0, x), 2) +// sstore(keccak256(0, x), 3) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_expr_mstore.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_expr_mstore.yul index 7b37f8c95..c0d974154 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_expr_mstore.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_expr_mstore.yul @@ -9,18 +9,17 @@ y := mload(8) } } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let a := calldataload(_1) -// let _3 := keccak256(_1, a) -// sstore(f(_3), _3) -// let _8 := keccak256(_1, a) -// sstore(f(_8), _8) -// sstore(keccak256(_1, a), f(keccak256(_1, a))) +// let a := calldataload(0) +// sstore(f(keccak256(0, a)), keccak256(0, a)) +// sstore(f(keccak256(0, a)), keccak256(0, a)) +// sstore(keccak256(0, a), f(keccak256(0, a))) // } // function f(x) -> y // { diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_in_expression.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_in_expression.yul index f4d37d90e..70cf905ea 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_in_expression.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_in_expression.yul @@ -2,13 +2,14 @@ let x := calldataload(0) sstore(keccak256(0, x), keccak256(0, x)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let _3 := keccak256(_1, calldataload(_1)) -// sstore(_3, _3) +// let x := calldataload(0) +// sstore(keccak256(0, x), keccak256(0, x)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_msize.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_msize.yul index 499a227c2..d8c4c2038 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_msize.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_msize.yul @@ -5,14 +5,15 @@ let y := keccak256(0, a) sstore(x, y) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let a := calldataload(_1) -// let x := keccak256(_1, a) -// sstore(x, keccak256(_1, a)) +// let a := calldataload(0) +// let x := keccak256(0, a) +// sstore(x, keccak256(0, a)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_mstore.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_mstore.yul index 65b5931a9..c62135856 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_mstore.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_reuse_mstore.yul @@ -7,16 +7,17 @@ let b := keccak256(0x20, x) sstore(b, 3) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let x := calldataload(_1) +// let x := calldataload(0) // let _2 := 0x20 // sstore(keccak256(_2, x), 2) -// mstore(_1, 1) +// mstore(0, 1) // sstore(keccak256(_2, x), 3) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_short.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_short.yul index 58cb7c264..baf233050 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_short.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_short.yul @@ -15,19 +15,21 @@ sstore(2, keccak256(0, 1)) sstore(2, keccak256(0, 0)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 10 -// let _2 := 0 -// mstore(_2, _1) -// sstore(_2, 9948786400348073077032572701554570401043517428989726124163377057770909578447) -// sstore(1, 110945455955148346822663466543669633859020391897956790847617069135813044810108) -// let _13 := 85131057757245807317576516368191972321038229705283732634690444270750521936266 +// mstore(0, 10) +// sstore(0, keccak256(0, 31)) +// let _9 := keccak256(0, 30) +// let _10 := 1 +// sstore(_10, _9) +// let _13 := keccak256(0, _10) // let _14 := 2 // sstore(_14, _13) -// sstore(_14, 89477152217924674838424037953991966239322087453347756267410168184682657981552) +// sstore(_14, keccak256(0, 0)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_string_literal.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_string_literal.yul index 261f38cd1..463aa531c 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_string_literal.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_string_literal.yul @@ -8,6 +8,8 @@ sstore(0, keccak256(_1, converted)) sstore(0, add(mload(_1), 1)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -16,9 +18,7 @@ // let _1 := 50 // let _2 := "abcdefghijklmn" // mstore(_1, _2) -// let _3 := 51246744213555520563123611275127692828770413530219146609532820042079541949502 -// let _4 := 0 -// sstore(_4, _3) -// sstore(_4, add(_2, 1)) +// sstore(0, 51246744213555520563123611275127692828770413530219146609532820042079541949502) +// sstore(0, add(_2, 1)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_symbolic_memory.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_symbolic_memory.yul index 46466a062..2079b03fb 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_symbolic_memory.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_symbolic_memory.yul @@ -11,14 +11,15 @@ sstore(0, keccak256(offset, 32)) sstore(1, keccak256(offset, 16)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// mstore(calldataload(_1), 500) -// sstore(_1, 92647596584187651892918913434663110448935397770592030057655219009846081465370) +// mstore(calldataload(0), 500) +// sstore(0, 92647596584187651892918913434663110448935397770592030057655219009846081465370) // sstore(1, 110620294328144418057589324861608220015688365608948720310623173341503153578932) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/keccak_with_msize.yul b/test/libyul/yulOptimizerTests/loadResolver/keccak_with_msize.yul index 5e1c7d419..597bb6d15 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/keccak_with_msize.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/keccak_with_msize.yul @@ -7,15 +7,15 @@ let val := keccak256(0, 32) sstore(1, val) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := msize() -// let _2 := 0 -// sstore(_2, _1) -// mstore(_2, 10) -// sstore(1, keccak256(_2, 32)) +// sstore(0, msize()) +// mstore(0, 10) +// sstore(1, keccak256(0, 32)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/loop.yul b/test/libyul/yulOptimizerTests/loadResolver/loop.yul index 458767160..99c62ef15 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/loop.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/loop.yul @@ -4,17 +4,17 @@ x := add(x, 1)} {y := add(x, y) } } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 123213 -// let _2 := 0 -// sstore(_2, _1) -// let x := _2 +// sstore(0, 123213) +// let x := 0 // let y -// for { } lt(x, _1) { x := add(x, 1) } +// for { } lt(x, sload(0)) { x := add(x, 1) } // { y := add(x, y) } // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul b/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul index 840f19005..010b6c6b9 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul @@ -14,6 +14,8 @@ function g() {} } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -22,16 +24,14 @@ // let _1 := 9 // let _2 := 2 // mstore(_2, _1) -// let _4 := _1 -// let _5 := 0 -// sstore(_5, _4) -// pop(call(_5, _5, _5, _5, _5, _5, _5)) -// sstore(_5, mload(_2)) +// sstore(0, _1) +// pop(call(0, 0, 0, 0, 0, 0, 0)) +// sstore(0, mload(_2)) // let _17 := 10 // mstore(_2, _17) -// mstore8(calldataload(_5), 4) -// sstore(_5, mload(_2)) +// mstore8(calldataload(0), 4) +// sstore(0, mload(_2)) // mstore(_2, _17) -// sstore(_5, _17) +// sstore(0, _17) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/memory_with_msize.yul b/test/libyul/yulOptimizerTests/loadResolver/memory_with_msize.yul index f54053bb1..14e91d197 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/memory_with_msize.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/memory_with_msize.yul @@ -5,15 +5,15 @@ let q := mload(calldataload(0)) sstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := msize() -// let _3 := calldataload(0) -// mstore(_3, _1) +// mstore(calldataload(0), msize()) // let t := mload(calldataload(10)) -// sstore(t, mload(_3)) +// sstore(t, mload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/merge_known_write.yul b/test/libyul/yulOptimizerTests/loadResolver/merge_known_write.yul index acb96c07b..573cb8b01 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/merge_known_write.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/merge_known_write.yul @@ -7,18 +7,17 @@ let q := mload(calldataload(0)) sstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _2 := calldataload(10) -// let _3 := 0 -// let _4 := calldataload(_3) -// mstore(_4, _2) +// mstore(calldataload(0), calldataload(10)) // let _5 := 1 -// if calldataload(_5) { mstore(_4, _5) } -// let t := mload(_3) -// sstore(t, mload(_4)) +// if calldataload(_5) { mstore(calldataload(0), _5) } +// let t := mload(0) +// sstore(t, mload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/merge_known_write_with_distance.yul b/test/libyul/yulOptimizerTests/loadResolver/merge_known_write_with_distance.yul index 1659949a3..e9805aeea 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/merge_known_write_with_distance.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/merge_known_write_with_distance.yul @@ -7,16 +7,20 @@ let q := mload(calldataload(0)) sstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _2 := calldataload(10) -// let _4 := calldataload(0) -// mstore(_4, _2) +// mstore(calldataload(0), calldataload(10)) // let _5 := 1 -// if calldataload(_5) { mstore(add(_4, 0x20), _5) } -// sstore(mload(add(_4, 0x20)), _2) +// if calldataload(_5) +// { +// mstore(add(calldataload(0), 0x20), _5) +// } +// let t := mload(add(calldataload(0), 0x20)) +// sstore(t, mload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/merge_mload_with_known_distance.yul b/test/libyul/yulOptimizerTests/loadResolver/merge_mload_with_known_distance.yul index 18740c049..599937aa7 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/merge_mload_with_known_distance.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/merge_mload_with_known_distance.yul @@ -7,15 +7,19 @@ let q := mload(calldataload(0)) sstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _2 := calldataload(0) -// let x := mload(_2) // let _3 := 1 -// if calldataload(_3) { mstore(add(_2, 0x20), _3) } -// sstore(mload(add(_2, 0x20)), x) +// if calldataload(_3) +// { +// mstore(add(calldataload(0), 0x20), _3) +// } +// let t := mload(add(calldataload(0), 0x20)) +// sstore(t, mload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/merge_mload_without_rewrite.yul b/test/libyul/yulOptimizerTests/loadResolver/merge_mload_without_rewrite.yul index 760641698..6f2c7139e 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/merge_mload_without_rewrite.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/merge_mload_without_rewrite.yul @@ -6,16 +6,16 @@ } sstore(0, mload(2)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { // let _1 := 2 -// let b := mload(_1) -// let _2 := 0 -// sstore(_2, b) +// sstore(0, mload(_1)) // if calldataload(1) { mstore(_1, 7) } -// sstore(_2, mload(_1)) +// sstore(0, mload(_1)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/merge_unknown_write.yul b/test/libyul/yulOptimizerTests/loadResolver/merge_unknown_write.yul index e8cc3cf4b..38930a93e 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/merge_unknown_write.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/merge_unknown_write.yul @@ -7,18 +7,17 @@ let q := mload(calldataload(0)) sstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _2 := calldataload(10) -// let _3 := 0 -// let _4 := calldataload(_3) -// mstore(_4, _2) +// mstore(calldataload(0), calldataload(10)) // let _5 := 1 -// if calldataload(_5) { mstore(_3, _5) } -// let t := mload(_3) -// sstore(t, mload(_4)) +// if calldataload(_5) { mstore(0, _5) } +// let t := mload(0) +// sstore(t, mload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/mload_in_function.yul b/test/libyul/yulOptimizerTests/loadResolver/mload_in_function.yul index b76d071ae..44ac7065a 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/mload_in_function.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/mload_in_function.yul @@ -6,25 +6,24 @@ foo(42) sstore(0, mload(0)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 1337 -// let _2 := 0 -// mstore(_2, _1) +// mstore(0, 1337) // foo(42) -// sstore(_2, mload(_2)) +// sstore(0, mload(0)) // } // function foo(x) // { // for { } // x // { -// let _7 := 0 -// x := mload(_7) -// mstore(_7, _7) +// x := mload(0) +// mstore(0, 0) // } // { } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/mload_self.yul b/test/libyul/yulOptimizerTests/loadResolver/mload_self.yul index 6ad9d36ac..44e59d48e 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/mload_self.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/mload_self.yul @@ -4,14 +4,15 @@ let y := mload(x) sstore(0, y) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let x := calldataload(_1) +// let x := calldataload(0) // x := mload(x) -// sstore(_1, mload(x)) +// sstore(0, mload(x)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul index 901ea12ef..26a8386e2 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul @@ -11,27 +11,22 @@ funcWithLoop(42) sstore(0, mload(0)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 1337 -// let _2 := 0 -// mstore(_2, _1) +// mstore(0, 1337) // funcWithLoop(42) -// sstore(_2, mload(_2)) +// sstore(0, mload(0)) // } // function userNot(x) -> y // { y := iszero(x) } // function funcWithLoop(x_1) // { -// for { } -// userNot(x_1) -// { -// let _7 := 0 -// mstore(_7, _7) -// } +// for { } userNot(x_1) { mstore(0, 0) } // { } // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul index 6fb0fdcba..33d73f4a3 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul @@ -11,23 +11,22 @@ funcWithLoop(42) sstore(0, mload(0)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 1337 -// let _2 := 0 -// mstore(_2, _1) +// mstore(0, 1337) // funcWithLoop(42) -// sstore(_2, mload(_2)) +// sstore(0, mload(0)) // } // function userNot(x) -> y // { y := iszero(x) } // function funcWithLoop(x_1) // { -// let _7 := 0 -// mstore(_7, _7) +// mstore(0, 0) // for { } userNot(x_1) { } // { } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/multi_sload_loop.yul b/test/libyul/yulOptimizerTests/loadResolver/multi_sload_loop.yul index c367059eb..9c3fc4318 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/multi_sload_loop.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/multi_sload_loop.yul @@ -10,23 +10,24 @@ mstore(0, sum) return(0, 0x20) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let x := calldataload(_1) +// let x := calldataload(0) // let len := sload(x) // let sum -// let i := _1 +// let i := 0 // for { } lt(i, len) { i := add(i, 1) } // { // let p := add(add(x, i), 1) -// if gt(p, len) { revert(_1, _1) } +// if gt(p, len) { revert(0, 0) } // sum := add(sum, sload(p)) // } -// mstore(_1, sum) -// return(_1, 0x20) +// mstore(0, sum) +// return(0, 0x20) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/re_store_memory.yul b/test/libyul/yulOptimizerTests/loadResolver/re_store_memory.yul index 031a5f22a..ef14d5b99 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/re_store_memory.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/re_store_memory.yul @@ -7,6 +7,8 @@ mstore(a, c) sstore(10, mload(a)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -16,7 +18,7 @@ // let b := 1 // let c := 2 // mstore(a, b) -// sstore(a, b) +// sstore(0, b) // mstore(a, c) // sstore(10, c) // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/re_store_storage.yul b/test/libyul/yulOptimizerTests/loadResolver/re_store_storage.yul index fab562208..c8ef5481f 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/re_store_storage.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/re_store_storage.yul @@ -7,6 +7,8 @@ sstore(a, c) mstore(32, sload(a)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -16,7 +18,7 @@ // let b := 1 // let c := 2 // sstore(a, b) -// mstore(a, b) +// mstore(0, b) // sstore(a, c) // mstore(32, c) // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/reassign.yul b/test/libyul/yulOptimizerTests/loadResolver/reassign.yul index 694b59e26..4cc59a0b1 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/reassign.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/reassign.yul @@ -4,15 +4,16 @@ a := calldataload(2) mstore(0, sload(a)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // // { // { -// let _1 := 0 -// let a := calldataload(_1) +// let a := calldataload(0) // sstore(a, 6) // a := calldataload(2) -// mstore(_1, sload(a)) +// mstore(0, sload(a)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/second_store.yul b/test/libyul/yulOptimizerTests/loadResolver/second_store.yul index eb960a9f6..4e499be74 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/second_store.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/second_store.yul @@ -6,6 +6,8 @@ // if the two slots are different. mstore(0, sload(x)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -13,9 +15,7 @@ // { // let x := calldataload(1) // sstore(x, 7) -// let _3 := 6 -// let _4 := 0 -// sstore(calldataload(_4), _3) -// mstore(_4, sload(x)) +// sstore(calldataload(0), 6) +// mstore(0, sload(x)) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/second_store_same_value.yul b/test/libyul/yulOptimizerTests/loadResolver/second_store_same_value.yul index e13b8aa5f..728d06fb6 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/second_store_same_value.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/second_store_same_value.yul @@ -6,6 +6,8 @@ // written are 7. mstore(0, sload(x)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -14,8 +16,7 @@ // let x := calldataload(1) // let _2 := 7 // sstore(x, _2) -// let _4 := 0 -// sstore(calldataload(_4), _2) -// mstore(_4, _2) +// sstore(calldataload(0), _2) +// mstore(0, _2) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul b/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul index b1eefd089..0ca0a8aac 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul @@ -8,6 +8,8 @@ stores() sstore(0, mload(2)) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -17,11 +19,9 @@ // let _2 := 2 // mstore(_2, _1) // reads() -// let _4 := _1 -// let _5 := 0 -// sstore(_5, _4) +// sstore(0, _1) // stores() -// sstore(_5, mload(_2)) +// sstore(0, mload(_2)) // } // function stores() // { mstore(0, 1) } diff --git a/test/libyul/yulOptimizerTests/loadResolver/simple.yul b/test/libyul/yulOptimizerTests/loadResolver/simple.yul index a20025bcd..0229223d2 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/simple.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/simple.yul @@ -4,6 +4,8 @@ let q := sload(calldataload(0)) mstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -11,6 +13,7 @@ // { // let _2 := calldataload(10) // sstore(calldataload(0), _2) -// mstore(sload(_2), _2) +// let t := sload(_2) +// mstore(t, sload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/simple_memory.yul b/test/libyul/yulOptimizerTests/loadResolver/simple_memory.yul index 3aa1d740f..164f0f8b5 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/simple_memory.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/simple_memory.yul @@ -4,6 +4,8 @@ let q := mload(calldataload(0)) sstore(t, q) } +// ==== +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -11,6 +13,7 @@ // { // let _2 := calldataload(10) // mstore(calldataload(0), _2) -// sstore(mload(_2), _2) +// let t := mload(_2) +// sstore(t, mload(calldataload(0))) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/staticcall.yul b/test/libyul/yulOptimizerTests/loadResolver/staticcall.yul index 2a72eee3e..9f1fb1443 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/staticcall.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/staticcall.yul @@ -10,7 +10,7 @@ mstore(0, sload(a)) } // ==== -// EVMVersion: >=byzantium +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -23,8 +23,8 @@ // let _2 := 900 // mstore(_2, _1) // let _3 := 200 -// pop(staticcall(10000, 10, a, _3, a, _3)) +// pop(staticcall(10000, 10, 0, _3, 0, _3)) // sstore(1, mload(_2)) -// mstore(a, b) +// mstore(0, b) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul b/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul index 418221a93..afa8fcdd4 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul @@ -17,7 +17,7 @@ return(1, 0) } // ==== -// EVMVersion: >=constantinople +// EVMVersion: >=shanghai // ---- // step: loadResolver // @@ -26,20 +26,20 @@ // let _1 := 0 // let _2 := 1 // returndatacopy(0, _2, _1) -// calldatacopy(0, _2, _1) -// extcodecopy(_2, 0, _2, _1) -// codecopy(0, _2, _1) -// log0(0, _1) -// log1(0, _1, _2) -// log2(0, _1, _2, _2) -// log3(0, _1, _2, _2, _2) -// log4(0, _1, _2, _2, _2, _2) -// pop(create(_2, 0, _1)) -// pop(create2(_2, 0, _1, _2)) -// pop(call(_2, _2, _2, 0, _1, _2, _1)) -// pop(callcode(_2, _2, _2, 0, _1, _2, _1)) -// pop(delegatecall(_2, _2, 0, _1, _2, _1)) -// pop(staticcall(_2, _2, 0, _1, _2, _1)) -// return(0, _1) +// calldatacopy(0, _2, 0) +// extcodecopy(_2, 0, _2, 0) +// codecopy(0, _2, 0) +// log0(0, 0) +// log1(0, 0, _2) +// log2(0, 0, _2, _2) +// log3(0, 0, _2, _2, _2) +// log4(0, 0, _2, _2, _2, _2) +// pop(create(_2, 0, 0)) +// pop(create2(_2, 0, 0, _2)) +// pop(call(_2, _2, _2, 0, 0, _2, 0)) +// pop(callcode(_2, _2, _2, 0, 0, _2, 0)) +// pop(delegatecall(_2, _2, 0, 0, _2, 0)) +// pop(staticcall(_2, _2, 0, 0, _2, 0)) +// return(0, 0) // } // }