From d80a92752a6d31da151bccc5e196a587fdc7650b Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 13 Apr 2021 10:25:01 +0200 Subject: [PATCH 1/7] Added a gas test for storage costs --- test/libsolidity/gasTests/storage_costs.sol | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/libsolidity/gasTests/storage_costs.sol diff --git a/test/libsolidity/gasTests/storage_costs.sol b/test/libsolidity/gasTests/storage_costs.sol new file mode 100644 index 000000000..f8db704e2 --- /dev/null +++ b/test/libsolidity/gasTests/storage_costs.sol @@ -0,0 +1,24 @@ +contract C { + uint x; + function setX(uint y) public { + x = y; + } + function resetX() public { + x = 0; + } + function readX() public view returns(uint) { + return x; + } +} +// ==== +// optimize: true +// optimize-yul: true +// ---- +// creation: +// codeDepositCost: 27000 +// executionCost: 81 +// totalCost: 27081 +// external: +// readX(): 990 +// resetX(): 5116 +// setX(uint256): 20212 From 7d28ea3746ab0bc1f75eec597984a4090295d97e Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 13 Apr 2021 09:15:32 +0200 Subject: [PATCH 2/7] Updated gas costs for Berlin --- libevmasm/GasMeter.cpp | 4 +- libevmasm/GasMeter.h | 83 ++++++++++++++++----- test/libsolidity/gasTests/storage_costs.sol | 4 +- 3 files changed, 70 insertions(+), 21 deletions(-) diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index 089a371c6..57a898f65 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -71,9 +71,9 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _ m_state->storageContent().count(slot) && classes.knownNonZero(m_state->storageContent().at(slot)) )) - gas = GasCosts::sstoreResetGas; //@todo take refunds into account + gas = GasCosts::totalSstoreResetGas(m_evmVersion); //@todo take refunds into account else - gas = GasCosts::sstoreSetGas; + gas = GasCosts::totalSstoreSetGas(m_evmVersion); break; } case Instruction::SLOAD: diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index ef7bc7073..dc5fca5cc 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -18,6 +18,11 @@ /** @file GasMeter.cpp * @author Christian * @date 2015 + * + * Utilities for tracking gas costs. + * + * With respect to EIP-2929, we do not track warm accounts or storage slots and they are always + * charged the worst-case, i.e., cold-access. */ #pragma once @@ -47,19 +52,6 @@ namespace GasCosts static unsigned const tier5Gas = 10; static unsigned const tier6Gas = 20; static unsigned const tier7Gas = 0; - inline unsigned extCodeGas(langutil::EVMVersion _evmVersion) - { - return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 700 : 20; - } - inline unsigned balanceGas(langutil::EVMVersion _evmVersion) - { - if (_evmVersion >= langutil::EVMVersion::istanbul()) - return 700; - else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle()) - return 400; - else - return 20; - } static unsigned const expGas = 10; inline unsigned expByteGas(langutil::EVMVersion _evmVersion) { @@ -67,18 +59,65 @@ namespace GasCosts } static unsigned const keccak256Gas = 30; static unsigned const keccak256WordGas = 6; + /// Corresponds to COLD_SLOAD_COST from EIP-2929 + static unsigned const coldSloadCost = 2100; + /// Corresponds to COLD_ACCOUNT_ACCESS_COST from EIP-2929 + static unsigned const coldAccountAccessCost = 2600; + /// Corresponds to WARM_STORAGE_READ_COST from EIP-2929 + static unsigned const warmStorageReadCost = 100; inline unsigned sloadGas(langutil::EVMVersion _evmVersion) { - if (_evmVersion >= langutil::EVMVersion::istanbul()) + if (_evmVersion >= langutil::EVMVersion::berlin()) + return coldSloadCost; + else if (_evmVersion >= langutil::EVMVersion::istanbul()) return 800; else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle()) return 200; else return 50; } + /// Corresponds to SSTORE_SET_GAS static unsigned const sstoreSetGas = 20000; - static unsigned const sstoreResetGas = 5000; + /// Corresponds to SSTORE_RESET_GAS from EIP-2929 + static unsigned const sstoreResetGas = 5000 - coldSloadCost; static unsigned const sstoreRefundGas = 15000; + inline static unsigned totalSstoreSetGas(langutil::EVMVersion _evmVersion) + { + if (_evmVersion >= langutil::EVMVersion::berlin()) + return sstoreSetGas + coldSloadCost; + else + return sstoreSetGas; + } + /// Corresponds to SSTORE_RESET_GAS from EIP-2929 + /// For Berlin, the maximum is SSTORE_RESET_GAS + COLD_SLOAD_COST = 5000 + /// For previous versions, it's a fixed 5000 + inline unsigned totalSstoreResetGas(langutil::EVMVersion _evmVersion) + { + if (_evmVersion >= langutil::EVMVersion::berlin()) + return sstoreResetGas + coldSloadCost; + else + return 5000; + } + inline unsigned extCodeGas(langutil::EVMVersion _evmVersion) + { + if (_evmVersion >= langutil::EVMVersion::berlin()) + return coldAccountAccessCost; + else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle()) + return 700; + else + return 20; + } + inline unsigned balanceGas(langutil::EVMVersion _evmVersion) + { + if (_evmVersion >= langutil::EVMVersion::berlin()) + return coldAccountAccessCost; + else if (_evmVersion >= langutil::EVMVersion::istanbul()) + return 700; + else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle()) + return 400; + else + return 20; + } static unsigned const jumpdestGas = 1; static unsigned const logGas = 375; static unsigned const logDataGas = 8; @@ -86,14 +125,24 @@ namespace GasCosts static unsigned const createGas = 32000; inline unsigned callGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 700 : 40; + if (_evmVersion >= langutil::EVMVersion::berlin()) + return coldAccountAccessCost; + else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle()) + return 700; + else + return 40; } static unsigned const callStipend = 2300; static unsigned const callValueTransferGas = 9000; static unsigned const callNewAccountGas = 25000; inline unsigned selfdestructGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 5000 : 0; + if (_evmVersion >= langutil::EVMVersion::berlin()) + return coldAccountAccessCost; + else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle()) + return 5000; + else + return 0; } static unsigned const selfdestructRefundGas = 24000; static unsigned const memoryGas = 3; diff --git a/test/libsolidity/gasTests/storage_costs.sol b/test/libsolidity/gasTests/storage_costs.sol index f8db704e2..f7e076ea3 100644 --- a/test/libsolidity/gasTests/storage_costs.sol +++ b/test/libsolidity/gasTests/storage_costs.sol @@ -19,6 +19,6 @@ contract C { // executionCost: 81 // totalCost: 27081 // external: -// readX(): 990 +// readX(): 2290 // resetX(): 5116 -// setX(uint256): 20212 +// setX(uint256): 22312 From d5564a03045cae524b53acd3b74005c413b0e4e4 Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 13 Apr 2021 09:15:50 +0200 Subject: [PATCH 3/7] Set default EVM version to Berlin --- .circleci/soltest_all.sh | 8 +++++--- Changelog.md | 1 + docs/using-the-compiler.rst | 7 +++++-- liblangutil/EVMVersion.h | 2 +- scripts/tests.sh | 6 +++--- solc/CommandLineInterface.cpp | 5 +++-- test/externalTests/common.sh | 5 ++--- 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.circleci/soltest_all.sh b/.circleci/soltest_all.sh index c407ea627..a79228637 100755 --- a/.circleci/soltest_all.sh +++ b/.circleci/soltest_all.sh @@ -28,7 +28,9 @@ set -e REPODIR="$(realpath "$(dirname "$0")"/..)" -EVM_VALUES=(homestead byzantium constantinople petersburg istanbul) +EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin) +DEFAULT_EVM=berlin +[[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]] OPTIMIZE_VALUES=(0 1) STEPS=$(( 1 + ${#EVM_VALUES[@]} * ${#OPTIMIZE_VALUES[@]} )) @@ -45,7 +47,7 @@ STEP=1 # Run for ABI encoder v1, without SMTChecker tests. -[[ " $RUN_STEPS " == *" $STEP "* ]] && EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V1=1 BOOST_TEST_ARGS="-t !smtCheckerTests" "${REPODIR}/.circleci/soltest.sh" +[[ " $RUN_STEPS " == *" $STEP "* ]] && EVM="${DEFAULT_EVM}" OPTIMIZE=1 ABI_ENCODER_V1=1 BOOST_TEST_ARGS="-t !smtCheckerTests" "${REPODIR}/.circleci/soltest.sh" STEP=$((STEP + 1)) for OPTIMIZE in "${OPTIMIZE_VALUES[@]}" @@ -56,7 +58,7 @@ do EWASM_ARGS="" [ "${EVM}" = "byzantium" ] && [ "${OPTIMIZE}" = "0" ] && EWASM_ARGS="--ewasm" ENFORCE_GAS_ARGS="" - [ "${EVM}" = "istanbul" ] && ENFORCE_GAS_ARGS="--enforce-gas-cost" + [ "${EVM}" = "${DEFAULT_EVM}" ] && ENFORCE_GAS_ARGS="--enforce-gas-cost" # Run SMTChecker tests only when OPTIMIZE == 0 DISABLE_SMTCHECKER="" [ "${OPTIMIZE}" != "0" ] && DISABLE_SMTCHECKER="-t !smtCheckerTests" diff --git a/Changelog.md b/Changelog.md index cfea21e0b..38615f53d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ Language Features: Compiler Features: + * EVM: Set the default EVM version to "Berlin". * SMTChecker: Function definitions can be annotated with the custom Natspec tag ``custom:smtchecker abstract-function-nondet`` to be abstracted by a nondeterministic value when called. * Standard JSON / combined JSON: New artifact "functionDebugData" that contains bytecode offsets of entry points of functions and potentially more information in the future. * Yul Optimizer: Evaluate ``keccak256(a, c)``, when the value at memory location ``a`` is known at compile time and ``c`` is a constant ``<= 32``. diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst index 4e66b8f34..9cfc43641 100644 --- a/docs/using-the-compiler.rst +++ b/docs/using-the-compiler.rst @@ -158,9 +158,12 @@ at each version. Backward compatibility is not guaranteed between each version. - Shifting operators use shifting opcodes and thus need less gas. - ``petersburg`` - The compiler behaves the same way as with constantinople. -- ``istanbul`` (**default**) +- ``istanbul`` - Opcodes ``chainid`` and ``selfbalance`` are available in assembly. -- ``berlin`` (**experimental**) +- ``berlin`` (**default**) + - Gas costs for ``SLOAD``, ``*CALL``, ``BALANCE``, ``EXT*`` and ``SELFDESTRUCT`` increased. The + compiler assumes cold gas costs for such operations. This is relevant for gas estimation and + the optimizer. .. _compiler-api: diff --git a/liblangutil/EVMVersion.h b/liblangutil/EVMVersion.h index b34426c92..a3aeff3d0 100644 --- a/liblangutil/EVMVersion.h +++ b/liblangutil/EVMVersion.h @@ -99,7 +99,7 @@ private: EVMVersion(Version _version): m_version(_version) {} - Version m_version = Version::Istanbul; + Version m_version = Version::Berlin; }; } diff --git a/scripts/tests.sh b/scripts/tests.sh index 23879a497..d0c1da8f2 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -86,7 +86,7 @@ EVM_VERSIONS="homestead byzantium" if [ -z "$CI" ] then - EVM_VERSIONS+=" constantinople petersburg istanbul" + EVM_VERSIONS+=" constantinople petersburg istanbul berlin" fi # And then run the Solidity unit-tests in the matrix combination of optimizer / no optimizer @@ -96,9 +96,9 @@ do for vm in $EVM_VERSIONS do FORCE_ABIV1_RUNS="no" - if [[ "$vm" == "istanbul" ]] + if [[ "$vm" == "berlin" ]] then - FORCE_ABIV1_RUNS="no yes" # run both in istanbul + FORCE_ABIV1_RUNS="no yes" # run both in berlin fi for abiv1 in $FORCE_ABIV1_RUNS do diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 30a193403..40fd3649d 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -872,9 +873,9 @@ General Information)").c_str(), ) ( g_strEVMVersion.c_str(), - po::value()->value_name("version"), + po::value()->value_name("version")->default_value(EVMVersion{}.name()), "Select desired EVM version. Either homestead, tangerineWhistle, spuriousDragon, " - "byzantium, constantinople, petersburg, istanbul (default) or berlin." + "byzantium, constantinople, petersburg, istanbul or berlin." ) ( g_strExperimentalViaIR.c_str(), diff --git a/test/externalTests/common.sh b/test/externalTests/common.sh index 804d9a529..8b49ae6c8 100644 --- a/test/externalTests/common.sh +++ b/test/externalTests/common.sh @@ -173,7 +173,7 @@ function run_install replace_version_pragmas force_truffle_solc_modules "$soljson" - force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$OPTIMIZER_LEVEL" istanbul + force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$OPTIMIZER_LEVEL" berlin $init_fn } @@ -234,7 +234,7 @@ function truffle_run_test for level in $(seq "$OPTIMIZER_LEVEL" 3) do clean - force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$level" istanbul + force_truffle_compiler_settings "$CONFIG" "${DIR}/solc" "$level" berlin printLog "Running compile function..." $compile_fn @@ -267,4 +267,3 @@ function external_test rm -rf "$DIR" echo "Done." } - From 180e00f56d7cf0d5c68ad6d1caa87489006ac272 Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 13 Apr 2021 09:34:23 +0200 Subject: [PATCH 4/7] Updated tests after changing EVM version to Berlin --- .../SolidityExpressionCompiler.cpp | 2 +- test/libsolidity/StandardCompiler.cpp | 4 +- test/libsolidity/gasTests/abiv2.sol | 2 +- test/libsolidity/gasTests/abiv2_optimised.sol | 4 +- test/libsolidity/gasTests/dispatch_large.sol | 2 +- .../gasTests/dispatch_large_optimised.sol | 40 +++++++++---------- test/libsolidity/gasTests/dispatch_medium.sol | 2 +- .../gasTests/dispatch_medium_optimised.sol | 16 ++++---- test/libsolidity/gasTests/dispatch_small.sol | 2 +- .../gasTests/dispatch_small_optimised.sol | 6 +-- test/libsolidity/gasTests/storage_costs.sol | 4 +- 11 files changed, 43 insertions(+), 41 deletions(-) diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp index 8624e4878..2574cee9c 100644 --- a/test/libsolidity/SolidityExpressionCompiler.cpp +++ b/test/libsolidity/SolidityExpressionCompiler.cpp @@ -635,7 +635,7 @@ BOOST_AUTO_TEST_CASE(selfbalance) bytes code = compileFirstExpression(sourceCode, {}, {}); - if (solidity::test::CommonOptions::get().evmVersion() == EVMVersion::istanbul()) + if (solidity::test::CommonOptions::get().evmVersion().hasSelfBalance()) { bytes expectation({uint8_t(Instruction::SELFBALANCE)}); BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end()); diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index 9c3487283..cf21ebab6 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -1065,9 +1065,11 @@ BOOST_AUTO_TEST_CASE(evm_version) BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"petersburg\"") != string::npos); result = compile(inputForVersion("\"evmVersion\": \"istanbul\",")); BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"istanbul\"") != string::npos); + result = compile(inputForVersion("\"evmVersion\": \"berlin\",")); + BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"berlin\"") != string::npos); // test default result = compile(inputForVersion("")); - BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"istanbul\"") != string::npos); + BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"berlin\"") != string::npos); // test invalid result = compile(inputForVersion("\"evmVersion\": \"invalid\",")); BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested."); diff --git a/test/libsolidity/gasTests/abiv2.sol b/test/libsolidity/gasTests/abiv2.sol index 04feacc57..8d84e0a29 100644 --- a/test/libsolidity/gasTests/abiv2.sol +++ b/test/libsolidity/gasTests/abiv2.sol @@ -18,7 +18,7 @@ contract C { // executionCost: 1308 // totalCost: 1261108 // external: -// a(): 1130 +// a(): 2430 // b(uint256): infinite // f1(uint256): infinite // f2(uint256[],string[],uint16,address): infinite diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index 66a0bb64c..093acf49a 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -21,8 +21,8 @@ contract C { // executionCost: 715 // totalCost: 681315 // external: -// a(): 985 -// b(uint256): 2052 +// a(): 2285 +// b(uint256): 4652 // f1(uint256): 307 // f2(uint256[],string[],uint16,address): infinite // f3(uint16[],string[],uint16,address): infinite diff --git a/test/libsolidity/gasTests/dispatch_large.sol b/test/libsolidity/gasTests/dispatch_large.sol index 7b00816c7..60c91b483 100644 --- a/test/libsolidity/gasTests/dispatch_large.sol +++ b/test/libsolidity/gasTests/dispatch_large.sol @@ -28,7 +28,7 @@ contract Large { // executionCost: 942 // totalCost: 905342 // external: -// a(): 1175 +// a(): 2475 // b(uint256): infinite // f0(uint256): infinite // f1(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_large_optimised.sol b/test/libsolidity/gasTests/dispatch_large_optimised.sol index 8dca8e97a..80dccd59e 100644 --- a/test/libsolidity/gasTests/dispatch_large_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_large_optimised.sol @@ -31,25 +31,25 @@ contract Large { // executionCost: 300 // totalCost: 256700 // external: -// a(): 983 -// b(uint256): 2337 +// a(): 2283 +// b(uint256): 4937 // f0(uint256): 366 -// f1(uint256): 41506 -// f2(uint256): 21572 -// f3(uint256): 21660 -// f4(uint256): 21638 -// f5(uint256): 21616 -// f6(uint256): 21528 -// f7(uint256): 21308 -// f8(uint256): 21440 -// f9(uint256): 21462 +// f1(uint256): 47006 +// f2(uint256): 24972 +// f3(uint256): 25060 +// f4(uint256): 25038 +// f5(uint256): 25016 +// f6(uint256): 24928 +// f7(uint256): 24708 +// f8(uint256): 24840 +// f9(uint256): 24862 // g0(uint256): 606 -// g1(uint256): 41218 -// g2(uint256): 21306 -// g3(uint256): 21394 -// g4(uint256): 21372 -// g5(uint256): 21460 -// g6(uint256): 21240 -// g7(uint256): 21350 -// g8(uint256): 21328 -// g9(uint256): 21174 +// g1(uint256): 46718 +// g2(uint256): 24706 +// g3(uint256): 24794 +// g4(uint256): 24772 +// g5(uint256): 24860 +// g6(uint256): 24640 +// g7(uint256): 24750 +// g8(uint256): 24728 +// g9(uint256): 24574 diff --git a/test/libsolidity/gasTests/dispatch_medium.sol b/test/libsolidity/gasTests/dispatch_medium.sol index 502ddcfbb..ac88e828e 100644 --- a/test/libsolidity/gasTests/dispatch_medium.sol +++ b/test/libsolidity/gasTests/dispatch_medium.sol @@ -15,7 +15,7 @@ contract Medium { // executionCost: 386 // totalCost: 351786 // external: -// a(): 1152 +// a(): 2452 // b(uint256): infinite // f1(uint256): infinite // f2(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_medium_optimised.sol b/test/libsolidity/gasTests/dispatch_medium_optimised.sol index 078dba7dd..4aba3b204 100644 --- a/test/libsolidity/gasTests/dispatch_medium_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_medium_optimised.sol @@ -18,12 +18,12 @@ contract Medium { // executionCost: 190 // totalCost: 146990 // external: -// a(): 983 -// b(uint256): 2095 -// f1(uint256): 41286 -// f2(uint256): 21330 -// f3(uint256): 21374 +// a(): 2283 +// b(uint256): 4695 +// f1(uint256): 46786 +// f2(uint256): 24730 +// f3(uint256): 24774 // g0(uint256): 364 -// g7(uint256): 21240 -// g8(uint256): 21218 -// g9(uint256): 21174 +// g7(uint256): 24640 +// g8(uint256): 24618 +// g9(uint256): 24574 diff --git a/test/libsolidity/gasTests/dispatch_small.sol b/test/libsolidity/gasTests/dispatch_small.sol index 1e866910d..404766f79 100644 --- a/test/libsolidity/gasTests/dispatch_small.sol +++ b/test/libsolidity/gasTests/dispatch_small.sol @@ -11,6 +11,6 @@ contract Small { // totalCost: 114759 // external: // fallback: 129 -// a(): 1107 +// a(): 2407 // b(uint256): infinite // f1(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_small_optimised.sol b/test/libsolidity/gasTests/dispatch_small_optimised.sol index cdc0e2785..24a815a0d 100644 --- a/test/libsolidity/gasTests/dispatch_small_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_small_optimised.sol @@ -14,6 +14,6 @@ contract Small { // totalCost: 62111 // external: // fallback: 118 -// a(): 961 -// b(uint256): 1985 -// f1(uint256): 41220 +// a(): 2261 +// b(uint256): 4585 +// f1(uint256): 46720 diff --git a/test/libsolidity/gasTests/storage_costs.sol b/test/libsolidity/gasTests/storage_costs.sol index f7e076ea3..1e4995833 100644 --- a/test/libsolidity/gasTests/storage_costs.sol +++ b/test/libsolidity/gasTests/storage_costs.sol @@ -15,9 +15,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 27000 +// codeDepositCost: 27200 // executionCost: 81 -// totalCost: 27081 +// totalCost: 27281 // external: // readX(): 2290 // resetX(): 5116 From 4d6c9513960b3518b408ef8f8d5e6f652626ebc1 Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 18 May 2021 15:39:08 +0200 Subject: [PATCH 5/7] Isoltest gas update after Berlin gas cost changes --- .../abiEncoderV1/abi_decode_v2_storage.sol | 6 +-- .../abi_encode_calldata_slice.sol | 12 ++--- .../struct/struct_storage_ptr.sol | 6 +-- .../abi_encode_calldata_slice.sol | 12 ++--- .../abiEncoderV2/abi_encode_v2.sol | 6 +-- ...2_in_function_inherited_in_v1_contract.sol | 6 +-- ...ode_v2_in_modifier_used_in_v1_contract.sol | 4 +- .../abiEncoderV2/calldata_array.sol | 6 +-- .../abiEncoderV2/storage_array_encoding.sol | 12 ++--- .../abi_decode_simple_storage.sol | 6 +-- .../arithmetics/check_var_init.sol | 2 +- .../arrays_complex_from_and_to_storage.sol | 6 +-- .../array/byte_array_storage_layout.sol | 14 +++--- .../array/byte_array_transitional_2.sol | 6 +-- .../array/bytes_length_member.sol | 6 +-- .../copying/array_copy_calldata_storage.sol | 6 +-- .../copying/array_copy_cleanup_uint128.sol | 6 +-- .../copying/array_copy_cleanup_uint40.sol | 6 +-- .../copying/array_copy_clear_storage.sol | 6 +-- .../array_copy_clear_storage_packed.sol | 12 ++--- .../copying/array_copy_different_packing.sol | 6 +-- .../copying/array_copy_including_array.sol | 12 ++--- .../array/copying/array_copy_nested_array.sol | 6 +-- ...ay_copy_storage_storage_different_base.sol | 6 +-- ..._storage_storage_different_base_nested.sol | 8 ++-- .../array_copy_storage_storage_dyn_dyn.sol | 3 ++ ...y_copy_storage_storage_dynamic_dynamic.sol | 6 +-- ...ay_copy_storage_storage_static_dynamic.sol | 4 +- ...ray_copy_storage_storage_static_simple.sol | 6 +-- ...ray_copy_storage_storage_static_static.sol | 6 +-- .../array_copy_storage_storage_struct.sol | 6 +-- .../array_copy_storage_to_memory_nested.sol | 6 +-- .../copying/array_copy_target_leftover.sol | 8 ++-- .../copying/array_copy_target_leftover2.sol | 8 ++-- .../copying/array_copy_target_simple.sol | 8 ++-- .../copying/array_copy_target_simple_2.sol | 8 ++-- .../array_nested_calldata_to_storage.sol | 8 ++-- .../array_nested_memory_to_storage.sol | 12 ++--- .../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 | 6 +-- .../copying/arrays_from_and_to_storage.sol | 6 +-- .../array/copying/bytes_inside_mappings.sol | 12 ++--- .../copying/bytes_storage_to_storage.sol | 34 +++++++------- .../calldata_array_dynamic_to_storage.sol | 6 +-- .../copy_byte_array_in_struct_to_storage.sol | 10 +++-- .../copying/copy_byte_array_to_storage.sol | 6 +-- .../copying/copy_function_storage_array.sol | 6 +-- ...opy_internal_function_array_to_storage.sol | 4 +- .../array/copying/copy_removes_bytes_data.sol | 6 +-- .../memory_dyn_2d_bytes_to_storage.sol | 6 +-- .../array/copying/storage_memory_nested.sol | 6 +-- .../copying/storage_memory_nested_bytes.sol | 6 +-- .../storage_memory_nested_from_pointer.sol | 6 +-- .../copying/storage_memory_nested_struct.sol | 6 +-- .../copying/storage_memory_packed_dyn.sol | 6 +-- .../array/delete/bytes_delete_element.sol | 6 +-- .../delete/delete_storage_array_packed.sol | 2 +- .../array/dynamic_array_cleanup.sol | 6 +-- .../array/dynamic_arrays_in_storage.sol | 6 +-- .../array/dynamic_multi_array_cleanup.sol | 6 +-- .../array/fixed_array_cleanup.sol | 6 +-- .../array/fixed_arrays_as_return_type.sol | 6 +-- .../array/function_array_cross_calls.sol | 6 +-- .../array/pop/array_pop_array_transition.sol | 6 +-- .../array/pop/array_pop_uint16_transition.sol | 6 +-- .../array/pop/array_pop_uint24_transition.sol | 6 +-- .../array/pop/byte_array_pop_copy_long.sol | 6 +-- .../pop/byte_array_pop_long_storage_empty.sol | 6 +-- ...ray_pop_long_storage_empty_garbage_ref.sol | 6 +-- .../array/pop/byte_array_pop_masking_long.sol | 6 +-- .../semanticTests/array/push/array_push.sol | 6 +-- .../push/array_push_nested_from_calldata.sol | 6 +-- .../array/push/array_push_packed_array.sol | 6 +-- .../array/push/array_push_struct.sol | 6 +-- .../push/array_push_struct_from_calldata.sol | 6 +-- .../array/push/byte_array_push_transition.sol | 6 +-- .../array/push/nested_bytes_push.sol | 6 +-- .../array/push/push_no_args_2d.sol | 12 ++--- .../array/push/push_no_args_bytes.sol | 6 +-- .../semanticTests/array/reusing_memory.sol | 6 +-- .../constructor/arrays_in_constructors.sol | 6 +-- .../bytes_in_constructors_packer.sol | 6 +-- .../constructor_function_complex.sol | 2 +- .../externalContracts/deposit_contract.sol | 30 ++++++------- .../semanticTests/externalContracts/snark.sol | 6 +-- .../freeFunctions/new_operator.sol | 2 +- .../creation_function_call_no_args.sol | 2 +- .../functionCall/failed_create.sol | 10 ++--- .../mapping_array_internal_argument.sol | 6 +-- .../functionTypes/store_function.sol | 6 +-- .../immutable/multi_creation.sol | 6 +-- .../address_overload_resolution.sol | 8 ++-- ...d_function_calldata_calldata_interface.sol | 4 +- ...ted_function_calldata_memory_interface.sol | 6 +-- .../inheritance/member_notation_ctor.sol | 4 +- .../interface_inheritance_conversions.sol | 10 ++--- .../salted_create_with_value.sol | 6 +-- .../semanticTests/smoke/alignment.sol | 2 +- .../storage/packed_storage_structs_bytes.sol | 6 +-- ...ta_struct_with_nested_array_to_storage.sol | 6 +-- .../conversion/recursive_storage_memory.sol | 4 +- .../structs/memory_structs_nested_load.sol | 6 +-- ...truct_containing_bytes_copy_and_delete.sol | 6 +-- .../semanticTests/structs/struct_copy.sol | 12 ++--- .../structs/struct_copy_via_local.sol | 6 +-- .../struct_delete_storage_nested_small.sol | 2 +- .../struct_delete_storage_with_array.sol | 6 +-- ...truct_delete_storage_with_arrays_small.sol | 2 +- .../struct_memory_to_storage_function_ptr.sol | 8 ++-- .../semanticTests/structs/structs.sol | 6 +-- .../various/code_access_content.sol | 4 +- .../various/code_access_create.sol | 2 +- .../various/code_access_runtime.sol | 2 +- .../various/destructuring_assignment.sol | 6 +-- .../various/external_types_in_calls.sol | 2 +- .../skip_dynamic_types_for_structs.sol | 6 +-- .../various/staticcall_for_view_and_pure.sol | 14 +++--- .../various/swap_in_storage_overwrite.sol | 6 +-- .../viaYul/array_storage_index_access.sol | 44 +++++++++---------- .../array_storage_index_boundary_test.sol | 12 ++--- .../array_storage_index_zeroed_test.sol | 24 +++++----- .../viaYul/array_storage_length_access.sol | 12 ++--- .../viaYul/array_storage_push_empty.sol | 15 ++++--- ...rray_storage_push_empty_length_address.sol | 22 +++++----- .../viaYul/array_storage_push_pop.sol | 18 ++++---- 128 files changed, 480 insertions(+), 466 deletions(-) diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol index 121b934af..8fb1e41c0 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol @@ -24,6 +24,6 @@ contract C { // compileViaYul: also // ---- // f() -> 0x20, 0x8, 0x40, 0x3, 0x9, 0xa, 0xb -// gas irOptimized: 193521 -// gas legacy: 196426 -// gas legacyOptimized: 193405 +// gas irOptimized: 203921 +// gas legacy: 206126 +// gas legacyOptimized: 203105 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol index a3c28f339..b4d533ce0 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol @@ -60,10 +60,10 @@ contract C { // compileViaYul: also // ---- // test_bytes() -> -// gas irOptimized: 508617 -// gas legacy: 466763 -// gas legacyOptimized: 374591 +// gas irOptimized: 465417 +// gas legacy: 423563 +// gas legacyOptimized: 331391 // test_uint256() -> -// gas irOptimized: 704259 -// gas legacy: 634592 -// gas legacyOptimized: 499337 +// gas irOptimized: 661059 +// gas legacy: 591392 +// gas legacyOptimized: 456137 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol index 1291cc08c..6dfcb1cde 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol @@ -26,6 +26,6 @@ contract C { // ---- // library: L // f() -> 8, 7, 1, 2, 7, 12 -// gas irOptimized: 164899 -// gas legacy: 164775 -// gas legacyOptimized: 162697 +// gas irOptimized: 168199 +// gas legacy: 169475 +// gas legacyOptimized: 167397 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol index f28d3bac5..d5687aac7 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol @@ -61,10 +61,10 @@ contract C { // compileViaYul: also // ---- // test_bytes() -> -// gas irOptimized: 508617 -// gas legacy: 466763 -// gas legacyOptimized: 374591 +// gas irOptimized: 465417 +// gas legacy: 423563 +// gas legacyOptimized: 331391 // test_uint256() -> -// gas irOptimized: 704259 -// gas legacy: 634592 -// gas legacyOptimized: 499337 +// gas irOptimized: 661059 +// gas legacy: 591392 +// gas legacyOptimized: 456137 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol index b84bdbd48..6e21e0174 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol @@ -53,6 +53,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: 110283 -// gas legacy: 111328 -// gas legacyOptimized: 109206 +// gas irOptimized: 113683 +// gas legacy: 114728 +// gas legacyOptimized: 112606 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 82f04c0a7..2e9e6af40 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 @@ -32,6 +32,6 @@ contract C is B { // compileViaYul: also // ---- // test() -> 77 -// gas irOptimized: 133635 -// gas legacy: 156449 -// gas legacyOptimized: 112943 +// gas irOptimized: 132435 +// gas legacy: 155249 +// gas legacyOptimized: 111743 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol index 09b9b3afa..6c5d1df29 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol @@ -40,5 +40,5 @@ contract C is B { // compileViaYul: also // ---- // test() -> 5, 10 -// gas irOptimized: 92624 -// gas legacy: 100237 +// gas irOptimized: 91524 +// gas legacy: 99137 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol index c0ffd872e..a426c9661 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol @@ -21,6 +21,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: 227075 -// gas legacy: 144300 -// gas legacyOptimized: 124188 +// gas irOptimized: 224675 +// gas legacy: 141900 +// gas legacyOptimized: 121788 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol b/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol index 1481743e2..3196a29e4 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol @@ -19,10 +19,10 @@ contract C { // compileViaYul: also // ---- // h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324 -// gas irOptimized: 172410 -// gas legacy: 175929 -// gas legacyOptimized: 172504 +// gas irOptimized: 181410 +// gas legacy: 184929 +// gas legacyOptimized: 181504 // i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224 -// gas irOptimized: 107381 -// gas legacy: 109868 -// gas legacyOptimized: 107388 +// gas irOptimized: 112981 +// gas legacy: 115468 +// gas legacyOptimized: 112988 diff --git a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol index d2cc3a82e..a26d7bf08 100644 --- a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol +++ b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol @@ -11,6 +11,6 @@ contract C { // compileViaYul: also // ---- // f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg" -// gas irOptimized: 130031 -// gas legacy: 131690 -// gas legacyOptimized: 130582 +// gas irOptimized: 136231 +// gas legacy: 137190 +// gas legacyOptimized: 136082 diff --git a/test/libsolidity/semanticTests/arithmetics/check_var_init.sol b/test/libsolidity/semanticTests/arithmetics/check_var_init.sol index 4587cc71a..f8e4ca2a4 100644 --- a/test/libsolidity/semanticTests/arithmetics/check_var_init.sol +++ b/test/libsolidity/semanticTests/arithmetics/check_var_init.sol @@ -18,4 +18,4 @@ contract D { // ---- // f() -> FAILURE, hex"4e487b71", 0x11 // g(), 100 wei -> 1 -// gas legacy: 101718 +// gas legacy: 101918 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 1b81915c6..a95183c30 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 @@ -14,9 +14,9 @@ contract Test { // compileViaYul: also // ---- // 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: 199693 -// gas legacy: 278685 -// gas legacyOptimized: 273594 +// gas irOptimized: 191293 +// gas legacy: 211485 +// gas legacyOptimized: 206394 // data(uint256,uint256): 0x02, 0x02 -> 0x09 // data(uint256,uint256): 0x05, 0x01 -> 0x11 // data(uint256,uint256): 0x06, 0x00 -> FAILURE diff --git a/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol b/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol index 43c693e8b..b1b3a7bf4 100644 --- a/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol +++ b/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol @@ -43,15 +43,15 @@ contract c { // ---- // storageEmpty -> 1 // test_short() -> 1780731860627700044960722568376587075150542249149356309979516913770823710 -// gas legacy: 110938 -// gas legacyOptimized: 109706 +// gas legacy: 59838 +// gas legacyOptimized: 58606 // storageEmpty -> 0 // test_long() -> 67 -// gas irOptimized: 134320 -// gas legacy: 213590 -// gas legacyOptimized: 211044 +// gas irOptimized: 91520 +// gas legacy: 103590 +// gas legacyOptimized: 101044 // storageEmpty -> 0 // test_pop() -> 1780731860627700044960722568376592200742329637303199754547598369979433020 -// gas legacy: 176030 -// gas legacyOptimized: 173504 +// gas legacy: 61930 +// gas legacyOptimized: 59404 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol index d8899aefc..1f8e202e3 100644 --- a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol +++ b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol @@ -19,6 +19,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0 -// gas irOptimized: 309167 -// gas legacy: 483915 -// gas legacyOptimized: 478672 +// gas irOptimized: 171767 +// gas legacy: 189715 +// gas legacyOptimized: 184472 diff --git a/test/libsolidity/semanticTests/array/bytes_length_member.sol b/test/libsolidity/semanticTests/array/bytes_length_member.sol index 498d32632..0da89b36e 100644 --- a/test/libsolidity/semanticTests/array/bytes_length_member.sol +++ b/test/libsolidity/semanticTests/array/bytes_length_member.sol @@ -15,7 +15,7 @@ contract c { // ---- // getLength() -> 0 // set(): 1, 2 -> true -// gas irOptimized: 102970 -// gas legacy: 103126 -// gas legacyOptimized: 102967 +// gas irOptimized: 110570 +// gas legacy: 110726 +// gas legacyOptimized: 110567 // getLength() -> 68 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 4ce4d0406..c7fb030aa 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol @@ -22,7 +22,7 @@ contract c { // compileViaYul: also // ---- // 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: 612216 -// gas legacy: 817315 -// gas legacyOptimized: 816813 +// gas irOptimized: 651816 +// gas legacy: 694515 +// gas legacyOptimized: 694013 // retrieve() -> 9, 28, 9, 28, 4, 3, 32 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol index 41b801f23..b9d5ccd96 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol @@ -23,6 +23,6 @@ contract C { // compileViaYul: also // ---- // f() -> true -// gas irOptimized: 107258 -// gas legacy: 107335 -// gas legacyOptimized: 105857 +// gas irOptimized: 92958 +// gas legacy: 93035 +// gas legacyOptimized: 92257 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 83459475b..dddd14840 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol @@ -48,6 +48,6 @@ contract C { // compileViaYul: also // ---- // f() -> true -// gas irOptimized: 231941 -// gas legacy: 239061 -// gas legacyOptimized: 235988 +// gas irOptimized: 154441 +// gas legacy: 155961 +// gas legacyOptimized: 153588 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 1bbf5f41b..fea48ca61 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol @@ -15,6 +15,6 @@ contract C { // compileViaYul: also // ---- // f() -> 0 -// gas irOptimized: 139105 -// gas legacy: 138913 -// gas legacyOptimized: 137448 +// gas irOptimized: 135505 +// gas legacy: 135313 +// gas legacyOptimized: 134548 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol index fbbc1d106..55b3d39ba 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol @@ -42,11 +42,11 @@ contract C { // compileViaYul: also // ---- // f() -> 0 -// gas irOptimized: 107266 -// gas legacy: 107306 -// gas legacyOptimized: 105861 +// gas irOptimized: 92966 +// gas legacy: 93006 +// gas legacyOptimized: 92261 // g() -> 0 // h() -> 0 -// gas irOptimized: 107312 -// gas legacy: 107328 -// gas legacyOptimized: 105903 +// gas irOptimized: 93012 +// gas legacy: 93028 +// gas legacyOptimized: 92303 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 8aa33533c..9542662ed 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol @@ -21,6 +21,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000 -// gas irOptimized: 245944 -// gas legacy: 276683 -// gas legacyOptimized: 275534 +// gas irOptimized: 214644 +// gas legacy: 221883 +// gas legacyOptimized: 220734 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 a24c0fd1b..a77aaedd6 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol @@ -37,12 +37,12 @@ contract c { // compileViaYul: also // ---- // test() -> 0x02000202 -// gas irOptimized: 2476392 -// gas legacy: 2288641 -// gas legacyOptimized: 2258654 +// gas irOptimized: 4690992 +// gas legacy: 4578341 +// gas legacyOptimized: 4548354 // storageEmpty -> 1 // clear() -> 0, 0 -// gas irOptimized: 1852821 -// gas legacy: 1727169 -// gas legacyOptimized: 1698931 +// gas irOptimized: 4516821 +// gas legacy: 4410769 +// gas legacyOptimized: 4382531 // 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 ce3537056..f6c53a9f8 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol @@ -15,6 +15,6 @@ contract c { // compileViaYul: also // ---- // test(uint256[2][]): 32, 3, 7, 8, 9, 10, 11, 12 -> 10 -// gas irOptimized: 610177 -// gas legacy: 604268 -// gas legacyOptimized: 603688 +// gas irOptimized: 691977 +// gas legacy: 686268 +// gas legacyOptimized: 685688 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 28efcc6e2..e67fe2411 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 @@ -19,6 +19,6 @@ contract c { // compileViaYul: also // ---- // test() -> 5, 4 -// gas irOptimized: 234667 -// gas legacy: 237001 -// gas legacyOptimized: 235316 +// gas irOptimized: 226467 +// gas legacy: 233801 +// gas legacyOptimized: 232816 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 bbca42382..a0a1844ff 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 @@ -20,10 +20,10 @@ contract c { } } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // test() -> 3, 4 -// gas irOptimized: 191158 -// gas legacy: 208853 -// gas legacyOptimized: 200341 +// gas irOptimized: 191858 +// gas legacy: 195353 +// gas legacyOptimized: 192441 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 5856e93fc..e9ad1e78f 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 @@ -17,6 +17,9 @@ contract c { // ---- // setData1(uint256,uint256,uint256): 10, 5, 4 -> // copyStorageStorage() -> +// gas irOptimized: 111563 +// gas legacy: 109278 +// gas legacyOptimized: 109268 // getData2(uint256): 5 -> 10, 4 // setData1(uint256,uint256,uint256): 0, 0, 0 -> // copyStorageStorage() -> 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 7053988fa..47d682bf0 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 @@ -20,6 +20,6 @@ contract c { // compileViaYul: also // ---- // test() -> 5, 4 -// gas irOptimized: 264686 -// gas legacy: 264734 -// gas legacyOptimized: 263160 +// gas irOptimized: 272786 +// gas legacy: 270834 +// gas legacyOptimized: 269960 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 3c7bfc618..72ac4201e 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 @@ -14,4 +14,6 @@ contract c { // compileViaYul: also // ---- // test() -> 9, 4 -// gas irOptimized: 99075 +// gas irOptimized: 123375 +// gas legacy: 123579 +// gas legacyOptimized: 123208 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol index e6c8e4dcd..a7dacd749 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol @@ -10,9 +10,9 @@ contract C { } } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // test() -> left(0x01), left(0x02) -// gas legacy: 154001 -// gas legacyOptimized: 152385 +// gas legacy: 90001 +// gas legacyOptimized: 89085 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 fe8632469..06296e358 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 @@ -18,6 +18,6 @@ contract c { // compileViaYul: also // ---- // test() -> 8, 0 -// gas irOptimized: 154656 -// gas legacy: 153995 -// gas legacyOptimized: 153403 +// gas irOptimized: 236656 +// gas legacy: 234695 +// gas legacyOptimized: 234103 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 9b5616994..fd5c398a1 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 @@ -19,7 +19,7 @@ contract c { // compileViaYul: also // ---- // test() -> 4, 5 -// gas irOptimized: 257752 -// gas legacy: 255936 -// gas legacyOptimized: 254359 +// gas irOptimized: 240552 +// gas legacy: 238736 +// gas legacyOptimized: 237159 // 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 5a0c10696..fcfc9ffc7 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 @@ -17,6 +17,6 @@ contract C { // compileViaYul: also // ---- // f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3 -// gas irOptimized: 166791 -// gas legacy: 163978 -// gas legacyOptimized: 158155 +// gas irOptimized: 161991 +// gas legacy: 162278 +// gas legacyOptimized: 159955 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 0dc4b77f5..311a74992 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol @@ -16,10 +16,10 @@ contract c { } } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 218618 -// gas legacy: 328106 -// gas legacyOptimized: 307826 +// gas irOptimized: 140618 +// gas legacy: 186406 +// gas legacyOptimized: 166126 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol index 0d2a63805..802b9a198 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol @@ -18,10 +18,10 @@ contract c { } } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // test() -> 0x04000000000000000000000000000000000000000000000000, 0x0, 0x0 -// gas irOptimized: 107728 -// gas legacy: 116651 -// gas legacyOptimized: 107000 +// gas irOptimized: 95528 +// gas legacy: 97451 +// gas legacyOptimized: 94200 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 78549b575..204981aa4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol @@ -18,10 +18,10 @@ contract c { } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0 -// gas irOptimized: 288892 -// gas legacy: 309353 -// gas legacyOptimized: 307699 +// gas irOptimized: 296092 +// gas legacy: 303653 +// gas legacyOptimized: 301999 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 e83fbb773..61480065f 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,10 +18,10 @@ contract c { } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00 -// gas irOptimized: 263885 -// gas legacy: 269681 -// gas legacyOptimized: 268753 +// gas irOptimized: 274785 +// gas legacy: 276381 +// gas legacyOptimized: 275453 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 acf55aba2..55922af9a 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: 179148 +// gas irOptimized: 182348 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 153938 +// gas irOptimized: 158638 // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 -// gas irOptimized: 132378 +// gas irOptimized: 135778 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 -// gas irOptimized: 105395 +// gas irOptimized: 111695 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 ab68d90d5..4b7ce0928 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 @@ -40,12 +40,12 @@ contract Test { // compileViaYul: also // ---- // test() -> 24 -// gas irOptimized: 216291 -// gas legacy: 215533 -// gas legacyOptimized: 214947 +// gas irOptimized: 227891 +// gas legacy: 227133 +// gas legacyOptimized: 226547 // test1() -> 3 // test2() -> 6 // test3() -> 24 -// gas irOptimized: 122838 -// gas legacy: 122795 -// gas legacyOptimized: 121883 +// gas irOptimized: 134338 +// gas legacy: 134295 +// gas legacyOptimized: 133383 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 e553c01c2..296789bdf 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: 122861 +// gas irOptimized: 121461 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 75536e681..f268484fd 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: 121857 +// gas irOptimized: 120457 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 7c756ac18..16f9aa7ba 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: 352878 +// gas irOptimized: 332878 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 915b91c05..98a48270b 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: 187277 +// gas irOptimized: 185077 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 fa35f6437..215ac9625 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 @@ -15,6 +15,6 @@ contract C { // compileViaYul: also // ---- // f() -> 1, 2, 3 -// gas irOptimized: 133471 -// gas legacy: 134419 -// gas legacyOptimized: 125440 +// gas irOptimized: 133671 +// gas legacy: 134619 +// gas legacyOptimized: 131940 diff --git a/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol index e20fa1097..c2f7faa4f 100644 --- a/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol @@ -12,9 +12,9 @@ contract Test { // compileViaYul: also // ---- // set(uint24[]): 0x20, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -> 18 -// gas irOptimized: 120859 -// gas legacy: 125815 -// gas legacyOptimized: 123614 +// gas irOptimized: 101659 +// gas legacy: 103815 +// gas legacyOptimized: 101614 // data(uint256): 7 -> 8 // data(uint256): 15 -> 16 // data(uint256): 18 -> FAILURE diff --git a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol index 08853d12e..254a16f31 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol @@ -7,13 +7,13 @@ contract c { // compileViaYul: also // ---- // set(uint256): 1, 2 -> true -// gas irOptimized: 103224 -// gas legacy: 103491 -// gas legacyOptimized: 103136 +// gas irOptimized: 110824 +// gas legacy: 111091 +// gas legacyOptimized: 110736 // set(uint256): 2, 2, 3, 4, 5 -> true -// gas irOptimized: 163911 -// gas legacy: 164121 -// gas legacyOptimized: 163766 +// gas irOptimized: 177811 +// gas legacy: 178021 +// gas legacyOptimized: 177666 // 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 0c65687e0..f449e3bf6 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol @@ -19,25 +19,25 @@ contract c { // ---- // f(uint256): 0 -> 0x20, 0x00 // f(uint256): 31 -> 0x20, 0x1f, 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00 -// gas irOptimized: 221696 -// gas legacy: 255464 -// gas legacyOptimized: 250998 +// gas irOptimized: 135396 +// gas legacy: 124364 +// gas legacyOptimized: 119898 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 229291 -// gas legacy: 267931 -// gas legacyOptimized: 263329 +// gas irOptimized: 142291 +// gas legacy: 135431 +// gas legacyOptimized: 130829 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 238003 -// gas legacy: 277538 -// gas legacyOptimized: 272818 +// gas irOptimized: 149603 +// gas legacy: 142238 +// gas legacyOptimized: 137518 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 348673 -// gas legacy: 423428 -// gas legacyOptimized: 414868 +// gas irOptimized: 174873 +// gas legacy: 160728 +// gas legacyOptimized: 152168 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 -// gas legacy: 106445 -// gas legacyOptimized: 104379 +// gas legacy: 59345 +// gas legacyOptimized: 57279 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 802315 -// gas legacy: 954517 -// gas legacyOptimized: 937521 +// gas irOptimized: 452115 +// gas legacy: 423017 +// gas legacyOptimized: 406021 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 fa94e781f..58e1b4d57 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 @@ -11,6 +11,6 @@ contract C { // compileViaYul: also // ---- // f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1 -// gas irOptimized: 105184 -// gas legacy: 105365 -// gas legacyOptimized: 105147 +// gas irOptimized: 111384 +// gas legacy: 111565 +// gas legacyOptimized: 111347 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 714dbd859..4adf028b1 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 @@ -37,10 +37,12 @@ contract C { // compileViaYul: also // ---- // f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000 -// gas irOptimized: 172274 -// gas legacy: 174794 -// gas legacyOptimized: 174188 +// gas irOptimized: 180274 +// gas legacy: 180694 +// gas legacyOptimized: 180088 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas legacy: 100595 +// gas irOptimized: 107618 +// gas legacy: 107895 +// gas legacyOptimized: 107254 // 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 1ad608065..8b7282243 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 @@ -48,6 +48,6 @@ contract C { // compileViaYul: also // ---- // f() -> 0xff -// gas irOptimized: 132909 -// gas legacy: 137645 -// gas legacyOptimized: 134376 +// gas irOptimized: 122009 +// gas legacy: 126745 +// gas legacyOptimized: 123476 diff --git a/test/libsolidity/semanticTests/array/copying/copy_function_storage_array.sol b/test/libsolidity/semanticTests/array/copying/copy_function_storage_array.sol index 430d48fda..f10a49fdb 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_function_storage_array.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_function_storage_array.sol @@ -18,6 +18,6 @@ contract C { // compileViaYul: also // ---- // test() -> 7 -// gas irOptimized: 133946 -// gas legacy: 211296 -// gas legacyOptimized: 211087 +// gas irOptimized: 127846 +// gas legacy: 205196 +// gas legacyOptimized: 204987 diff --git a/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol index 83140f3d4..d2c7bb77d 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol @@ -22,6 +22,6 @@ contract C { // compileViaYul: also // ---- // one() -> 3 -// gas legacy: 154760 -// gas legacyOptimized: 154597 +// gas legacy: 140260 +// gas legacyOptimized: 140097 // two() -> FAILURE, hex"4e487b71", 0x51 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 423398797..7e85e2323 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol @@ -9,9 +9,9 @@ contract c { // compileViaYul: also // ---- // set(): 1, 2, 3, 4, 5 -> true -// gas irOptimized: 163657 -// gas legacy: 163756 -// gas legacyOptimized: 163596 +// gas irOptimized: 177557 +// gas legacy: 177656 +// gas legacyOptimized: 177496 // storageEmpty -> 0 // reset() -> true // storageEmpty -> 1 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 ef85da1b1..52141bd48 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 @@ -20,6 +20,6 @@ contract C { // compileViaYul: also // ---- // f() -> 3 -// gas irOptimized: 173108 -// gas legacy: 179707 -// gas legacyOptimized: 178763 +// gas irOptimized: 134208 +// gas legacy: 130307 +// gas legacyOptimized: 129363 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol index 14ad10b79..2e58d2d26 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol @@ -19,6 +19,6 @@ contract C { // compileViaYul: also // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 212108 -// gas legacy: 223725 -// gas legacyOptimized: 222886 +// gas irOptimized: 209108 +// gas legacy: 212325 +// gas legacyOptimized: 211486 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 19b3fad38..868e8646c 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol @@ -13,6 +13,6 @@ contract C { // compileViaYul: also // ---- // f() -> 0x20, 0x02, 0x40, 0x80, 3, 0x6162630000000000000000000000000000000000000000000000000000000000, 0x99, 44048183304486788312148433451363384677562265908331949128489393215789685032262, 32241931068525137014058842823026578386641954854143559838526554899205067598957, 49951309422467613961193228765530489307475214998374779756599339590522149884499, 0x54555658595a6162636465666768696a6b6c6d6e6f707172737475767778797a, 0x4142434445464748494a4b4c4d4e4f5051525354555658595a00000000000000 -// gas irOptimized: 197063 -// gas legacy: 199159 -// gas legacyOptimized: 198137 +// gas irOptimized: 203063 +// gas legacy: 204459 +// gas legacyOptimized: 203437 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 a6c41a277..a3530af69 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 @@ -20,6 +20,6 @@ contract C { // compileViaYul: also // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 212108 -// gas legacy: 223730 -// gas legacyOptimized: 222891 +// gas irOptimized: 209108 +// gas legacy: 212330 +// gas legacyOptimized: 211491 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 dd2b9fa66..b32332846 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol @@ -26,6 +26,6 @@ contract C { // compileViaYul: also // ---- // f() -> 11, 0x0c, 1, 0x15, 22, 4 -// gas irOptimized: 288695 -// gas legacy: 296916 -// gas legacyOptimized: 283163 +// gas irOptimized: 293695 +// gas legacy: 293516 +// gas legacyOptimized: 290263 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 c2dd880db..e75a92e73 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol @@ -15,6 +15,6 @@ contract C { // compileViaYul: also // ---- // f() -> 2, 3, 4 -// gas irOptimized: 208083 -// gas legacy: 241549 -// gas legacyOptimized: 236002 +// gas irOptimized: 115383 +// gas legacy: 126449 +// gas legacyOptimized: 120902 diff --git a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol index 72934fd95..d4ce9120c 100644 --- a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol +++ b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol @@ -18,6 +18,6 @@ contract c { // compileViaYul: also // ---- // test1() -> true -// gas irOptimized: 527479 -// gas legacy: 613377 -// gas legacyOptimized: 606411 +// gas irOptimized: 244579 +// gas legacy: 255577 +// gas legacyOptimized: 248611 diff --git a/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol b/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol index 96bc13051..92c0fb40b 100644 --- a/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol +++ b/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol @@ -16,4 +16,4 @@ contract C { // compileViaYul: also // ---- // f() -> 0, 0, 0 -// gas irOptimized: 101279 +// gas irOptimized: 91179 diff --git a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol index 70864edbb..3259c72a4 100644 --- a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol @@ -16,9 +16,9 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 535098 -// gas legacy: 504373 -// gas legacyOptimized: 499648 +// gas irOptimized: 520998 +// gas legacy: 521773 +// gas legacyOptimized: 517048 // storageEmpty -> 0 // halfClear() -> // 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 9f23c9fae..300616ecf 100644 --- a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol +++ b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol @@ -44,9 +44,9 @@ contract c { // ---- // getLengths() -> 0, 0 // setLengths(uint256,uint256): 48, 49 -> -// gas irOptimized: 273726 -// gas legacy: 308271 -// gas legacyOptimized: 300117 +// gas irOptimized: 108326 +// gas legacy: 108571 +// gas legacyOptimized: 100417 // getLengths() -> 48, 49 // setIDStatic(uint256): 11 -> // getID(uint256): 2 -> 11 diff --git a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol index da759c7b1..6bceda899 100644 --- a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol @@ -18,9 +18,9 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> 8 -// gas irOptimized: 168980 -// gas legacy: 165456 -// gas legacyOptimized: 164387 +// gas irOptimized: 124480 +// gas legacy: 121756 +// gas legacyOptimized: 120687 // storageEmpty -> 0 // clear() -> // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol index 5ba2ceab6..0147ac446 100644 --- a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol @@ -13,9 +13,9 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 423878 -// gas legacy: 429460 -// gas legacyOptimized: 425520 +// gas irOptimized: 465878 +// gas legacy: 471460 +// gas legacyOptimized: 467520 // storageEmpty -> 0 // clear() -> // storageEmpty -> 1 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 3dcef2c42..9493d0bbd 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -21,6 +21,6 @@ contract B { // compileViaYul: also // ---- // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 -// gas irOptimized: 135883 -// gas legacy: 266210 -// gas legacyOptimized: 135699 +// gas irOptimized: 133483 +// gas legacy: 263810 +// gas legacyOptimized: 133299 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index bd01bb886..8b2da5598 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -45,6 +45,6 @@ contract C { // compileViaYul: also // ---- // test() -> 5, 6, 7 -// gas irOptimized: 345955 -// gas legacy: 508437 -// gas legacyOptimized: 309013 +// gas irOptimized: 337455 +// gas legacy: 499937 +// gas legacyOptimized: 300513 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 7bbd86839..b8f1ebaee 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol @@ -25,7 +25,7 @@ contract c { // compileViaYul: also // ---- // test() -> 1, 2, 3 -// gas irOptimized: 2455497 -// gas legacy: 2416722 -// gas legacyOptimized: 2405396 +// gas irOptimized: 2280897 +// gas legacy: 2273722 +// gas legacyOptimized: 2262396 // 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 5004ad13a..3dbb0e0b6 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol @@ -20,7 +20,7 @@ contract c { // compileViaYul: also // ---- // test() -> 38, 28, 18 -// gas irOptimized: 527367 -// gas legacy: 454080 -// gas legacyOptimized: 443170 +// gas irOptimized: 195867 +// gas legacy: 189780 +// gas legacyOptimized: 178870 // 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 aaf96d210..e40577929 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol @@ -20,7 +20,7 @@ contract c { // compileViaYul: also // ---- // test() -> 20, 10 -// gas irOptimized: 367121 -// gas legacy: 320859 -// gas legacyOptimized: 314681 +// gas irOptimized: 163721 +// gas legacy: 159459 +// gas legacyOptimized: 153281 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol index 5e9c9d60d..7923cf34b 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol @@ -12,6 +12,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0x20, 29, 0x0303030303030303030303030303030303030303030303030303030303000000 -// gas irOptimized: 162426 -// gas legacy: 245809 -// gas legacyOptimized: 242636 +// gas irOptimized: 112526 +// gas legacy: 127309 +// gas legacyOptimized: 124136 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 1c1323fdc..2fdd7ebf7 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 @@ -18,7 +18,7 @@ contract c { // compileViaYul: also // ---- // test() -> true -// gas irOptimized: 445718 -// gas legacy: 552064 -// gas legacyOptimized: 533164 +// gas irOptimized: 219418 +// gas legacy: 229864 +// gas legacyOptimized: 210964 // 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 ee65fd911..c3cb9a227 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 @@ -17,7 +17,7 @@ contract c { // compileViaYul: also // ---- // test() -> -// gas irOptimized: 291114 -// gas legacy: 372763 -// gas legacyOptimized: 366846 +// gas irOptimized: 150914 +// gas legacy: 165363 +// gas legacyOptimized: 159446 // 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 b11950fd6..0a361e81d 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 @@ -12,6 +12,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 159714 -// gas legacy: 243287 -// gas legacyOptimized: 240361 +// gas irOptimized: 110514 +// gas legacy: 126187 +// gas legacyOptimized: 123261 diff --git a/test/libsolidity/semanticTests/array/push/array_push.sol b/test/libsolidity/semanticTests/array/push/array_push.sol index a2733ece1..33f923081 100644 --- a/test/libsolidity/semanticTests/array/push/array_push.sol +++ b/test/libsolidity/semanticTests/array/push/array_push.sol @@ -18,6 +18,6 @@ contract c { // compileViaYul: also // ---- // test() -> 5, 4, 3, 3 -// gas irOptimized: 110669 -// gas legacy: 111938 -// gas legacyOptimized: 110528 +// gas irOptimized: 111269 +// gas legacy: 111838 +// gas legacyOptimized: 111128 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 db2ef2a55..72c69233a 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 @@ -14,6 +14,6 @@ contract C { // compileViaYul: also // ---- // f(uint120[]): 0x20, 3, 1, 2, 3 -> 1 -// gas irOptimized: 116184 -// gas legacy: 116886 -// gas legacyOptimized: 116699 +// gas irOptimized: 113684 +// gas legacy: 113686 +// gas legacyOptimized: 113499 diff --git a/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol b/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol index 5565eb34b..5168297ce 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol @@ -16,6 +16,6 @@ contract c { // compileViaYul: also // ---- // test() -> 1, 2, 3, 4 -// gas irOptimized: 111583 -// gas legacy: 107098 -// gas legacyOptimized: 106362 +// gas irOptimized: 93083 +// gas legacy: 92798 +// gas legacyOptimized: 92062 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct.sol b/test/libsolidity/semanticTests/array/push/array_push_struct.sol index a1bed199e..a9088e703 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct.sol @@ -22,6 +22,6 @@ contract c { // compileViaYul: also // ---- // test() -> 2, 3, 4, 5 -// gas irOptimized: 146270 -// gas legacy: 190684 -// gas legacyOptimized: 188256 +// gas irOptimized: 138070 +// gas legacy: 147484 +// gas legacyOptimized: 146456 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 cc21b18b0..1007bf491 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 @@ -18,6 +18,6 @@ contract c { // compileViaYul: also // ---- // 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: 147998 -// gas legacy: 152522 -// gas legacyOptimized: 146671 +// gas irOptimized: 139798 +// gas legacy: 144322 +// gas legacyOptimized: 139171 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 eabef2776..e51336a36 100644 --- a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol +++ b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol @@ -17,6 +17,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0 -// gas irOptimized: 394087 -// gas legacy: 565428 -// gas legacyOptimized: 552524 +// gas irOptimized: 195787 +// gas legacy: 218028 +// gas legacyOptimized: 205124 diff --git a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol index 48cac5145..45935109a 100644 --- a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol +++ b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol @@ -15,6 +15,6 @@ contract C { // compileViaYul: also // ---- // f() -> -// gas irOptimized: 178367 -// gas legacy: 180320 -// gas legacyOptimized: 180103 +// gas irOptimized: 180067 +// gas legacy: 180620 +// gas legacyOptimized: 180403 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 56e35874a..f1621264b 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol @@ -29,16 +29,16 @@ contract C { // ---- // l() -> 0 // f(uint256,uint256): 42, 64 -> -// gas irOptimized: 202621 -// gas legacy: 163034 -// gas legacyOptimized: 157045 +// gas irOptimized: 116221 +// gas legacy: 108234 +// gas legacyOptimized: 102245 // l() -> 1 // ll(uint256): 0 -> 43 // a(uint256,uint256): 0, 42 -> 64 // f(uint256,uint256): 84, 128 -> -// gas irOptimized: 298837 -// gas legacy: 222080 -// gas legacyOptimized: 210631 +// gas irOptimized: 123537 +// gas legacy: 107780 +// gas legacyOptimized: 96331 // l() -> 2 // ll(uint256): 1 -> 85 // a(uint256,uint256): 0, 42 -> 64 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 933e5c13a..255bc0646 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol @@ -23,9 +23,9 @@ contract C { // ---- // l() -> 0 // g(uint256): 70 -> -// gas irOptimized: 428829 -// gas legacy: 419791 -// gas legacyOptimized: 415408 +// gas irOptimized: 194029 +// gas legacy: 184991 +// gas legacyOptimized: 180608 // l() -> 70 // a(uint256): 69 -> left(69) // f() -> diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index 08deac565..a5ca40bfc 100644 --- a/test/libsolidity/semanticTests/array/reusing_memory.sol +++ b/test/libsolidity/semanticTests/array/reusing_memory.sol @@ -26,6 +26,6 @@ contract Main { // compileViaYul: also // ---- // f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1 -// gas irOptimized: 115543 -// gas legacy: 127152 -// gas legacyOptimized: 113679 +// gas irOptimized: 115243 +// gas legacy: 126852 +// gas legacyOptimized: 114079 diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index 691f85e3e..07f90034b 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -26,6 +26,6 @@ contract Creator { // compileViaYul: also // ---- // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 -// gas irOptimized: 474718 -// gas legacy: 578926 -// gas legacyOptimized: 436724 +// gas irOptimized: 486618 +// gas legacy: 590826 +// gas legacyOptimized: 448624 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index 60e2017f3..a2aafb084 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -26,6 +26,6 @@ contract Creator { // compileViaYul: also // ---- // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" -// gas irOptimized: 330957 -// gas legacy: 422873 -// gas legacyOptimized: 292281 +// gas irOptimized: 336157 +// gas legacy: 427373 +// gas legacyOptimized: 296781 diff --git a/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol b/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol index 459a5a239..78466f3f0 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol @@ -19,4 +19,4 @@ contract C { // compileViaYul: also // ---- // f() -> 16 -// gas legacy: 104744 +// gas legacy: 103744 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 0a79d922b..c8d22c944 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -178,33 +178,33 @@ contract DepositContract is IDepositContract, ERC165 { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 1826340 -// gas legacy: 2558004 -// gas legacyOptimized: 1798657 +// gas irOptimized: 1805935 +// gas legacy: 2580394 +// gas legacyOptimized: 1803757 // supportsInterface(bytes4): 0x0 -> 0 // supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 # // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # // supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 104382 -// gas legacy: 128065 -// gas legacyOptimized: 100398 +// gas irOptimized: 127482 +// gas legacy: 150465 +// gas legacyOptimized: 122798 // 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: 104382 -// gas legacy: 128065 -// gas legacyOptimized: 100398 +// gas irOptimized: 127482 +// gas legacy: 150465 +// gas legacyOptimized: 122798 // 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 # // get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438 -// gas irOptimized: 104386 -// gas legacy: 128075 -// gas legacyOptimized: 100411 +// gas irOptimized: 127486 +// gas legacy: 150475 +// gas legacyOptimized: 122811 // 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 # // get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee -// gas irOptimized: 104386 -// gas legacy: 128075 -// gas legacyOptimized: 100411 +// gas irOptimized: 127486 +// gas legacy: 150475 +// gas legacyOptimized: 122811 // get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index 323f065e2..10c129b20 100644 --- a/test/libsolidity/semanticTests/externalContracts/snark.sol +++ b/test/libsolidity/semanticTests/externalContracts/snark.sol @@ -296,6 +296,6 @@ contract Test { // g() -> true // pair() -> true // verifyTx() -> true -// gas irOptimized: 127916 -// gas legacy: 130571 -// gas legacyOptimized: 100147 +// gas irOptimized: 111716 +// gas legacy: 114371 +// gas legacyOptimized: 83947 diff --git a/test/libsolidity/semanticTests/freeFunctions/new_operator.sol b/test/libsolidity/semanticTests/freeFunctions/new_operator.sol index eae09bb52..1694b64d5 100644 --- a/test/libsolidity/semanticTests/freeFunctions/new_operator.sol +++ b/test/libsolidity/semanticTests/freeFunctions/new_operator.sol @@ -15,4 +15,4 @@ contract D { // compileViaYul: also // ---- // f() -> 2 -// gas legacy: 101554 +// gas legacy: 101754 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol index 953625d99..8546c775e 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol @@ -13,4 +13,4 @@ contract D { // compileViaYul: also // ---- // f() -> 2 -// gas legacy: 101527 +// gas legacy: 101727 diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index f74427462..747afe8a6 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -18,17 +18,17 @@ contract C { // compileViaYul: also // ---- // constructor(), 20 wei -// gas irOptimized: 255579 -// gas legacy: 285485 +// gas irOptimized: 259072 +// gas legacy: 288299 // gas legacyOptimized: 177933 // f(uint256): 20 -> 1370859564726510389319704988634906228201275401179 // x() -> 1 // f(uint256): 20 -> FAILURE // x() -> 1 // stack(uint256): 1023 -> FAILURE -// gas irOptimized: 856335 -// gas legacy: 981671 -// gas legacyOptimized: 824895 +// gas irOptimized: 391236 +// gas legacy: 535367 +// gas legacyOptimized: 354656 // x() -> 1 // stack(uint256): 10 -> 693016686122178122849713379390321835634789309880 // x() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol index ed3a86c96..d024a4edb 100644 --- a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol +++ b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol @@ -20,9 +20,9 @@ contract test { // compileViaYul: also // ---- // set(uint8,uint8,uint8,uint8,uint8): 1, 21, 22, 42, 43 -> 0, 0, 0, 0 -// gas irOptimized: 109814 -// gas legacy: 111406 -// gas legacyOptimized: 107981 +// gas irOptimized: 112214 +// gas legacy: 113806 +// gas legacyOptimized: 111781 // get(uint8): 1 -> 21, 22, 42, 43 // set(uint8,uint8,uint8,uint8,uint8): 1, 10, 30, 11, 31 -> 21, 22, 42, 43 // get(uint8): 1 -> 10, 30, 11, 31 diff --git a/test/libsolidity/semanticTests/functionTypes/store_function.sol b/test/libsolidity/semanticTests/functionTypes/store_function.sol index 937ce9519..7318b5bc3 100644 --- a/test/libsolidity/semanticTests/functionTypes/store_function.sol +++ b/test/libsolidity/semanticTests/functionTypes/store_function.sol @@ -28,6 +28,6 @@ contract C { // compileViaYul: also // ---- // t() -> 9 -// gas irOptimized: 103953 -// gas legacy: 162897 -// gas legacyOptimized: 112116 +// gas irOptimized: 100053 +// gas legacy: 158997 +// gas legacyOptimized: 108916 diff --git a/test/libsolidity/semanticTests/immutable/multi_creation.sol b/test/libsolidity/semanticTests/immutable/multi_creation.sol index 1b10dd3c5..aa3ca2606 100644 --- a/test/libsolidity/semanticTests/immutable/multi_creation.sol +++ b/test/libsolidity/semanticTests/immutable/multi_creation.sol @@ -29,8 +29,8 @@ contract C { // compileViaYul: also // ---- // f() -> 3, 7, 5 -// gas irOptimized: 131380 -// gas legacy: 153990 -// gas legacyOptimized: 127822 +// gas irOptimized: 128980 +// gas legacy: 151590 +// gas legacyOptimized: 125422 // x() -> 7 // y() -> 5 diff --git a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol index 3e370307f..00998cdf1 100644 --- a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol +++ b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol @@ -23,8 +23,8 @@ contract D { // compileViaYul: also // ---- // f() -> 1 -// gas irOptimized: 86504 -// gas legacy: 116212 +// gas irOptimized: 85304 +// gas legacy: 115012 // g() -> 5 -// gas irOptimized: 86600 -// gas legacy: 116672 +// gas irOptimized: 85400 +// gas legacy: 115472 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol index d4670efed..804e7197f 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol @@ -25,5 +25,5 @@ contract B { // compileViaYul: also // ---- // g() -> 42 -// gas irOptimized: 90635 -// gas legacy: 126809 +// gas irOptimized: 89435 +// gas legacy: 125609 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol index 34820dbcb..98b33cd5b 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol @@ -25,6 +25,6 @@ contract B { // compileViaYul: also // ---- // g() -> 42 -// gas irOptimized: 119658 -// gas legacy: 187809 -// gas legacyOptimized: 117351 +// gas irOptimized: 118458 +// gas legacy: 186609 +// gas legacyOptimized: 116151 diff --git a/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol b/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol index 726caf3fa..9a095cc21 100644 --- a/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol +++ b/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol @@ -22,6 +22,6 @@ contract A { // compileViaYul: also // ---- // g(int256): -1 -> -1 -// gas legacy: 103422 +// gas legacy: 103622 // g(int256): 10 -> 10 -// gas legacy: 103050 +// gas legacy: 103250 diff --git a/test/libsolidity/semanticTests/interface_inheritance_conversions.sol b/test/libsolidity/semanticTests/interface_inheritance_conversions.sol index a2e45fbc3..dd38a7ed8 100644 --- a/test/libsolidity/semanticTests/interface_inheritance_conversions.sol +++ b/test/libsolidity/semanticTests/interface_inheritance_conversions.sol @@ -37,10 +37,10 @@ contract C { // compileViaYul: also // ---- // convertParent() -> 1 -// gas irOptimized: 103637 +// gas irOptimized: 102437 // convertSubA() -> 1, 2 -// gas irOptimized: 105720 -// gas legacy: 101703 +// gas irOptimized: 103320 +// gas legacy: 99303 // convertSubB() -> 1, 3 -// gas irOptimized: 105654 -// gas legacy: 101637 +// gas irOptimized: 103254 +// gas legacy: 99237 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 cc279c917..9c52a803a 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol @@ -22,6 +22,6 @@ contract A { // compileViaYul: also // ---- // f(), 10 ether -> 3007, 3008, 3009 -// gas irOptimized: 294279 -// gas legacy: 422027 -// gas legacyOptimized: 287256 +// gas irOptimized: 294879 +// gas legacy: 422627 +// gas legacyOptimized: 287856 diff --git a/test/libsolidity/semanticTests/smoke/alignment.sol b/test/libsolidity/semanticTests/smoke/alignment.sol index 69d9d9287..143473461 100644 --- a/test/libsolidity/semanticTests/smoke/alignment.sol +++ b/test/libsolidity/semanticTests/smoke/alignment.sol @@ -27,5 +27,5 @@ contract D { // stateDecimal() -> right(42) // stateBytes() -> left(0x4200ef) // internalStateDecimal() -> 0x20 -// gas legacy: 101607 +// gas legacy: 101807 // update(bool,uint256,bytes32): false, -23, left(0x2300ef) -> false, -23, left(0x2300ef) diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol index 0f0052c56..937f39e14 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol @@ -46,6 +46,6 @@ contract C { // compileViaYul: also // ---- // test() -> true -// gas irOptimized: 143266 -// gas legacy: 143536 -// gas legacyOptimized: 133280 +// gas irOptimized: 135766 +// gas legacy: 136036 +// gas legacyOptimized: 133480 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 0fdc5063c..ac1384b52 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 @@ -18,6 +18,6 @@ contract C { // compileViaYul: also // ---- // f(uint32,(uint128,uint256[][2],uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 77, 1, 2, 88 -// gas irOptimized: 197768 -// gas legacy: 205266 -// gas legacyOptimized: 196983 +// gas irOptimized: 204368 +// gas legacy: 208666 +// gas legacyOptimized: 203583 diff --git a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol index dc1112d9e..1e291fef1 100644 --- a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol +++ b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol @@ -25,4 +25,6 @@ contract CopyTest { // compileViaYul: also // ---- // run() -> 2, 23, 42 -// gas irOptimized: 110038 +// gas irOptimized: 198438 +// gas legacy: 186016 +// gas legacyOptimized: 184668 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol index 94a773161..7fb2e8bd1 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol @@ -69,7 +69,7 @@ contract Test { // compileViaYul: also // ---- // load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 -// gas irOptimized: 111532 -// gas legacy: 113999 -// gas legacyOptimized: 106281 +// gas irOptimized: 111932 +// gas legacy: 112999 +// gas legacyOptimized: 110881 // 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 a9c345322..3f13f23ca 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 @@ -25,9 +25,9 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 124205 -// gas legacy: 124736 -// gas legacyOptimized: 124179 +// gas irOptimized: 133905 +// gas legacy: 134436 +// gas legacyOptimized: 133879 // test(uint256): 32 -> "3" // storageEmpty -> 0 // copy() -> true diff --git a/test/libsolidity/semanticTests/structs/struct_copy.sol b/test/libsolidity/semanticTests/structs/struct_copy.sol index 4409571a4..b54f07e09 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy.sol @@ -38,14 +38,14 @@ contract c { // compileViaYul: also // ---- // set(uint256): 7 -> true -// gas irOptimized: 101849 -// gas legacy: 102216 -// gas legacyOptimized: 101606 +// gas irOptimized: 110249 +// gas legacy: 110616 +// gas legacyOptimized: 110006 // retrieve(uint256): 7 -> 1, 3, 4, 2 // copy(uint256,uint256): 7, 8 -> true -// gas irOptimized: 105169 -// gas legacy: 105566 -// gas legacyOptimized: 105022 +// gas irOptimized: 118769 +// gas legacy: 119166 +// gas legacyOptimized: 118622 // retrieve(uint256): 7 -> 1, 3, 4, 2 // retrieve(uint256): 8 -> 1, 3, 4, 2 // copy(uint256,uint256): 0, 7 -> true diff --git a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol index 9fe25c4b8..3d37f06d6 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol @@ -21,6 +21,6 @@ contract c { // compileViaYul: also // ---- // test() -> true -// gas irOptimized: 104623 -// gas legacy: 106427 -// gas legacyOptimized: 101306 +// gas irOptimized: 110223 +// gas legacy: 110627 +// gas legacyOptimized: 109706 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol index 57102e996..ee226a0a9 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol @@ -33,4 +33,4 @@ contract C { // compileViaYul: true // ---- // f() -> 0, 0, 0 -// gas irOptimized: 123854 +// gas irOptimized: 117954 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 45b63742a..f40a76745 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol @@ -44,7 +44,7 @@ contract C { // compileViaYul: also // ---- // f() -> -// gas irOptimized: 122810 -// gas legacy: 126832 -// gas legacyOptimized: 125500 +// gas irOptimized: 121810 +// gas legacy: 122132 +// gas legacyOptimized: 121500 // g() -> diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol index f94729325..2c929bf2f 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol @@ -27,4 +27,4 @@ contract C { // compileViaYul: true // ---- // f() -> 0 -// gas irOptimized: 117902 +// gas irOptimized: 112702 diff --git a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol index 11cdab9f8..bf9034b12 100644 --- a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol +++ b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol @@ -28,10 +28,10 @@ contract C { } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // f() -> 42, 23, 34, 42, 42 -// gas irOptimized: 108610 -// gas legacy: 110821 -// gas legacyOptimized: 105148 +// gas irOptimized: 111210 +// gas legacy: 112021 +// gas legacyOptimized: 110548 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index 36a6589ca..3b49e6f7c 100644 --- a/test/libsolidity/semanticTests/structs/structs.sol +++ b/test/libsolidity/semanticTests/structs/structs.sol @@ -32,7 +32,7 @@ contract test { // ---- // check() -> false // set() -> -// gas irOptimized: 128459 -// gas legacy: 129577 -// gas legacyOptimized: 126964 +// gas irOptimized: 134859 +// gas legacy: 135277 +// gas legacyOptimized: 134064 // check() -> true diff --git a/test/libsolidity/semanticTests/various/code_access_content.sol b/test/libsolidity/semanticTests/various/code_access_content.sol index 9f38de84a..3f8d56587 100644 --- a/test/libsolidity/semanticTests/various/code_access_content.sol +++ b/test/libsolidity/semanticTests/various/code_access_content.sol @@ -40,6 +40,6 @@ contract C { // compileViaYul: also // ---- // testRuntime() -> true -// gas legacy: 100679 +// gas legacy: 101579 // testCreation() -> true -// gas legacy: 101937 +// gas legacy: 102137 diff --git a/test/libsolidity/semanticTests/various/code_access_create.sol b/test/libsolidity/semanticTests/various/code_access_create.sol index abffae170..c32135fe5 100644 --- a/test/libsolidity/semanticTests/various/code_access_create.sol +++ b/test/libsolidity/semanticTests/various/code_access_create.sol @@ -26,4 +26,4 @@ contract C { // compileViaYul: also // ---- // test() -> 7 -// gas legacy: 102192 +// gas legacy: 102392 diff --git a/test/libsolidity/semanticTests/various/code_access_runtime.sol b/test/libsolidity/semanticTests/various/code_access_runtime.sol index 959ac6a34..49d0d9ceb 100644 --- a/test/libsolidity/semanticTests/various/code_access_runtime.sol +++ b/test/libsolidity/semanticTests/various/code_access_runtime.sol @@ -25,4 +25,4 @@ contract C { // compileViaYul: also // ---- // test() -> 42 -// gas legacy: 100138 +// gas legacy: 101638 diff --git a/test/libsolidity/semanticTests/various/destructuring_assignment.sol b/test/libsolidity/semanticTests/various/destructuring_assignment.sol index 23c937741..1f49d3128 100644 --- a/test/libsolidity/semanticTests/various/destructuring_assignment.sol +++ b/test/libsolidity/semanticTests/various/destructuring_assignment.sol @@ -36,6 +36,6 @@ contract C { // compileViaYul: also // ---- // f(bytes): 0x20, 0x5, "abcde" -> 0 -// gas irOptimized: 241328 -// gas legacy: 239258 -// gas legacyOptimized: 238582 +// gas irOptimized: 241728 +// gas legacy: 240358 +// gas legacyOptimized: 239682 diff --git a/test/libsolidity/semanticTests/various/external_types_in_calls.sol b/test/libsolidity/semanticTests/various/external_types_in_calls.sol index 923d9197d..941a06a91 100644 --- a/test/libsolidity/semanticTests/various/external_types_in_calls.sol +++ b/test/libsolidity/semanticTests/various/external_types_in_calls.sol @@ -27,5 +27,5 @@ contract C { // compileViaYul: also // ---- // test() -> 9, 7 -// gas legacy: 123394 +// gas legacy: 121594 // t2() -> 9 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 60b7c21f4..8213f346a 100644 --- a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol +++ b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol @@ -22,6 +22,6 @@ contract C { // compileViaYul: also // ---- // g() -> 2, 6 -// gas irOptimized: 169460 -// gas legacy: 172490 -// gas legacyOptimized: 171209 +// gas irOptimized: 179260 +// gas legacy: 180890 +// gas legacyOptimized: 179609 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 2623bdcae..b5f14e3cc 100644 --- a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol +++ b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol @@ -36,12 +36,12 @@ contract D { // compileViaYul: also // ---- // f() -> 0x1 # This should work, next should throw # -// gas legacy: 102944 +// gas legacy: 103844 // fview() -> FAILURE -// gas irOptimized: 98438664 -// gas legacy: 98438822 -// gas legacyOptimized: 98438615 +// gas irOptimized: 98438645 +// gas legacy: 98438803 +// gas legacyOptimized: 98438596 // fpure() -> FAILURE -// gas irOptimized: 98438664 -// gas legacy: 98438822 -// gas legacyOptimized: 98438616 +// gas irOptimized: 98438646 +// gas legacy: 98438803 +// gas legacyOptimized: 98438597 diff --git a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol index a457c6846..165b4f006 100644 --- a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol +++ b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol @@ -30,9 +30,9 @@ contract c { // x() -> 0, 0 // y() -> 0, 0 // set() -> -// gas irOptimized: 101354 -// gas legacy: 101332 -// gas legacyOptimized: 101282 +// gas irOptimized: 109754 +// gas legacy: 109732 +// gas legacyOptimized: 109682 // x() -> 1, 2 // y() -> 3, 4 // swap() -> diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol b/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol index 3ec0d9d60..669f8083c 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol @@ -18,33 +18,33 @@ contract C { // ---- // test_indices(uint256): 1 -> // test_indices(uint256): 129 -> -// gas irOptimized: 3442268 -// gas legacy: 3340105 -// gas legacyOptimized: 3280773 +// gas irOptimized: 3070168 +// gas legacy: 3071205 +// gas legacyOptimized: 3011873 // test_indices(uint256): 5 -> -// gas irOptimized: 467656 -// gas legacy: 458941 -// gas legacyOptimized: 455849 +// gas irOptimized: 373956 +// gas legacy: 369241 +// gas legacyOptimized: 366149 // test_indices(uint256): 10 -> // test_indices(uint256): 15 -> -// gas irOptimized: 109070 +// gas irOptimized: 76670 // test_indices(uint256): 0xFF -> -// gas irOptimized: 4308940 -// gas legacy: 4107867 -// gas legacyOptimized: 3991807 +// gas irOptimized: 3511240 +// gas legacy: 3514167 +// gas legacyOptimized: 3398107 // test_indices(uint256): 1000 -> -// gas irOptimized: 21133562 -// gas legacy: 20360399 -// gas legacyOptimized: 19921344 +// gas irOptimized: 18591162 +// gas legacy: 18617999 +// gas legacyOptimized: 18178944 // test_indices(uint256): 129 -> -// gas irOptimized: 3601383 -// gas legacy: 3472135 -// gas legacyOptimized: 3415947 +// gas irOptimized: 2798783 +// gas legacy: 2772735 +// gas legacyOptimized: 2716547 // test_indices(uint256): 128 -> -// gas irOptimized: 648097 -// gas legacy: 556972 -// gas legacyOptimized: 508124 +// gas irOptimized: 455997 +// gas legacy: 467272 +// gas legacyOptimized: 418424 // test_indices(uint256): 1 -> -// gas irOptimized: 458399 -// gas legacy: 452407 -// gas legacyOptimized: 450811 +// gas irOptimized: 368599 +// gas legacy: 363407 +// gas legacyOptimized: 361811 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol b/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol index d40970f22..798133709 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol @@ -18,12 +18,12 @@ 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: 668136 -// gas legacy: 648515 -// gas legacyOptimized: 628739 +// gas irOptimized: 151436 +// gas legacy: 131815 +// gas legacyOptimized: 112039 // test_boundary_check(uint256,uint256): 256, 255 -> 0 -// gas irOptimized: 669117 -// gas legacy: 649549 -// gas legacyOptimized: 629633 +// gas irOptimized: 153717 +// gas legacy: 134149 +// gas legacyOptimized: 114233 // test_boundary_check(uint256,uint256): 256, 0xFFFF -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 256, 2 -> 0 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_index_zeroed_test.sol b/test/libsolidity/semanticTests/viaYul/array_storage_index_zeroed_test.sol index 8a64afa27..55f53d92c 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_index_zeroed_test.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_index_zeroed_test.sol @@ -54,18 +54,18 @@ contract C { // ---- // test_zeroed_indicies(uint256): 1 -> // test_zeroed_indicies(uint256): 5 -> -// gas irOptimized: 196818 -// gas legacy: 191267 -// gas legacyOptimized: 188486 +// gas irOptimized: 133918 +// gas legacy: 132367 +// gas legacyOptimized: 129586 // test_zeroed_indicies(uint256): 10 -> -// gas irOptimized: 286446 -// gas legacy: 276129 -// gas legacyOptimized: 271024 +// gas irOptimized: 179646 +// gas legacy: 177329 +// gas legacyOptimized: 172224 // test_zeroed_indicies(uint256): 15 -> -// gas irOptimized: 354256 -// gas legacy: 339254 -// gas legacyOptimized: 331904 +// gas irOptimized: 204956 +// gas legacy: 201954 +// gas legacyOptimized: 194604 // test_zeroed_indicies(uint256): 0xFF -> -// gas irOptimized: 8736366 -// gas legacy: 8477449 -// gas legacyOptimized: 8343774 +// gas irOptimized: 6218066 +// gas legacy: 6163149 +// gas legacyOptimized: 6029474 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_length_access.sol b/test/libsolidity/semanticTests/viaYul/array_storage_length_access.sol index 08fa6c9db..b5479bc29 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_length_access.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_length_access.sol @@ -14,11 +14,11 @@ contract C { // set_get_length(uint256): 10 -> 10 // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0xFF -> 0xFF -// gas irOptimized: 434356 -// gas legacy: 619622 -// gas legacyOptimized: 600718 +// gas irOptimized: 105956 +// gas legacy: 126722 +// gas legacyOptimized: 107818 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 6743118 -// gas legacy: 9765519 -// gas legacyOptimized: 9461820 +// gas irOptimized: 1367718 +// gas legacy: 1702119 +// gas legacyOptimized: 1398420 // set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol index 3813477dd..d89a86cf0 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol @@ -13,11 +13,14 @@ contract C { // compileViaYul: also // ---- // pushEmpty(uint256): 128 -// gas irOptimized: 620912 -// gas legacy: 607287 -// gas legacyOptimized: 589048 +// gas irOptimized: 430912 +// gas legacy: 417287 +// gas legacyOptimized: 399048 // pushEmpty(uint256): 256 -// gas irOptimized: 846064 -// gas legacy: 828983 -// gas legacyOptimized: 802808 +// gas irOptimized: 732164 +// gas legacy: 715083 +// gas legacyOptimized: 688908 // pushEmpty(uint256): 32768 -> FAILURE # out-of-gas # +// gas irOptimized: 99079684 +// gas legacy: 95561675 +// gas legacyOptimized: 90961420 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol index bbd3e55f8..2e2f808a6 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol @@ -18,15 +18,17 @@ contract C { // set_get_length(uint256): 10 -> 10 // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0 -> 0 -// gas irOptimized: 109299 -// gas legacy: 107830 -// gas legacyOptimized: 107262 +// gas irOptimized: 79199 +// gas legacy: 35730 +// gas legacyOptimized: 77162 // set_get_length(uint256): 0xFF -> 0xFF -// gas irOptimized: 691561 -// gas legacy: 882337 -// gas legacyOptimized: 650704 +// gas irOptimized: 155961 +// gas legacy: 636237 +// gas legacyOptimized: 115104 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 10077103 -// gas legacy: 12945874 -// gas legacyOptimized: 9462646 -// set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas # +// gas irOptimized: 2013003 +// gas legacy: 9871774 +// gas legacyOptimized: 1398546 +// set_get_length(uint256): 0xFFFF -> 0xffff # Out-of-gas # +// gas irOptimized: 31849803 +// gas legacyOptimized: 22019346 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol b/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol index d98940d07..b0ae9700d 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol @@ -15,15 +15,15 @@ contract C { // set_get_length(uint256): 1 -> 0 // set_get_length(uint256): 10 -> 0 // set_get_length(uint256): 20 -> 0 -// gas irOptimized: 160945 -// gas legacy: 141922 -// gas legacyOptimized: 139708 +// gas irOptimized: 88845 +// gas legacy: 85822 +// gas legacyOptimized: 83608 // set_get_length(uint256): 0xFF -> 0 -// gas irOptimized: 1770460 -// gas legacy: 1524427 -// gas legacyOptimized: 1500358 +// gas irOptimized: 852360 +// gas legacy: 810327 +// gas legacyOptimized: 786258 // set_get_length(uint256): 0xFFF -> 0 -// gas irOptimized: 28070632 -// gas legacy: 24115159 -// gas legacyOptimized: 23733970 +// gas irOptimized: 13328532 +// gas legacy: 12649059 +// gas legacyOptimized: 12267870 // set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas # From 97c9d213762af792478cb21b77a1fbe8316281c5 Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 25 May 2021 13:09:48 +0200 Subject: [PATCH 6/7] Force two tests to go out of gas. --- .../viaYul/array_storage_push_empty.sol | 8 ++++---- .../array_storage_push_empty_length_address.sol | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol index d89a86cf0..5acbba8fd 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol @@ -20,7 +20,7 @@ contract C { // gas irOptimized: 732164 // gas legacy: 715083 // gas legacyOptimized: 688908 -// pushEmpty(uint256): 32768 -> FAILURE # out-of-gas # -// gas irOptimized: 99079684 -// gas legacy: 95561675 -// gas legacyOptimized: 90961420 +// pushEmpty(uint256): 38869 -> FAILURE # out-of-gas # +// gas irOptimized: 100000000 +// gas legacy: 100000000 +// gas legacyOptimized: 100000000 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol index 2e2f808a6..273c50814 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty_length_address.sol @@ -19,16 +19,16 @@ contract C { // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0 -> 0 // gas irOptimized: 79199 -// gas legacy: 35730 +// gas legacy: 77730 // gas legacyOptimized: 77162 // set_get_length(uint256): 0xFF -> 0xFF // gas irOptimized: 155961 -// gas legacy: 636237 +// gas legacy: 678237 // gas legacyOptimized: 115104 // set_get_length(uint256): 0xFFF -> 0xFFF // gas irOptimized: 2013003 -// gas legacy: 9871774 +// gas legacy: 9873774 // gas legacyOptimized: 1398546 -// set_get_length(uint256): 0xFFFF -> 0xffff # Out-of-gas # -// gas irOptimized: 31849803 -// gas legacyOptimized: 22019346 +// set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # +// gas irOptimized: 100000000 +// gas legacyOptimized: 100000000 From dc15e31605d1de47883c2890878195403ba984aa Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 25 May 2021 17:21:48 +0200 Subject: [PATCH 7/7] Increased the tolerance for two GasMeter tests. --- test/libsolidity/GasMeter.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 43256d14f..d77462eb9 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -192,7 +192,15 @@ BOOST_AUTO_TEST_CASE(function_calls) } )"; testCreationTimeGas(sourceCode); - testRunTimeGas("f(uint256)", vector{encodeArgs(2), encodeArgs(8)}); + // In f, data2 is accessed twice, so there is a reduction of 2200 to 100 in actual costs. + // However, GasMeter always assumes cold costs. + testRunTimeGas( + "f(uint256)", + vector{encodeArgs(2), encodeArgs(8)}, + m_evmVersion < EVMVersion::berlin() ? + u256(0) : + u256(2100) + ); } BOOST_AUTO_TEST_CASE(multiple_external_functions) @@ -213,7 +221,16 @@ BOOST_AUTO_TEST_CASE(multiple_external_functions) } )"; testCreationTimeGas(sourceCode); - testRunTimeGas("f(uint256)", vector{encodeArgs(2), encodeArgs(8)}); + // In f, data2 is accessed twice, so there is a reduction of 2200 to 100 in actual costs. + // However, GasMeter always assumes cold costs. + testRunTimeGas( + "f(uint256)", + vector{encodeArgs(2), encodeArgs(8)}, + m_evmVersion < EVMVersion::berlin() ? + u256(0) : + u256(2100) + ); + testRunTimeGas("g(uint256)", vector{encodeArgs(2)}); }