diff --git a/libsolidity/codegen/ir/IRGenerator.cpp b/libsolidity/codegen/ir/IRGenerator.cpp index b17b33c03..c2bb0c3cf 100644 --- a/libsolidity/codegen/ir/IRGenerator.cpp +++ b/libsolidity/codegen/ir/IRGenerator.cpp @@ -1069,9 +1069,6 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract) string IRGenerator::memoryInit(bool _useMemoryGuard) { - // TODO: Remove once we have made sure it is safe, i.e. after "Yul memory objects lite". - // Also restore the tests removed in the commit that adds this comment. - _useMemoryGuard = false; // This function should be called at the beginning of the EVM call frame // and thus can assume all memory to be zero, including the contents of // the "zero memory area" (the position CompilerUtils::zeroPointer points to). diff --git a/libyul/backends/evm/EVMObjectCompiler.cpp b/libyul/backends/evm/EVMObjectCompiler.cpp index e41a68387..bede32d17 100644 --- a/libyul/backends/evm/EVMObjectCompiler.cpp +++ b/libyul/backends/evm/EVMObjectCompiler.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -62,19 +63,35 @@ void EVMObjectCompiler::run(Object& _object, bool _optimize) yulAssert(_object.analysisInfo, "No analysis info."); yulAssert(_object.code, "No code."); - // We do not catch and re-throw the stack too deep exception here because it is a YulException, - // which should be native to this part of the code. - CodeTransform transform{ - m_assembly, - *_object.analysisInfo, - *_object.code, - m_dialect, - context, - _optimize, - {}, - CodeTransform::UseNamedLabels::ForFirstFunctionOfEachName - }; - transform(*_object.code); - if (!transform.stackErrors().empty()) - BOOST_THROW_EXCEPTION(transform.stackErrors().front()); + if (_optimize && m_dialect.evmVersion().canOverchargeGasForCall()) + { + auto stackErrors = OptimizedEVMCodeTransform::run( + m_assembly, + *_object.analysisInfo, + *_object.code, + m_dialect, + context, + OptimizedEVMCodeTransform::UseNamedLabels::ForFirstFunctionOfEachName + ); + if (!stackErrors.empty()) + BOOST_THROW_EXCEPTION(stackErrors.front()); + } + else + { + // We do not catch and re-throw the stack too deep exception here because it is a YulException, + // which should be native to this part of the code. + CodeTransform transform{ + m_assembly, + *_object.analysisInfo, + *_object.code, + m_dialect, + context, + _optimize, + {}, + CodeTransform::UseNamedLabels::ForFirstFunctionOfEachName + }; + transform(*_object.code); + if (!transform.stackErrors().empty()) + BOOST_THROW_EXCEPTION(transform.stackErrors().front()); + } } diff --git a/libyul/backends/evm/OptimizedEVMCodeTransform.cpp b/libyul/backends/evm/OptimizedEVMCodeTransform.cpp index ca57c59d2..08987b565 100644 --- a/libyul/backends/evm/OptimizedEVMCodeTransform.cpp +++ b/libyul/backends/evm/OptimizedEVMCodeTransform.cpp @@ -44,7 +44,7 @@ vector OptimizedEVMCodeTransform::run( Block const& _block, EVMDialect const& _dialect, BuiltinContext& _builtinContext, - bool _useNamedLabelsForFunctions + UseNamedLabels _useNamedLabelsForFunctions ) { std::unique_ptr dfg = ControlFlowGraphBuilder::build(_analysisInfo, _dialect, _block); @@ -170,15 +170,35 @@ void OptimizedEVMCodeTransform::operator()(CFG::Assignment const& _assignment) OptimizedEVMCodeTransform::OptimizedEVMCodeTransform( AbstractAssembly& _assembly, BuiltinContext& _builtinContext, - bool _useNamedLabelsForFunctions, + UseNamedLabels _useNamedLabelsForFunctions, CFG const& _dfg, StackLayout const& _stackLayout ): m_assembly(_assembly), m_builtinContext(_builtinContext), - m_useNamedLabelsForFunctions(_useNamedLabelsForFunctions), m_dfg(_dfg), - m_stackLayout(_stackLayout) + m_stackLayout(_stackLayout), + m_functionLabels([&](){ + map functionLabels; + set assignedFunctionNames; + for (Scope::Function const* function: m_dfg.functions) + { + CFG::FunctionInfo const& functionInfo = m_dfg.functionInfo.at(function); + bool nameAlreadySeen = !assignedFunctionNames.insert(function->name).second; + if (_useNamedLabelsForFunctions == UseNamedLabels::YesAndForceUnique) + yulAssert(!nameAlreadySeen); + bool useNamedLabel = _useNamedLabelsForFunctions != UseNamedLabels::Never && !nameAlreadySeen; + functionLabels[&functionInfo] = useNamedLabel ? + m_assembly.namedLabel( + function->name.str(), + function->arguments.size(), + function->returns.size(), + functionInfo.debugData ? functionInfo.debugData->astID : nullopt + ) : + m_assembly.newLabelId(); + } + return functionLabels; + }()) { } @@ -191,15 +211,7 @@ void OptimizedEVMCodeTransform::assertLayoutCompatibility(Stack const& _currentS AbstractAssembly::LabelID OptimizedEVMCodeTransform::getFunctionLabel(Scope::Function const& _function) { - CFG::FunctionInfo const& functionInfo = m_dfg.functionInfo.at(&_function); - if (!m_functionLabels.count(&functionInfo)) - m_functionLabels[&functionInfo] = m_useNamedLabelsForFunctions ? m_assembly.namedLabel( - functionInfo.function.name.str(), - functionInfo.function.arguments.size(), - functionInfo.function.returns.size(), - {} - ) : m_assembly.newLabelId(); - return m_functionLabels[&functionInfo]; + return m_functionLabels.at(&m_dfg.functionInfo.at(&_function)); } void OptimizedEVMCodeTransform::validateSlot(StackSlot const& _slot, Expression const& _expression) diff --git a/libyul/backends/evm/OptimizedEVMCodeTransform.h b/libyul/backends/evm/OptimizedEVMCodeTransform.h index 48819251a..ed03c1453 100644 --- a/libyul/backends/evm/OptimizedEVMCodeTransform.h +++ b/libyul/backends/evm/OptimizedEVMCodeTransform.h @@ -43,13 +43,17 @@ struct StackLayout; class OptimizedEVMCodeTransform { public: + /// Use named labels for functions 1) Yes and check that the names are unique + /// 2) For none of the functions 3) for the first function of each name. + enum class UseNamedLabels { YesAndForceUnique, Never, ForFirstFunctionOfEachName }; + [[nodiscard]] static std::vector run( AbstractAssembly& _assembly, AsmAnalysisInfo& _analysisInfo, Block const& _block, EVMDialect const& _dialect, BuiltinContext& _builtinContext, - bool _useNamedLabelsForFunctions = false + UseNamedLabels _useNamedLabelsForFunctions ); /// Generate code for the function call @a _call. Only public for using with std::visit. @@ -62,7 +66,7 @@ private: OptimizedEVMCodeTransform( AbstractAssembly& _assembly, BuiltinContext& _builtinContext, - bool _useNamedLabelsForFunctions, + UseNamedLabels _useNamedLabelsForFunctions, CFG const& _dfg, StackLayout const& _stackLayout ); @@ -70,6 +74,7 @@ private: /// Assert that it is valid to transition from @a _currentStack to @a _desiredStack. /// That is @a _currentStack matches each slot in @a _desiredStack that is not a JunkSlot exactly. static void assertLayoutCompatibility(Stack const& _currentStack, Stack const& _desiredStack); + /// @returns The label of the entry point of the given @a _function. /// Creates and stores a new label, if none exists already. AbstractAssembly::LabelID getFunctionLabel(Scope::Function const& _function); @@ -94,13 +99,12 @@ private: AbstractAssembly& m_assembly; BuiltinContext& m_builtinContext; - bool m_useNamedLabelsForFunctions = true; CFG const& m_dfg; StackLayout const& m_stackLayout; Stack m_stack; std::map m_returnLabels; std::map m_blockLabels; - std::map m_functionLabels; + std::map const m_functionLabels; /// Set of blocks already generated. If any of the contained blocks is ever jumped to, m_blockLabels should /// contain a jump label for it. std::set m_generated; diff --git a/libyul/optimiser/StackCompressor.cpp b/libyul/optimiser/StackCompressor.cpp index a57d9738b..2deef5234 100644 --- a/libyul/optimiser/StackCompressor.cpp +++ b/libyul/optimiser/StackCompressor.cpp @@ -27,6 +27,13 @@ #include #include +#include +#include +#include + +#include +#include + #include #include @@ -162,6 +169,50 @@ void eliminateVariables( UnusedPruner::runUntilStabilised(_dialect, _node, _allowMSizeOptimization); } +void eliminateVariables( + Dialect const& _dialect, + Block& _block, + vector const& _unreachables, + bool _allowMSizeOptimization +) +{ + RematCandidateSelector selector{_dialect}; + selector(_block); + std::map candidates; + for (auto [cost, candidatesWithCost]: selector.candidates()) + for (auto candidate: candidatesWithCost) + candidates[get<0>(candidate)] = cost; + + set varsToEliminate; + + // TODO: this currently ignores the fact that variables may reference other variables we want to eliminate. + for (auto const& unreachable: _unreachables) + { + map> suitableCandidates; + size_t neededSlots = unreachable.deficit; + for (auto varName: unreachable.variableChoices) + { + if (varsToEliminate.count(varName)) + --neededSlots; + else if (size_t* cost = util::valueOrNullptr(candidates, varName)) + if (!util::contains(suitableCandidates[*cost], varName)) + suitableCandidates[*cost].emplace_back(varName); + } + for (auto candidatesByCost: suitableCandidates) + { + for (auto candidate: candidatesByCost.second) + if (neededSlots--) + varsToEliminate.emplace(candidate); + else + break; + if (!neededSlots) + break; + } + } + Rematerialiser::run(_dialect, _block, std::move(varsToEliminate), true); + UnusedPruner::runUntilStabilised(_dialect, _block, _allowMSizeOptimization); +} + } bool StackCompressor::run( @@ -176,39 +227,66 @@ bool StackCompressor::run( _object.code->statements.size() > 0 && holds_alternative(_object.code->statements.at(0)), "Need to run the function grouper before the stack compressor." ); + bool usesOptimizedCodeGenerator = false; + if (auto evmDialect = dynamic_cast(&_dialect)) + usesOptimizedCodeGenerator = + _optimizeStackAllocation && + evmDialect->evmVersion().canOverchargeGasForCall() && + evmDialect->providesObjectAccess(); bool allowMSizeOptimzation = !MSizeFinder::containsMSize(_dialect, *_object.code); - for (size_t iterations = 0; iterations < _maxIterations; iterations++) + if (usesOptimizedCodeGenerator) { - map stackSurplus = CompilabilityChecker(_dialect, _object, _optimizeStackAllocation).stackDeficit; - if (stackSurplus.empty()) - return true; - - if (stackSurplus.count(YulString{})) - { - yulAssert(stackSurplus.at({}) > 0, "Invalid surplus value."); - eliminateVariables( - _dialect, - std::get(_object.code->statements.at(0)), - static_cast(stackSurplus.at({})), - allowMSizeOptimzation - ); - } - + yul::AsmAnalysisInfo analysisInfo = yul::AsmAnalyzer::analyzeStrictAssertCorrect(_dialect, _object); + unique_ptr cfg = ControlFlowGraphBuilder::build(analysisInfo, _dialect, *_object.code); + Block& mainBlock = std::get(_object.code->statements.at(0)); + if ( + auto stackTooDeepErrors = StackLayoutGenerator::reportStackTooDeep(*cfg, YulString{}); + !stackTooDeepErrors.empty() + ) + eliminateVariables(_dialect, mainBlock, stackTooDeepErrors, allowMSizeOptimzation); for (size_t i = 1; i < _object.code->statements.size(); ++i) { auto& fun = std::get(_object.code->statements[i]); - if (!stackSurplus.count(fun.name)) - continue; - - yulAssert(stackSurplus.at(fun.name) > 0, "Invalid surplus value."); - eliminateVariables( - _dialect, - fun, - static_cast(stackSurplus.at(fun.name)), - allowMSizeOptimzation - ); + if ( + auto stackTooDeepErrors = StackLayoutGenerator::reportStackTooDeep(*cfg, fun.name); + !stackTooDeepErrors.empty() + ) + eliminateVariables(_dialect, fun.body, stackTooDeepErrors, allowMSizeOptimzation); } } + else + for (size_t iterations = 0; iterations < _maxIterations; iterations++) + { + map stackSurplus = CompilabilityChecker(_dialect, _object, _optimizeStackAllocation).stackDeficit; + if (stackSurplus.empty()) + return true; + + if (stackSurplus.count(YulString{})) + { + yulAssert(stackSurplus.at({}) > 0, "Invalid surplus value."); + eliminateVariables( + _dialect, + std::get(_object.code->statements.at(0)), + static_cast(stackSurplus.at({})), + allowMSizeOptimzation + ); + } + + for (size_t i = 1; i < _object.code->statements.size(); ++i) + { + auto& fun = std::get(_object.code->statements[i]); + if (!stackSurplus.count(fun.name)) + continue; + + yulAssert(stackSurplus.at(fun.name) > 0, "Invalid surplus value."); + eliminateVariables( + _dialect, + fun, + static_cast(stackSurplus.at(fun.name)), + allowMSizeOptimzation + ); + } + } return false; } diff --git a/libyul/optimiser/StackLimitEvader.cpp b/libyul/optimiser/StackLimitEvader.cpp index 1c7903b1f..b77bd4f38 100644 --- a/libyul/optimiser/StackLimitEvader.cpp +++ b/libyul/optimiser/StackLimitEvader.cpp @@ -21,14 +21,18 @@ #include #include #include +#include #include +#include #include +#include #include #include #include #include #include +#include #include #include @@ -114,6 +118,45 @@ u256 literalArgumentValue(FunctionCall const& _call) } } +void StackLimitEvader::run( + OptimiserStepContext& _context, + Object& _object +) +{ + auto const* evmDialect = dynamic_cast(&_context.dialect); + yulAssert( + evmDialect && evmDialect->providesObjectAccess(), + "StackLimitEvader can only be run on objects using the EVMDialect with object access." + ); + if (evmDialect && evmDialect->evmVersion().canOverchargeGasForCall()) + { + yul::AsmAnalysisInfo analysisInfo = yul::AsmAnalyzer::analyzeStrictAssertCorrect(*evmDialect, _object); + unique_ptr cfg = ControlFlowGraphBuilder::build(analysisInfo, *evmDialect, *_object.code); + run(_context, _object, StackLayoutGenerator::reportStackTooDeep(*cfg)); + } + else + run(_context, _object, CompilabilityChecker{ + _context.dialect, + _object, + true + }.unreachableVariables); + +} + +void StackLimitEvader::run( + OptimiserStepContext& _context, + Object& _object, + map> const& _stackTooDeepErrors +) +{ + map> unreachableVariables; + for (auto&& [function, stackTooDeepErrors]: _stackTooDeepErrors) + // TODO: choose wisely. + for (auto const& stackTooDeepError: stackTooDeepErrors) + unreachableVariables[function] += stackTooDeepError.variableChoices | ranges::views::take(stackTooDeepError.deficit) | ranges::to>; + run(_context, _object, unreachableVariables); +} + void StackLimitEvader::run( OptimiserStepContext& _context, Object& _object, diff --git a/libyul/optimiser/StackLimitEvader.h b/libyul/optimiser/StackLimitEvader.h index 4fc351f73..ae2d31c37 100644 --- a/libyul/optimiser/StackLimitEvader.h +++ b/libyul/optimiser/StackLimitEvader.h @@ -22,6 +22,7 @@ #pragma once #include +#include namespace solidity::yul { @@ -61,6 +62,25 @@ public: Object& _object, std::map> const& _unreachableVariables ); + /// @a _stackTooDeepErrors can be determined by the StackLayoutGenerator. + /// Can only be run on the EVM dialect with objects. + /// Abort and do nothing, if no ``memoryguard`` call or several ``memoryguard`` calls + /// with non-matching arguments are found, or if any of the @a _stackTooDeepErrors + /// are contained in a recursive function. + static void run( + OptimiserStepContext& _context, + Object& _object, + std::map> const& _stackTooDeepErrors + ); + /// Determines stack too deep errors using the appropriate code generation backend. + /// Can only be run on the EVM dialect with objects. + /// Abort and do nothing, if no ``memoryguard`` call or several ``memoryguard`` calls + /// with non-matching arguments are found, or if any of the unreachable variables + /// are contained in a recursive function. + static void run( + OptimiserStepContext& _context, + Object& _object + ); }; } diff --git a/libyul/optimiser/Suite.cpp b/libyul/optimiser/Suite.cpp index 5525e17d2..bd81f7c0b 100644 --- a/libyul/optimiser/Suite.cpp +++ b/libyul/optimiser/Suite.cpp @@ -95,6 +95,12 @@ void OptimiserSuite::run( set const& _externallyUsedIdentifiers ) { + EVMDialect const* evmDialect = dynamic_cast(&_dialect); + bool usesOptimizedCodeGenerator = + _optimizeStackAllocation && + evmDialect && + evmDialect->evmVersion().canOverchargeGasForCall() && + evmDialect->providesObjectAccess(); set reservedIdentifiers = _externallyUsedIdentifiers; reservedIdentifiers += _dialect.fixedFunctionNames(); @@ -121,24 +127,32 @@ void OptimiserSuite::run( // We ignore the return value because we will get a much better error // message once we perform code generation. - StackCompressor::run( - _dialect, - _object, - _optimizeStackAllocation, - stackCompressorMaxIterations - ); + if (!usesOptimizedCodeGenerator) + StackCompressor::run( + _dialect, + _object, + _optimizeStackAllocation, + stackCompressorMaxIterations + ); suite.runSequence("fDnTOc g", ast); - if (EVMDialect const* dialect = dynamic_cast(&_dialect)) + if (evmDialect) { yulAssert(_meter, ""); - ConstantOptimiser{*dialect, *_meter}(ast); - if (dialect->providesObjectAccess() && _optimizeStackAllocation) - StackLimitEvader::run(suite.m_context, _object, CompilabilityChecker{ + ConstantOptimiser{*evmDialect, *_meter}(ast); + if (usesOptimizedCodeGenerator) + { + StackCompressor::run( _dialect, _object, - _optimizeStackAllocation - }.unreachableVariables); + _optimizeStackAllocation, + stackCompressorMaxIterations + ); + if (evmDialect->providesObjectAccess()) + StackLimitEvader::run(suite.m_context, _object); + } + else if (evmDialect->providesObjectAccess() && _optimizeStackAllocation) + StackLimitEvader::run(suite.m_context, _object); } else if (dynamic_cast(&_dialect)) { diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output index 31b0ae463..1b90e94a3 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output @@ -66,7 +66,7 @@ IR: object "C_6" { code { /// @src 0:60:101 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_6() @@ -97,7 +97,7 @@ object "C_6" { object "C_6_deployed" { code { /// @src 0:60:101 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -182,11 +182,12 @@ object "C_6" { code { { /// @src 0:60:101 "contract C {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_6_deployed") - codecopy(128, dataoffset("C_6_deployed"), _1) - return(128, _1) + let _2 := datasize("C_6_deployed") + codecopy(_1, dataoffset("C_6_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"debug_info_in_yul_and_evm_asm_print_all/input.sol" @@ -194,15 +195,16 @@ object "C_6" { code { { /// @src 0:60:101 "contract C {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output index 4d7210d37..86968e71b 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output @@ -66,7 +66,7 @@ IR: object "C_6" { code { /// @src 0:60:101 - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_6() @@ -97,7 +97,7 @@ object "C_6" { object "C_6_deployed" { code { /// @src 0:60:101 - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -181,11 +181,12 @@ object "C_6" { code { { /// @src 0:60:101 - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_6_deployed") - codecopy(128, dataoffset("C_6_deployed"), _1) - return(128, _1) + let _2 := datasize("C_6_deployed") + codecopy(_1, dataoffset("C_6_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"debug_info_in_yul_and_evm_asm_print_location_only/input.sol" @@ -193,15 +194,16 @@ object "C_6" { code { { /// @src 0:60:101 - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output index 0c0fbfa1e..6a87b0b46 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output @@ -63,7 +63,7 @@ IR: object "C_6" { code { - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_6() @@ -90,7 +90,7 @@ object "C_6" { object "C_6_deployed" { code { - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -171,26 +171,28 @@ Optimized IR: object "C_6" { code { { - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_6_deployed") - codecopy(128, dataoffset("C_6_deployed"), _1) - return(128, _1) + let _2 := datasize("C_6_deployed") + codecopy(_1, dataoffset("C_6_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"debug_info_in_yul_and_evm_asm_print_none/input.sol" object "C_6_deployed" { code { { - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output b/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output index b595a771e..ae3ee1735 100644 --- a/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output +++ b/test/cmdlineTests/debug_info_in_yul_snippet_escaping/output @@ -11,7 +11,7 @@ IR: object "C_2" { code { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_2() @@ -42,7 +42,7 @@ object "C_2" { object "C_2_deployed" { code { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(128)) revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() @@ -82,11 +82,12 @@ object "C_2" { code { { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_2_deployed") - codecopy(128, dataoffset("C_2_deployed"), _1) - return(128, _1) + let _2 := datasize("C_2_deployed") + codecopy(_1, dataoffset("C_2_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol" @@ -94,7 +95,7 @@ object "C_2" { code { { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -115,7 +116,7 @@ IR: object "D_27" { code { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_D_27() @@ -146,7 +147,7 @@ object "D_27" { object "D_27_deployed" { code { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -372,7 +373,7 @@ object "D_27" { object "C_2" { code { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_2() @@ -403,7 +404,7 @@ object "D_27" { object "C_2_deployed" { code { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(128)) revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() @@ -448,11 +449,12 @@ object "D_27" { code { { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("D_27_deployed") - codecopy(128, dataoffset("D_27_deployed"), _1) - return(128, _1) + let _2 := datasize("D_27_deployed") + codecopy(_1, dataoffset("D_27_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol" @@ -460,26 +462,25 @@ object "D_27" { code { { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } /// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." - let _2 := datasize("C_2") - let _3 := add(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 128, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _2) - if or(gt(_3, 0xffffffffffffffff), lt(_3, /** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 128)) - /// @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." - { panic_error_0x41() } - datacopy(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ 128, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ dataoffset("C_2"), _2) - if iszero(create(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ _1, 128, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _2)) + let _3 := datasize("C_2") + let _4 := add(_1, _3) + if or(gt(_4, 0xffffffffffffffff), lt(_4, _1)) { panic_error_0x41() } + datacopy(_1, dataoffset("C_2"), _3) + if iszero(create(/** @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." */ _2, /** @src 0:446:491 "new /// @src 0:149:156 \"new C()\"..." */ _1, sub(_4, _1))) { /// @src 0:279:599 "contract D /** @src 0:96:165 \"contract D {...\" *\/ {..." let pos := mload(64) - returndatacopy(pos, _1, returndatasize()) + returndatacopy(pos, _2, returndatasize()) revert(pos, returndatasize()) } mstore(add(allocate_memory_array_string(), 32), "/*") @@ -539,11 +540,12 @@ object "D_27" { code { { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_2_deployed") - codecopy(128, dataoffset("C_2_deployed"), _1) - return(128, _1) + let _2 := datasize("C_2_deployed") + codecopy(_1, dataoffset("C_2_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"debug_info_in_yul_snippet_escaping/input.sol" @@ -551,7 +553,7 @@ object "D_27" { code { { /// @src 0:265:278 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/exp_base_literal/output b/test/cmdlineTests/exp_base_literal/output index 9c3efdc1f..77893da18 100644 --- a/test/cmdlineTests/exp_base_literal/output +++ b/test/cmdlineTests/exp_base_literal/output @@ -11,7 +11,7 @@ IR: object "C_81" { code { /// @src 0:82:370 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_81() @@ -42,7 +42,7 @@ object "C_81" { object "C_81_deployed" { code { /// @src 0:82:370 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/function_debug_info_via_yul/output b/test/cmdlineTests/function_debug_info_via_yul/output index 8b952a9e9..495c82d5b 100644 --- a/test/cmdlineTests/function_debug_info_via_yul/output +++ b/test/cmdlineTests/function_debug_info_via_yul/output @@ -13,7 +13,7 @@ }, "calldata_array_index_access_uint256_dyn_calldata": { - "entryPoint": 168, + "entryPoint": 152, "parameterSlots": 2, "returnSlots": 1 } diff --git a/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output b/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output index 12c61e783..330e208f4 100644 --- a/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output +++ b/test/cmdlineTests/ir_compiler_inheritance_nosubobjects/output @@ -11,11 +11,12 @@ object "C_7" { code { { /// @src 0:82:117 "contract C {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_7_deployed") - codecopy(128, dataoffset("C_7_deployed"), _1) - return(128, _1) + let _2 := datasize("C_7_deployed") + codecopy(_1, dataoffset("C_7_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol" @@ -23,7 +24,7 @@ object "C_7" { code { { /// @src 0:82:117 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -44,11 +45,12 @@ object "D_10" { code { { /// @src 0:118:137 "contract D is C {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("D_10_deployed") - codecopy(128, dataoffset("D_10_deployed"), _1) - return(128, _1) + let _2 := datasize("D_10_deployed") + codecopy(_1, dataoffset("D_10_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"ir_compiler_inheritance_nosubobjects/input.sol" @@ -56,7 +58,7 @@ object "D_10" { code { { /// @src 0:118:137 "contract D is C {..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/ir_compiler_subobjects/output b/test/cmdlineTests/ir_compiler_subobjects/output index 8c23c8ad7..fbedf38db 100644 --- a/test/cmdlineTests/ir_compiler_subobjects/output +++ b/test/cmdlineTests/ir_compiler_subobjects/output @@ -11,11 +11,12 @@ object "C_3" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_3_deployed") - codecopy(128, dataoffset("C_3_deployed"), _1) - return(128, _1) + let _2 := datasize("C_3_deployed") + codecopy(_1, dataoffset("C_3_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"ir_compiler_subobjects/input.sol" @@ -23,7 +24,7 @@ object "C_3" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -44,11 +45,12 @@ object "D_16" { code { { /// @src 0:96:165 "contract D {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("D_16_deployed") - codecopy(128, dataoffset("D_16_deployed"), _1) - return(128, _1) + let _2 := datasize("D_16_deployed") + codecopy(_1, dataoffset("D_16_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"ir_compiler_subobjects/input.sol" @@ -56,35 +58,35 @@ object "D_16" { code { { /// @src 0:96:165 "contract D {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - /// @src 0:149:156 "new C()" - let _2 := datasize("C_3") - let _3 := add(/** @src 0:96:165 "contract D {..." */ 128, /** @src 0:149:156 "new C()" */ _2) - if or(gt(_3, 0xffffffffffffffff), lt(_3, /** @src 0:96:165 "contract D {..." */ 128)) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } /// @src 0:149:156 "new C()" + let _3 := datasize("C_3") + let _4 := add(_1, _3) + if or(gt(_4, 0xffffffffffffffff), lt(_4, _1)) { /// @src 0:96:165 "contract D {..." - mstore(_1, shl(224, 0x4e487b71)) + mstore(_2, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_1, 0x24) + revert(_2, 0x24) } /// @src 0:149:156 "new C()" - datacopy(/** @src 0:96:165 "contract D {..." */ 128, /** @src 0:149:156 "new C()" */ dataoffset("C_3"), _2) - if iszero(create(/** @src 0:96:165 "contract D {..." */ _1, 128, /** @src 0:149:156 "new C()" */ _2)) + datacopy(_1, dataoffset("C_3"), _3) + if iszero(create(/** @src 0:96:165 "contract D {..." */ _2, /** @src 0:149:156 "new C()" */ _1, sub(_4, _1))) { /// @src 0:96:165 "contract D {..." let pos := mload(64) - returndatacopy(pos, _1, returndatasize()) + returndatacopy(pos, _2, returndatasize()) revert(pos, returndatasize()) } - return(mload(64), _1) + return(mload(64), _2) } } revert(0, 0) @@ -95,11 +97,12 @@ object "D_16" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_3_deployed") - codecopy(128, dataoffset("C_3_deployed"), _1) - return(128, _1) + let _2 := datasize("C_3_deployed") + codecopy(_1, dataoffset("C_3_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"ir_compiler_subobjects/input.sol" @@ -107,7 +110,7 @@ object "D_16" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output b/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output index 930899aea..34b72f8b8 100644 --- a/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output +++ b/test/cmdlineTests/ir_with_assembly_no_memoryguard_creation/output @@ -23,15 +23,16 @@ object "D_12" { code { { /// @src 0:82:161 "contract D {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output b/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output index da6540fa7..cc95451e6 100644 --- a/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output +++ b/test/cmdlineTests/ir_with_assembly_no_memoryguard_runtime/output @@ -11,11 +11,12 @@ object "D_8" { code { { /// @src 0:82:153 "contract D {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("D_8_deployed") - codecopy(128, dataoffset("D_8_deployed"), _1) - return(128, _1) + let _2 := datasize("D_8_deployed") + codecopy(_1, dataoffset("D_8_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"ir_with_assembly_no_memoryguard_runtime/input.sol" diff --git a/test/cmdlineTests/keccak_optimization_low_runs/output b/test/cmdlineTests/keccak_optimization_low_runs/output index 25b678ee0..f5df14027 100644 --- a/test/cmdlineTests/keccak_optimization_low_runs/output +++ b/test/cmdlineTests/keccak_optimization_low_runs/output @@ -11,11 +11,12 @@ object "C_7" { code { { /// @src 0:62:285 "contract C {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_7_deployed") - codecopy(128, dataoffset("C_7_deployed"), _1) - return(128, _1) + let _2 := datasize("C_7_deployed") + codecopy(_1, dataoffset("C_7_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"keccak_optimization_low_runs/input.sol" diff --git a/test/cmdlineTests/name_simplifier/output b/test/cmdlineTests/name_simplifier/output index 44852d1a8..57a4cb594 100644 --- a/test/cmdlineTests/name_simplifier/output +++ b/test/cmdlineTests/name_simplifier/output @@ -11,11 +11,12 @@ object "C_59" { code { { /// @src 0:346:625 "contract C {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_59_deployed") - codecopy(128, dataoffset("C_59_deployed"), _1) - return(128, _1) + let _2 := datasize("C_59_deployed") + codecopy(_1, dataoffset("C_59_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"name_simplifier/input.sol" @@ -23,7 +24,7 @@ object "C_59" { code { { /// @src 0:346:625 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { let _1 := 0 diff --git a/test/cmdlineTests/object_compiler/output b/test/cmdlineTests/object_compiler/output index eb8a3286e..93d7b7795 100644 --- a/test/cmdlineTests/object_compiler/output +++ b/test/cmdlineTests/object_compiler/output @@ -23,7 +23,7 @@ object "MyContract" { Binary representation: -33600055600b806011600039806000f3fe60005460005260206000f3 +33600055600b8060106000396000f3fe60005460005260206000f3 Text representation: /* "object_compiler/input.yul":128:136 */ @@ -34,15 +34,13 @@ Text representation: sstore /* "object_compiler/input.yul":240:259 */ dataSize(sub_0) - dup1 /* "object_compiler/input.yul":217:238 */ + dup1 dataOffset(sub_0) /* "object_compiler/input.yul":125:126 */ 0x00 /* "object_compiler/input.yul":205:260 */ codecopy - /* "object_compiler/input.yul":275:294 */ - dup1 /* "object_compiler/input.yul":125:126 */ 0x00 /* "object_compiler/input.yul":265:295 */ diff --git a/test/cmdlineTests/optimizer_array_sload/output b/test/cmdlineTests/optimizer_array_sload/output index 448b0badc..8404525f8 100644 --- a/test/cmdlineTests/optimizer_array_sload/output +++ b/test/cmdlineTests/optimizer_array_sload/output @@ -11,11 +11,12 @@ object "Arraysum_34" { code { { /// @src 0:80:429 "contract Arraysum {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("Arraysum_34_deployed") - codecopy(128, dataoffset("Arraysum_34_deployed"), _1) - return(128, _1) + let _2 := datasize("Arraysum_34_deployed") + codecopy(_1, dataoffset("Arraysum_34_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"optimizer_array_sload/input.sol" @@ -23,7 +24,7 @@ object "Arraysum_34" { code { { /// @src 0:80:429 "contract Arraysum {..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { let _1 := 0 diff --git a/test/cmdlineTests/revert_strings/output b/test/cmdlineTests/revert_strings/output index 9ca27eac4..d13f9f4e5 100644 --- a/test/cmdlineTests/revert_strings/output +++ b/test/cmdlineTests/revert_strings/output @@ -11,7 +11,7 @@ IR: object "C_15" { code { /// @src 0:59:147 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_15() @@ -57,7 +57,7 @@ object "C_15" { object "C_15_deployed" { code { /// @src 0:59:147 "contract C {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json b/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json index 3b25e108a..0c529109a 100644 --- a/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json @@ -1,297 +1,298 @@ {"contracts":{"C":{"C":{"evm":{"assembly":" /* \"C\":79:428 contract C... */ - mstore(0x40, 0xa0) - jumpi(tag_2, iszero(callvalue)) - 0x00 + 0xa0 dup1 - revert -tag_2: + 0x40 + mstore + jumpi(tag_6, callvalue) + 0x1f bytecodeSize codesize dup2 swap1 sub - 0xa0 - 0x1f + swap2 dup3 add not(0x1f) and - dup2 + dup4 add - swap1 + swap2 sub(shl(0x40, 0x01), 0x01) - dup3 + dup4 gt - swap1 - dup3 + dup5 + dup5 lt or - iszero - tag_3 - jumpi - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, 0x41) - revert(0x00, 0x24) -tag_3: - 0x40 - mstore - dup1 - dup3 - 0xa0 - codecopy - 0x20 - dup2 - slt - iszero tag_4 jumpi - 0x00 dup1 - revert -tag_4: - pop - pop - tag_5 - mload(0xa0) + dup5 + swap3 + 0x20 + swap5 + 0x40 + mstore + dup4 + codecopy + dup2 + add + sub + slt + tag_6 + jumpi + mload /* \"C\":147:149 42 */ mstore(0x80, 0x2a) /* \"C\":203:219 stateVar = _init */ 0x00 /* \"C\":79:428 contract C... */ sstore - /* \"C\":175:223 constructor(int _init)... */ - jump - /* \"C\":79:428 contract C... */ -tag_5: mload(0x40) dataSize(sub_0) - dup1 + swap1 + dup2 dataOffset(sub_0) - dup4 + dup3 codecopy mload(0x80) - dup3 + dup2 assignImmutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") - dup1 - dup3 return +tag_6: + pop + 0x00 + dup1 + revert +tag_4: + pop + pop + pop + pop + mstore(0x00, shl(0xe0, 0x4e487b71)) + mstore(0x04, 0x41) + revert(0x00, 0x24) stop sub_0: assembly { /* \"C\":79:428 contract C... */ mstore(0x40, 0x80) - jumpi(tag_8, lt(calldatasize, 0x04)) + jumpi(tag_8, iszero(lt(calldatasize, 0x04))) + 0x00 + dup1 + revert + tag_8: 0x00 dup1 calldataload 0xe0 shr + dup1 0x26121ff0 - dup2 eq tag_10 jumpi + dup1 0x793816ec - dup2 - eq - tag_11 - jumpi - 0x9942ec6f - dup2 eq tag_12 jumpi - jump(tag_9) - tag_10: - jumpi(tag_13, iszero(callvalue)) - dup2 - dup3 - revert - tag_13: + 0x9942ec6f + eq tag_14 - calldatasize - tag_1 - jump\t// in - tag_14: - /* \"C\":279:298 constVar + immutVar */ - tag_15 - /* \"C\":290:298 immutVar */ - immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") - /* \"C\":279:298 constVar + immutVar */ - tag_4 - jump\t// in - tag_15: - /* \"C\":79:428 contract C... */ - mload(0x40) - dup2 - dup2 - mstore - 0x20 - dup2 - return - tag_11: - jumpi(tag_17, iszero(callvalue)) - dup2 - dup3 + jumpi + pop + 0x00 + dup1 revert - tag_17: + tag_14: + jumpi(tag_16, callvalue) + pop tag_18 calldatasize tag_1 jump\t// in tag_18: - dup2 - sload + tag_19 + /* \"C\":375:378 int */ + tag_20 + tag_6 + jump\t// in + tag_20: + /* \"C\":79:428 contract C... */ mload(0x40) - dup2 + swap1 dup2 mstore + swap1 + dup2 + swap1 0x20 - dup2 - return - tag_12: - jumpi(tag_20, iszero(callvalue)) - dup2 dup3 + add + swap1 + jump + tag_19: + sub + swap1 + return + tag_16: + dup1 revert - tag_20: - tag_21 + tag_12: + pop + jumpi(tag_16, callvalue) + tag_19 + swap1 + tag_24 calldatasize tag_1 jump\t// in - tag_21: - /* \"C\":375:378 int */ - tag_15 - tag_6 - jump\t// in - /* \"C\":79:428 contract C... */ - tag_9: - pop - pop - tag_8: - 0x00 - dup1 - revert - tag_1: - 0x00 - not(0x03) + tag_24: + sload + mload(0x40) + swap1 + dup2 + mstore + swap1 + dup2 + swap1 + 0x20 dup3 add + swap1 + jump + tag_10: + pop + jumpi(tag_16, callvalue) + pop + tag_27 + calldatasize + tag_1 + jump\t// in + tag_27: + tag_19 + /* \"C\":279:298 constVar + immutVar */ + tag_20 + /* \"C\":290:298 immutVar */ + immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") + /* \"C\":279:298 constVar + immutVar */ + tag_4 + jump\t// in + /* \"C\":79:428 contract C... */ + tag_1: + 0x00 + swap1 + not(0x03) + add slt - iszero - tag_26 + tag_30 jumpi + jump\t// out + tag_30: + pop 0x00 dup1 revert - tag_26: - pop - jump\t// out /* \"C\":117:119 41 */ tag_3: + pop mstore(0x00, shl(0xe0, 0x4e487b71)) mstore(0x04, 0x11) revert(0x00, 0x24) tag_4: - 0x00 sub(shl(0xff, 0x01), 0x2a) - dup3 + dup2 sgt 0x01 and - iszero - tag_31 + tag_32 jumpi - tag_31 - tag_3 - jump\t// in - tag_31: - pop + tag_33: 0x29 add swap1 jump\t// out - tag_5: - 0x00 - dup1 - dup3 - slt - dup1 - iszero - sub(shl(0xff, 0x01), 0x01) - dup5 - swap1 - sub - dup6 - sgt - and - iszero - tag_34 - jumpi + tag_32: tag_34 tag_3 jump\t// in tag_34: - shl(0xff, 0x01) + jump(tag_33) + tag_5: + 0x00 + dup2 + slt + dup1 + iszero + sub(shl(0xff, 0x01), 0x01) dup4 swap1 sub dup5 - slt - dup2 + sgt and - iszero - tag_36 + tag_35 jumpi - tag_36 - tag_3 - jump\t// in tag_36: - pop - pop + shl(0xff, 0x01) + dup3 + swap1 + sub + dup4 + slt + and + tag_37 + jumpi add swap1 jump\t// out + tag_37: + tag_39 + tag_3 + jump\t// in + tag_39: + add + swap1 + jump\t// out + tag_35: + tag_40 + tag_3 + jump\t// in + tag_40: + jump(tag_36) /* \"C\":304:341 modifier m()... */ tag_6: - 0x00 /* \"C\":79:428 contract C... */ + 0x00 dup1 sload - /* \"C\":304:341 modifier m()... */ - dup2 + /* \"C\":117:119 41 */ + 0x01 swap1 sub(shl(0xff, 0x01), 0x01) /* \"C\":79:428 contract C... */ dup2 eq - iszero - tag_39 + tag_41 jumpi - tag_39 - tag_3 - jump\t// in - tag_39: - /* \"C\":117:119 41 */ - 0x01 + /* \"C\":304:341 modifier m()... */ + tag_42: /* \"C\":79:428 contract C... */ add - dup1 - dup3 + swap1 + dup2 + dup2 sstore /* \"C\":403:407 this */ address /* \"C\":403:411 this.f() */ extcodesize - tag_40 + iszero + tag_43 jumpi /* \"C\":79:428 contract C... */ - dup2 - dup3 - revert - /* \"C\":403:411 this.f() */ - tag_40: - /* \"C\":79:428 contract C... */ mload(0x40) shl(0xe4, 0x026121ff) /* \"C\":403:411 this.f() */ @@ -309,47 +310,95 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ gas staticcall - dup1 - tag_41 - jumpi - /* \"C\":79:428 contract C... */ - mload(0x40) - returndatasize - dup6 + swap2 dup3 - returndatacopy - returndatasize - dup2 - revert - /* \"C\":403:411 this.f() */ - tag_41: - /* \"C\":79:428 contract C... */ - dup4 - /* \"C\":403:411 this.f() */ - dup2 iszero - tag_42 + tag_45 jumpi + dup1 + swap3 + tag_47 + jumpi + /* \"C\":304:341 modifier m()... */ + tag_48: + /* \"C\":392:411 stateVar + this.f() */ + pop + pop + tag_49 + swap1 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_50 + /* \"C\":392:411 stateVar + this.f() */ + swap3 + tag_5 + jump\t// in + tag_49: + /* \"C\":414:422 immutVar */ + immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") + /* \"C\":392:422 stateVar + this.f() + immutVar */ + swap1 + tag_5 + jump\t// in + tag_50: + /* \"C\":304:341 modifier m()... */ + swap1 + jump\t// out + /* \"C\":403:411 this.f() */ + tag_47: + /* \"C\":79:428 contract C... */ + swap1 + swap2 + pop + /* \"C\":403:411 this.f() */ returndatasize /* \"C\":79:428 contract C... */ 0x1f add not(0x1f) and - dup4 - add - 0xffffffffffffffff - dup2 - gt - dup5 dup3 + add + swap1 + 0xffffffffffffffff + dup3 + gt + dup4 + dup4 lt or - iszero - tag_43 + tag_51 jumpi + pop + swap2 + /* \"C\":403:411 this.f() */ + tag_53 + /* \"C\":392:411 stateVar + this.f() */ + tag_49 + /* \"C\":79:428 contract C... */ + swap3 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_50 + /* \"C\":79:428 contract C... */ + swap5 + 0x40 + mstore + /* \"C\":403:411 this.f() */ + returndatasize + dup2 + add + swap1 + tag_7 + jump\t// in + tag_53: + swap2 + dup2 + swap4 + pop + jump(tag_48) + /* \"C\":79:428 contract C... */ + tag_51: shl(0xe0, 0x4e487b71) - dup7 + dup2 mstore 0x41 /* \"C\":403:411 this.f() */ @@ -357,146 +406,141 @@ sub_0: assembly { /* \"C\":79:428 contract C... */ mstore 0x24 - dup7 - revert - tag_43: - 0x40 - mstore - /* \"C\":403:411 this.f() */ - tag_44 - returndatasize - dup5 - add - dup5 - tag_7 - jump\t// in - tag_44: - swap1 - pop - tag_42: - /* \"C\":392:411 stateVar + this.f() */ - tag_45 - dup2 - dup6 - tag_5 - jump\t// in - tag_45: swap5 pop + /* \"C\":117:119 41 */ + swap3 + pop + pop + pop + /* \"C\":79:428 contract C... */ + revert + /* \"C\":403:411 this.f() */ + tag_45: + /* \"C\":79:428 contract C... */ + swap4 pop pop pop pop - /* \"C\":392:422 stateVar + this.f() + immutVar */ - tag_46 - /* \"C\":414:422 immutVar */ - immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") - /* \"C\":392:422 stateVar + this.f() + immutVar */ + mload(0x40) + swap1 + returndatasize + swap1 dup3 - tag_5 - jump\t// in - tag_46: - /* \"C\":336:337 _ */ + returndatacopy + returndatasize + swap1 + revert + /* \"C\":403:411 this.f() */ + tag_43: + /* \"C\":79:428 contract C... */ swap2 pop pop - /* \"C\":304:341 modifier m()... */ - swap1 - jump\t// out - /* \"C\":79:428 contract C... */ + dup1 + revert + tag_41: + tag_54 + tag_3 + jump\t// in + tag_54: + jump(tag_42) tag_7: - 0x00 + swap1 + dup2 0x20 - dup3 - dup5 + swap2 sub slt - iszero - tag_48 + tag_55 jumpi + mload + swap1 + jump\t// out + tag_55: + pop + pop 0x00 dup1 revert - tag_48: - pop - mload - swap2 - swap1 - pop - jump\t// out auxdata: } "}}},"D":{"D":{"evm":{"assembly":" /* \"D\":91:166 contract D is C(3)... */ - mstore(0x40, 0xa0) - jumpi(tag_2, iszero(callvalue)) - 0x00 + 0xa0 dup1 - revert -tag_2: + 0x40 + mstore + jumpi(tag_6, callvalue) + 0x1f bytecodeSize codesize dup2 swap1 sub - 0xa0 - 0x1f + swap2 dup3 add not(0x1f) and - dup2 + dup4 add - swap1 + swap2 sub(shl(0x40, 0x01), 0x01) - dup3 + dup4 gt - swap1 - dup3 + dup5 + dup5 lt or - iszero - tag_3 - jumpi - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, 0x41) - revert(0x00, 0x24) -tag_3: - 0x40 - mstore - dup1 - dup3 - 0xa0 - codecopy - 0x20 - dup2 - slt - iszero tag_4 jumpi + dup1 + dup5 + swap3 + 0x20 + swap5 + 0x40 + mstore + dup4 + codecopy + dup2 + add + sub + slt + tag_6 + jumpi + tag_8 + swap1 + mload + tag_1 + jump\t// in +tag_8: + mload(0x40) + dataSize(sub_0) + swap1 + dup2 + dataOffset(sub_0) + dup3 + codecopy + mload(0x80) + dup2 + assignImmutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") + return +tag_6: + pop 0x00 dup1 revert tag_4: pop pop - tag_5 - mload(0xa0) - tag_1 - jump\t// in -tag_5: - mload(0x40) - dataSize(sub_0) - dup1 - dataOffset(sub_0) - dup4 - codecopy - mload(0x80) - dup3 - assignImmutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") - dup1 - dup3 - return + pop + pop + mstore(0x00, shl(0xe0, 0x4e487b71)) + mstore(0x04, 0x41) + revert(0x00, 0x24) /* \"D\":113:164 constructor(int _init2)... */ tag_1: /* \"C\":147:149 42 */ @@ -512,9 +556,22 @@ tag_1: sgt 0x01 and - iszero - tag_8 + tag_9 jumpi + /* \"D\":107:108 3 */ + 0x03 + /* \"D\":91:166 contract D is C(3)... */ + add + /* \"C\":203:219 stateVar = _init */ + 0x00 + /* \"D\":91:166 contract D is C(3)... */ + sstore + /* \"D\":113:164 constructor(int _init2)... */ + jump\t// out + /* \"D\":91:166 contract D is C(3)... */ +tag_9: + pop + pop shl(0xe0, 0x4e487b71) /* \"C\":203:219 stateVar = _init */ 0x00 @@ -526,234 +583,226 @@ tag_1: 0x00 /* \"D\":91:166 contract D is C(3)... */ revert -tag_8: - /* \"D\":107:108 3 */ - 0x03 - /* \"D\":91:166 contract D is C(3)... */ - add - /* \"C\":203:219 stateVar = _init */ - 0x00 - /* \"D\":91:166 contract D is C(3)... */ - sstore - /* \"D\":113:164 constructor(int _init2)... */ - jump\t// out stop sub_0: assembly { /* \"D\":91:166 contract D is C(3)... */ mstore(0x40, 0x80) - jumpi(tag_8, lt(calldatasize, 0x04)) + jumpi(tag_8, iszero(lt(calldatasize, 0x04))) + 0x00 + dup1 + revert + tag_8: 0x00 dup1 calldataload 0xe0 shr + dup1 0x26121ff0 - dup2 eq tag_10 jumpi + dup1 0x793816ec - dup2 - eq - tag_11 - jumpi - 0x9942ec6f - dup2 eq tag_12 jumpi - jump(tag_9) - tag_10: - jumpi(tag_13, iszero(callvalue)) - dup2 - dup3 - revert - tag_13: + 0x9942ec6f + eq tag_14 - calldatasize - tag_1 - jump\t// in - tag_14: - /* \"C\":279:298 constVar + immutVar */ - tag_15 - /* \"C\":290:298 immutVar */ - immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") - /* \"C\":279:298 constVar + immutVar */ - tag_4 - jump\t// in - tag_15: - /* \"D\":91:166 contract D is C(3)... */ - mload(0x40) - dup2 - dup2 - mstore - 0x20 - dup2 - return - tag_11: - jumpi(tag_17, iszero(callvalue)) - dup2 - dup3 + jumpi + pop + 0x00 + dup1 revert - tag_17: + tag_14: + jumpi(tag_16, callvalue) + pop tag_18 calldatasize tag_1 jump\t// in tag_18: - dup2 - sload + tag_19 + /* \"C\":375:378 int */ + tag_20 + tag_6 + jump\t// in + tag_20: + /* \"D\":91:166 contract D is C(3)... */ mload(0x40) - dup2 + swap1 dup2 mstore + swap1 + dup2 + swap1 0x20 - dup2 - return - tag_12: - jumpi(tag_20, iszero(callvalue)) - dup2 dup3 + add + swap1 + jump + tag_19: + sub + swap1 + return + tag_16: + dup1 revert - tag_20: - tag_21 + tag_12: + pop + jumpi(tag_16, callvalue) + tag_19 + swap1 + tag_24 calldatasize tag_1 jump\t// in - tag_21: - /* \"C\":375:378 int */ - tag_15 - tag_6 - jump\t// in - /* \"D\":91:166 contract D is C(3)... */ - tag_9: - pop - pop - tag_8: - 0x00 - dup1 - revert - tag_1: - 0x00 - not(0x03) + tag_24: + sload + mload(0x40) + swap1 + dup2 + mstore + swap1 + dup2 + swap1 + 0x20 dup3 add + swap1 + jump + tag_10: + pop + jumpi(tag_16, callvalue) + pop + tag_27 + calldatasize + tag_1 + jump\t// in + tag_27: + tag_19 + /* \"C\":279:298 constVar + immutVar */ + tag_20 + /* \"C\":290:298 immutVar */ + immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") + /* \"C\":279:298 constVar + immutVar */ + tag_4 + jump\t// in + /* \"D\":91:166 contract D is C(3)... */ + tag_1: + 0x00 + swap1 + not(0x03) + add slt - iszero - tag_26 + tag_30 jumpi + jump\t// out + tag_30: + pop 0x00 dup1 revert - tag_26: - pop - jump\t// out /* \"C\":117:119 41 */ tag_3: + pop mstore(0x00, shl(0xe0, 0x4e487b71)) mstore(0x04, 0x11) revert(0x00, 0x24) tag_4: - 0x00 sub(shl(0xff, 0x01), 0x2a) - dup3 + dup2 sgt 0x01 and - iszero - tag_31 + tag_32 jumpi - tag_31 - tag_3 - jump\t// in - tag_31: - pop + tag_33: 0x29 add swap1 jump\t// out - tag_5: - 0x00 - dup1 - dup3 - slt - dup1 - iszero - sub(shl(0xff, 0x01), 0x01) - dup5 - swap1 - sub - dup6 - sgt - and - iszero - tag_34 - jumpi + tag_32: tag_34 tag_3 jump\t// in tag_34: - shl(0xff, 0x01) + jump(tag_33) + tag_5: + 0x00 + dup2 + slt + dup1 + iszero + sub(shl(0xff, 0x01), 0x01) dup4 swap1 sub dup5 - slt - dup2 + sgt and - iszero - tag_36 + tag_35 jumpi - tag_36 - tag_3 - jump\t// in tag_36: - pop - pop + shl(0xff, 0x01) + dup3 + swap1 + sub + dup4 + slt + and + tag_37 + jumpi add swap1 jump\t// out + tag_37: + tag_39 + tag_3 + jump\t// in + tag_39: + add + swap1 + jump\t// out + tag_35: + tag_40 + tag_3 + jump\t// in + tag_40: + jump(tag_36) /* \"C\":304:341 modifier m()... */ tag_6: - 0x00 /* \"D\":91:166 contract D is C(3)... */ + 0x00 dup1 sload - /* \"C\":304:341 modifier m()... */ - dup2 + /* \"C\":117:119 41 */ + 0x01 swap1 sub(shl(0xff, 0x01), 0x01) /* \"D\":91:166 contract D is C(3)... */ dup2 eq - iszero - tag_39 + tag_41 jumpi - tag_39 - tag_3 - jump\t// in - tag_39: - /* \"C\":117:119 41 */ - 0x01 + /* \"C\":304:341 modifier m()... */ + tag_42: /* \"D\":91:166 contract D is C(3)... */ add - dup1 - dup3 + swap1 + dup2 + dup2 sstore /* \"C\":403:407 this */ address /* \"C\":403:411 this.f() */ extcodesize - tag_40 + iszero + tag_43 jumpi /* \"D\":91:166 contract D is C(3)... */ - dup2 - dup3 - revert - /* \"C\":403:411 this.f() */ - tag_40: - /* \"D\":91:166 contract D is C(3)... */ mload(0x40) shl(0xe4, 0x026121ff) /* \"C\":403:411 this.f() */ @@ -771,47 +820,95 @@ sub_0: assembly { /* \"C\":403:411 this.f() */ gas staticcall - dup1 - tag_41 - jumpi - /* \"D\":91:166 contract D is C(3)... */ - mload(0x40) - returndatasize - dup6 + swap2 dup3 - returndatacopy - returndatasize - dup2 - revert - /* \"C\":403:411 this.f() */ - tag_41: - /* \"D\":91:166 contract D is C(3)... */ - dup4 - /* \"C\":403:411 this.f() */ - dup2 iszero - tag_42 + tag_45 jumpi + dup1 + swap3 + tag_47 + jumpi + /* \"C\":304:341 modifier m()... */ + tag_48: + /* \"C\":392:411 stateVar + this.f() */ + pop + pop + tag_49 + swap1 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_50 + /* \"C\":392:411 stateVar + this.f() */ + swap3 + tag_5 + jump\t// in + tag_49: + /* \"C\":414:422 immutVar */ + immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") + /* \"C\":392:422 stateVar + this.f() + immutVar */ + swap1 + tag_5 + jump\t// in + tag_50: + /* \"C\":304:341 modifier m()... */ + swap1 + jump\t// out + /* \"C\":403:411 this.f() */ + tag_47: + /* \"D\":91:166 contract D is C(3)... */ + swap1 + swap2 + pop + /* \"C\":403:411 this.f() */ returndatasize /* \"D\":91:166 contract D is C(3)... */ 0x1f add not(0x1f) and - dup4 - add - 0xffffffffffffffff - dup2 - gt - dup5 dup3 + add + swap1 + 0xffffffffffffffff + dup3 + gt + dup4 + dup4 lt or - iszero - tag_43 + tag_51 jumpi + pop + swap2 + /* \"C\":403:411 this.f() */ + tag_53 + /* \"C\":392:411 stateVar + this.f() */ + tag_49 + /* \"D\":91:166 contract D is C(3)... */ + swap3 + /* \"C\":392:422 stateVar + this.f() + immutVar */ + tag_50 + /* \"D\":91:166 contract D is C(3)... */ + swap5 + 0x40 + mstore + /* \"C\":403:411 this.f() */ + returndatasize + dup2 + add + swap1 + tag_7 + jump\t// in + tag_53: + swap2 + dup2 + swap4 + pop + jump(tag_48) + /* \"D\":91:166 contract D is C(3)... */ + tag_51: shl(0xe0, 0x4e487b71) - dup7 + dup2 mstore 0x41 /* \"C\":403:411 this.f() */ @@ -819,73 +916,64 @@ sub_0: assembly { /* \"D\":91:166 contract D is C(3)... */ mstore 0x24 - dup7 - revert - tag_43: - 0x40 - mstore - /* \"C\":403:411 this.f() */ - tag_44 - returndatasize - dup5 - add - dup5 - tag_7 - jump\t// in - tag_44: - swap1 - pop - tag_42: - /* \"C\":392:411 stateVar + this.f() */ - tag_45 - dup2 - dup6 - tag_5 - jump\t// in - tag_45: swap5 pop + /* \"C\":117:119 41 */ + swap3 + pop + pop + pop + /* \"D\":91:166 contract D is C(3)... */ + revert + /* \"C\":403:411 this.f() */ + tag_45: + /* \"D\":91:166 contract D is C(3)... */ + swap4 pop pop pop pop - /* \"C\":392:422 stateVar + this.f() + immutVar */ - tag_46 - /* \"C\":414:422 immutVar */ - immutable(\"0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10\") - /* \"C\":392:422 stateVar + this.f() + immutVar */ + mload(0x40) + swap1 + returndatasize + swap1 dup3 - tag_5 - jump\t// in - tag_46: - /* \"C\":336:337 _ */ + returndatacopy + returndatasize + swap1 + revert + /* \"C\":403:411 this.f() */ + tag_43: + /* \"D\":91:166 contract D is C(3)... */ swap2 pop pop - /* \"C\":304:341 modifier m()... */ - swap1 - jump\t// out - /* \"D\":91:166 contract D is C(3)... */ + dup1 + revert + tag_41: + tag_54 + tag_3 + jump\t// in + tag_54: + jump(tag_42) tag_7: - 0x00 + swap1 + dup2 0x20 - dup3 - dup5 + swap2 sub slt - iszero - tag_48 + tag_55 jumpi + mload + swap1 + jump\t// out + tag_55: + pop + pop 0x00 dup1 revert - tag_48: - pop - mload - swap2 - swap1 - pop - jump\t// out auxdata: } diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json index 3c630bb2d..1fa8928e1 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json @@ -72,7 +72,7 @@ sub_0: assembly { object \"C_6\" { code { /// @src 0:60:101 \"contract C {...\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_6() @@ -103,7 +103,7 @@ object \"C_6\" { object \"C_6_deployed\" { code { /// @src 0:60:101 \"contract C {...\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -187,11 +187,12 @@ object \"C_6\" { code { { /// @src 0:60:101 \"contract C {...\" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize(\"C_6_deployed\") - codecopy(128, dataoffset(\"C_6_deployed\"), _1) - return(128, _1) + let _2 := datasize(\"C_6_deployed\") + codecopy(_1, dataoffset(\"C_6_deployed\"), _2) + return(_1, _2) } } /// @use-src 0:\"C\" @@ -199,15 +200,16 @@ object \"C_6\" { code { { /// @src 0:60:101 \"contract C {...\" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json index 1f728995d..e427b7fe1 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json @@ -72,7 +72,7 @@ sub_0: assembly { object \"C_6\" { code { /// @src 0:60:101 - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_6() @@ -103,7 +103,7 @@ object \"C_6\" { object \"C_6_deployed\" { code { /// @src 0:60:101 - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -186,11 +186,12 @@ object \"C_6\" { code { { /// @src 0:60:101 - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize(\"C_6_deployed\") - codecopy(128, dataoffset(\"C_6_deployed\"), _1) - return(128, _1) + let _2 := datasize(\"C_6_deployed\") + codecopy(_1, dataoffset(\"C_6_deployed\"), _2) + return(_1, _2) } } /// @use-src 0:\"C\" @@ -198,15 +199,16 @@ object \"C_6\" { code { { /// @src 0:60:101 - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json index 8d19f60a3..e81f461d2 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json @@ -69,7 +69,7 @@ sub_0: assembly { object \"C_6\" { code { - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_6() @@ -96,7 +96,7 @@ object \"C_6\" { object \"C_6_deployed\" { code { - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -176,26 +176,28 @@ object \"C_6\" { object \"C_6\" { code { { - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize(\"C_6_deployed\") - codecopy(128, dataoffset(\"C_6_deployed\"), _1) - return(128, _1) + let _2 := datasize(\"C_6_deployed\") + codecopy(_1, dataoffset(\"C_6_deployed\"), _2) + return(_1, _2) } } /// @use-src 0:\"C\" object \"C_6_deployed\" { code { { - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - return(128, _1) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } + return(_1, _2) } } revert(0, 0) diff --git a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json index 7a77d60f4..6a105aadd 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json @@ -10,7 +10,7 @@ object \"C_54\" { code { /// @src 0:79:435 \"contract C...\" - mstore(64, 160) + mstore(64, memoryguard(160)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } let _1 := copy_arguments_for_constructor_20_object_C_54() @@ -161,7 +161,7 @@ object \"C_54\" { object \"C_54_deployed\" { code { /// @src 0:79:435 \"contract C...\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -592,30 +592,31 @@ object \"C_54\" { code { { /// @src 0:79:435 \"contract C...\" - mstore(64, 160) + let _1 := memoryguard(0xa0) + mstore(64, _1) if callvalue() { revert(0, 0) } let programSize := datasize(\"C_54\") let argSize := sub(codesize(), programSize) - let newFreePtr := add(160, and(add(argSize, 31), not(31))) - if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, 160)) + let newFreePtr := add(_1, and(add(argSize, 31), not(31))) + if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, _1)) { mstore(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ shl(224, 0x4e487b71)) mstore(4, 0x41) revert(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ 0x24) } mstore(64, newFreePtr) - codecopy(160, programSize, argSize) - if slt(argSize, 32) + codecopy(_1, programSize, argSize) + if slt(sub(add(_1, argSize), _1), 32) { revert(/** @src -1:-1:-1 */ 0, 0) } /// @src 0:79:435 \"contract C...\" - constructor_C(mload(160)) - let _1 := mload(64) - let _2 := datasize(\"C_54_deployed\") - codecopy(_1, dataoffset(\"C_54_deployed\"), _2) - setimmutable(_1, \"8\", mload(128)) - return(_1, _2) + constructor_C(mload(_1)) + let _2 := mload(64) + let _3 := datasize(\"C_54_deployed\") + codecopy(_2, dataoffset(\"C_54_deployed\"), _3) + setimmutable(_2, \"8\", mload(128)) + return(_2, _3) } /// @ast-id 20 @src 0:182:230 \"constructor(int _init)...\" function constructor_C(var_init) @@ -631,7 +632,7 @@ object \"C_54\" { code { { /// @src 0:79:435 \"contract C...\" - mstore(64, 128) + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { let _1 := 0 @@ -774,7 +775,7 @@ object \"C_54\" { object \"D_72\" { code { /// @src 1:91:166 \"contract D is C(3)...\" - mstore(64, 160) + mstore(64, memoryguard(160)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } let _1 := copy_arguments_for_constructor_71_object_D_72() @@ -993,7 +994,7 @@ object \"D_72\" { object \"D_72_deployed\" { code { /// @src 1:91:166 \"contract D is C(3)...\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -1424,30 +1425,31 @@ object \"D_72\" { code { { /// @src 1:91:166 \"contract D is C(3)...\" - mstore(64, 160) + let _1 := memoryguard(0xa0) + mstore(64, _1) if callvalue() { revert(0, 0) } let programSize := datasize(\"D_72\") let argSize := sub(codesize(), programSize) - let newFreePtr := add(160, and(add(argSize, 31), not(31))) - if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, 160)) + let newFreePtr := add(_1, and(add(argSize, 31), not(31))) + if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, _1)) { mstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(224, 0x4e487b71)) mstore(4, 0x41) revert(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ 0x24) } mstore(64, newFreePtr) - codecopy(160, programSize, argSize) - if slt(argSize, 32) + codecopy(_1, programSize, argSize) + if slt(sub(add(_1, argSize), _1), 32) { revert(/** @src -1:-1:-1 */ 0, 0) } /// @src 1:91:166 \"contract D is C(3)...\" - constructor_D(mload(160)) - let _1 := mload(64) - let _2 := datasize(\"D_72_deployed\") - codecopy(_1, dataoffset(\"D_72_deployed\"), _2) - setimmutable(_1, \"8\", mload(128)) - return(_1, _2) + constructor_D(mload(_1)) + let _2 := mload(64) + let _3 := datasize(\"D_72_deployed\") + codecopy(_2, dataoffset(\"D_72_deployed\"), _3) + setimmutable(_2, \"8\", mload(128)) + return(_2, _3) } /// @ast-id 71 @src 1:113:164 \"constructor(int _init2)...\" function constructor_D(var_init2) @@ -1471,7 +1473,7 @@ object \"D_72\" { code { { /// @src 1:91:166 \"contract D is C(3)...\" - mstore(64, 128) + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { let _1 := 0 diff --git a/test/cmdlineTests/standard_ewasm_requested/output.json b/test/cmdlineTests/standard_ewasm_requested/output.json index c70693bc6..a8ab1fd0b 100644 --- a/test/cmdlineTests/standard_ewasm_requested/output.json +++ b/test/cmdlineTests/standard_ewasm_requested/output.json @@ -17,7 +17,7 @@ (local $z3 i64) (local $_1 i64) (block $label_ - (local.set $p (call $u256_to_i32_726)) + (local.set $p (call $u256_to_i32_716)) (local.set $r (i32.add (local.get $p) (i32.const 64))) (if (i32.lt_u (local.get $r) (local.get $p)) (then (unreachable))) @@ -30,14 +30,14 @@ (call $eth.getCallValue (i32.const 0)) (local.set $z3 (i64.load (i32.const 8))) (if (i32.eqz (i64.eqz (i64.or (i64.or (i64.const 0) (i64.const 0)) (i64.or (local.get $z3) (i64.load (i32.const 0)))))) (then - (call $eth.revert (call $to_internal_i32ptr) (call $u256_to_i32_344)))) + (call $eth.revert (call $to_internal_i32ptr_334) (call $u256_to_i32_333)))) (local.set $_1 (datasize \"C_3_deployed\")) - (call $eth.codeCopy (call $to_internal_i32ptr_348) (call $u256_to_i32 (dataoffset \"C_3_deployed\")) (call $u256_to_i32 (local.get $_1))) - (call $eth.finish (call $to_internal_i32ptr_348) (call $u256_to_i32 (local.get $_1))) + (call $eth.codeCopy (call $to_internal_i32ptr) (call $u256_to_i32 (dataoffset \"C_3_deployed\")) (call $u256_to_i32 (local.get $_1))) + (call $eth.finish (call $to_internal_i32ptr) (call $u256_to_i32 (local.get $_1))) ) ) -(func $u256_to_i32_344 +(func $u256_to_i32_333 (result i32) (local $v i32) (local $_1 i64) @@ -68,7 +68,7 @@ (local.get $v) ) -(func $u256_to_i32_726 +(func $u256_to_i32_716 (result i32) (local $v i32) (block $label__3 @@ -82,12 +82,12 @@ (local.get $v) ) -(func $to_internal_i32ptr +(func $to_internal_i32ptr_334 (result i32) (local $r i32) (local $p i32) (block $label__4 - (local.set $p (call $u256_to_i32_344)) + (local.set $p (call $u256_to_i32_333)) (local.set $r (i32.add (local.get $p) (i32.const 64))) (if (i32.lt_u (local.get $r) (local.get $p)) (then (unreachable))) @@ -96,7 +96,7 @@ (local.get $r) ) -(func $to_internal_i32ptr_348 +(func $to_internal_i32ptr (result i32) (local $r i32) (local $v i32) diff --git a/test/cmdlineTests/standard_irOptimized_requested/output.json b/test/cmdlineTests/standard_irOptimized_requested/output.json index 78499140c..c56849339 100644 --- a/test/cmdlineTests/standard_irOptimized_requested/output.json +++ b/test/cmdlineTests/standard_irOptimized_requested/output.json @@ -9,7 +9,7 @@ object \"C_7\" { code { /// @src 0:79:121 \"contract C { function f() public pure {} }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() @@ -29,7 +29,7 @@ object \"C_7\" { object \"C_7_deployed\" { code { /// @src 0:79:121 \"contract C { function f() public pure {} }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { let selector := shift_right_224_unsigned(calldataload(0)) diff --git a/test/cmdlineTests/standard_ir_requested/output.json b/test/cmdlineTests/standard_ir_requested/output.json index 2da612abc..59f07f768 100644 --- a/test/cmdlineTests/standard_ir_requested/output.json +++ b/test/cmdlineTests/standard_ir_requested/output.json @@ -10,7 +10,7 @@ object \"C_7\" { code { /// @src 0:79:121 \"contract C { function f() public pure {} }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_7() @@ -41,7 +41,7 @@ object \"C_7\" { object \"C_7_deployed\" { code { /// @src 0:79:121 \"contract C { function f() public pure {} }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/standard_viair_requested/output.json b/test/cmdlineTests/standard_viair_requested/output.json index 4bf34fd7a..b72923f48 100644 --- a/test/cmdlineTests/standard_viair_requested/output.json +++ b/test/cmdlineTests/standard_viair_requested/output.json @@ -10,7 +10,7 @@ object \"C_3\" { code { /// @src 0:79:92 \"contract C {}\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_3() @@ -41,7 +41,7 @@ object \"C_3\" { object \"C_3_deployed\" { code { /// @src 0:79:92 \"contract C {}\" - mstore(64, 128) + mstore(64, memoryguard(128)) revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() @@ -79,7 +79,7 @@ object \"C_3\" { object \"D_16\" { code { /// @src 0:93:146 \"contract D { function f() public { C c = new C(); } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_D_16() @@ -110,7 +110,7 @@ object \"D_16\" { object \"D_16_deployed\" { code { /// @src 0:93:146 \"contract D { function f() public { C c = new C(); } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { @@ -212,7 +212,7 @@ object \"D_16\" { object \"C_3\" { code { /// @src 0:79:92 \"contract C {}\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_3() @@ -243,7 +243,7 @@ object \"D_16\" { object \"C_3_deployed\" { code { /// @src 0:79:92 \"contract C {}\" - mstore(64, 128) + mstore(64, memoryguard(128)) revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() diff --git a/test/cmdlineTests/standard_yul_optimiserSteps/output.json b/test/cmdlineTests/standard_yul_optimiserSteps/output.json index 3caeed8db..4071589cb 100644 --- a/test/cmdlineTests/standard_yul_optimiserSteps/output.json +++ b/test/cmdlineTests/standard_yul_optimiserSteps/output.json @@ -1,10 +1,12 @@ -{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":17:18 */ +{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":38:39 */ 0x00 /* \"A\":11:19 */ dup1 mload /* \"A\":20:40 */ sstore + /* \"A\":0:42 */ + stop ","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"object\" { code { let x := mload(0) diff --git a/test/cmdlineTests/standard_yul_optimized/output.json b/test/cmdlineTests/standard_yul_optimized/output.json index a5217c672..371a0816b 100644 --- a/test/cmdlineTests/standard_yul_optimized/output.json +++ b/test/cmdlineTests/standard_yul_optimized/output.json @@ -1,10 +1,12 @@ {"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":17:18 */ 0x00 - dup1 /* \"A\":11:19 */ + dup1 mload /* \"A\":20:40 */ sstore + /* \"A\":0:42 */ + stop ","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"object\" { code { let x := mload(0) diff --git a/test/cmdlineTests/standard_yul_stack_opt/output.json b/test/cmdlineTests/standard_yul_stack_opt/output.json index 0fd77310e..f041adaa8 100644 --- a/test/cmdlineTests/standard_yul_stack_opt/output.json +++ b/test/cmdlineTests/standard_yul_stack_opt/output.json @@ -1,17 +1,15 @@ {"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":16:17 */ 0x01 - dup1 /* \"A\":27:28 */ 0x00 /* \"A\":20:32 */ sstore - pop /* \"A\":50:51 */ 0x02 - dup1 /* \"A\":61:63 */ 0x20 /* \"A\":54:67 */ sstore - pop + /* \"A\":0:72 */ + stop "}}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} diff --git a/test/cmdlineTests/strict_asm_optimizer_steps/output b/test/cmdlineTests/strict_asm_optimizer_steps/output index bf9f34e7a..0f7a59b97 100644 --- a/test/cmdlineTests/strict_asm_optimizer_steps/output +++ b/test/cmdlineTests/strict_asm_optimizer_steps/output @@ -25,7 +25,7 @@ object "C_6" { Binary representation: -60806040523415600e57600080fd5b600e601c600039600e6000f3fe60806040523615600055600080fd +608060405234601557600e601b600039600e6000f35b600080fdfe60806040523615600055600080fd Text representation: /* "strict_asm_optimizer_steps/input.yul":45:48 */ @@ -37,17 +37,8 @@ Text representation: /* "strict_asm_optimizer_steps/input.yul":61:72 */ callvalue /* "strict_asm_optimizer_steps/input.yul":58:89 */ - iszero tag_1 jumpi - /* "strict_asm_optimizer_steps/input.yul":85:86 */ - 0x00 - /* "strict_asm_optimizer_steps/input.yul":82:83 */ - dup1 - /* "strict_asm_optimizer_steps/input.yul":75:87 */ - revert - /* "strict_asm_optimizer_steps/input.yul":58:89 */ -tag_1: /* "strict_asm_optimizer_steps/input.yul":138:162 */ dataSize(sub_0) /* "strict_asm_optimizer_steps/input.yul":110:136 */ @@ -62,6 +53,13 @@ tag_1: 0x00 /* "strict_asm_optimizer_steps/input.yul":172:207 */ return + /* "strict_asm_optimizer_steps/input.yul":73:89 */ +tag_1: + /* "strict_asm_optimizer_steps/input.yul":85:86 */ + 0x00 + /* "strict_asm_optimizer_steps/input.yul":75:87 */ + dup1 + revert stop sub_0: assembly { @@ -81,8 +79,7 @@ sub_0: assembly { sstore /* "strict_asm_optimizer_steps/input.yul":576:577 */ 0x00 - /* "strict_asm_optimizer_steps/input.yul":573:574 */ - dup1 /* "strict_asm_optimizer_steps/input.yul":566:578 */ + dup1 revert } diff --git a/test/cmdlineTests/viair_abicoder_v1/output b/test/cmdlineTests/viair_abicoder_v1/output index a23730702..cedda56dc 100644 --- a/test/cmdlineTests/viair_abicoder_v1/output +++ b/test/cmdlineTests/viair_abicoder_v1/output @@ -11,7 +11,7 @@ IR: object "test_11" { code { /// @src 0:79:169 "contract test {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_test_11() @@ -42,7 +42,7 @@ object "test_11" { object "test_11_deployed" { code { /// @src 0:79:169 "contract test {..." - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/viair_subobjects/output b/test/cmdlineTests/viair_subobjects/output index eef7d27e8..4b388665c 100644 --- a/test/cmdlineTests/viair_subobjects/output +++ b/test/cmdlineTests/viair_subobjects/output @@ -17,11 +17,12 @@ object "C_3" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_3_deployed") - codecopy(128, dataoffset("C_3_deployed"), _1) - return(128, _1) + let _2 := datasize("C_3_deployed") + codecopy(_1, dataoffset("C_3_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"viair_subobjects/input.sol" @@ -29,7 +30,7 @@ object "C_3" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } @@ -56,11 +57,12 @@ object "D_16" { code { { /// @src 0:96:165 "contract D {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("D_16_deployed") - codecopy(128, dataoffset("D_16_deployed"), _1) - return(128, _1) + let _2 := datasize("D_16_deployed") + codecopy(_1, dataoffset("D_16_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"viair_subobjects/input.sol" @@ -68,35 +70,35 @@ object "D_16" { code { { /// @src 0:96:165 "contract D {..." - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0x26121ff0, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0x26121ff0, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) } - /// @src 0:149:156 "new C()" - let _2 := datasize("C_3") - let _3 := add(/** @src 0:96:165 "contract D {..." */ 128, /** @src 0:149:156 "new C()" */ _2) - if or(gt(_3, 0xffffffffffffffff), lt(_3, /** @src 0:96:165 "contract D {..." */ 128)) + if callvalue() { revert(_2, _2) } + if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) } /// @src 0:149:156 "new C()" + let _3 := datasize("C_3") + let _4 := add(_1, _3) + if or(gt(_4, 0xffffffffffffffff), lt(_4, _1)) { /// @src 0:96:165 "contract D {..." - mstore(_1, shl(224, 0x4e487b71)) + mstore(_2, shl(224, 0x4e487b71)) mstore(4, 0x41) - revert(_1, 0x24) + revert(_2, 0x24) } /// @src 0:149:156 "new C()" - datacopy(/** @src 0:96:165 "contract D {..." */ 128, /** @src 0:149:156 "new C()" */ dataoffset("C_3"), _2) - if iszero(create(/** @src 0:96:165 "contract D {..." */ _1, 128, /** @src 0:149:156 "new C()" */ _2)) + datacopy(_1, dataoffset("C_3"), _3) + if iszero(create(/** @src 0:96:165 "contract D {..." */ _2, /** @src 0:149:156 "new C()" */ _1, sub(_4, _1))) { /// @src 0:96:165 "contract D {..." let pos := mload(64) - returndatacopy(pos, _1, returndatasize()) + returndatacopy(pos, _2, returndatasize()) revert(pos, returndatasize()) } - return(mload(64), _1) + return(mload(64), _2) } } revert(0, 0) @@ -107,11 +109,12 @@ object "D_16" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + let _1 := memoryguard(0x80) + mstore(64, _1) if callvalue() { revert(0, 0) } - let _1 := datasize("C_3_deployed") - codecopy(128, dataoffset("C_3_deployed"), _1) - return(128, _1) + let _2 := datasize("C_3_deployed") + codecopy(_1, dataoffset("C_3_deployed"), _2) + return(_1, _2) } } /// @use-src 0:"viair_subobjects/input.sol" @@ -119,7 +122,7 @@ object "D_16" { code { { /// @src 0:82:95 "contract C {}" - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert(0, 0) } } diff --git a/test/cmdlineTests/yul_optimize_runs/output b/test/cmdlineTests/yul_optimize_runs/output index 4c98ec30e..b95184440 100644 --- a/test/cmdlineTests/yul_optimize_runs/output +++ b/test/cmdlineTests/yul_optimize_runs/output @@ -21,20 +21,18 @@ object "RunsTest1" { Binary representation: -602480600d600039806000f3fe7fabc1234500000000000000000000000000000000000000000000000000000000600055 +602580600c6000396000f3fe7fabc123450000000000000000000000000000000000000000000000000000000060005500 Text representation: /* "yul_optimize_runs/input.yul":106:125 */ dataSize(sub_0) - dup1 /* "yul_optimize_runs/input.yul":83:104 */ + dup1 dataOffset(sub_0) /* "yul_optimize_runs/input.yul":80:81 */ 0x00 /* "yul_optimize_runs/input.yul":71:126 */ codecopy - /* "yul_optimize_runs/input.yul":145:164 */ - dup1 /* "yul_optimize_runs/input.yul":80:81 */ 0x00 /* "yul_optimize_runs/input.yul":135:165 */ @@ -48,4 +46,6 @@ sub_0: assembly { 0x00 /* "yul_optimize_runs/input.yul":270:288 */ sstore + /* "yul_optimize_runs/input.yul":208:298 */ + stop } diff --git a/test/cmdlineTests/yul_optimizer_steps/output b/test/cmdlineTests/yul_optimizer_steps/output index 8e4cc7e88..a88ce164a 100644 --- a/test/cmdlineTests/yul_optimizer_steps/output +++ b/test/cmdlineTests/yul_optimizer_steps/output @@ -11,7 +11,7 @@ object "C_7" { code { { /// @src 0:80:112 "contract C..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() @@ -30,7 +30,7 @@ object "C_7" { code { { /// @src 0:80:112 "contract C..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() } function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() diff --git a/test/cmdlineTests/yul_optimizer_steps_nested_brackets/output b/test/cmdlineTests/yul_optimizer_steps_nested_brackets/output index 63f08a35d..cc67ca5bc 100644 --- a/test/cmdlineTests/yul_optimizer_steps_nested_brackets/output +++ b/test/cmdlineTests/yul_optimizer_steps_nested_brackets/output @@ -11,7 +11,7 @@ object "C_6" { code { { /// @src 0:60:103 "contract C..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() @@ -121,7 +121,7 @@ object "C_6" { code { { /// @src 0:60:103 "contract C..." - mstore(64, 128) + mstore(64, memoryguard(0x80)) if iszero(lt(calldatasize(), 4)) { let selector := shift_right_unsigned(calldataload(0)) diff --git a/test/cmdlineTests/yul_string_format_ascii/output.json b/test/cmdlineTests/yul_string_format_ascii/output.json index ae7a926fe..2354929e4 100644 --- a/test/cmdlineTests/yul_string_format_ascii/output.json +++ b/test/cmdlineTests/yul_string_format_ascii/output.json @@ -10,7 +10,7 @@ object \"C_11\" { code { /// @src 0:78:164 \"contract C { function f() external pure returns (string memory) { return \\\"abcabc\\\"; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_11() @@ -41,7 +41,7 @@ object \"C_11\" { object \"C_11_deployed\" { code { /// @src 0:78:164 \"contract C { function f() external pure returns (string memory) { return \\\"abcabc\\\"; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/yul_string_format_ascii_bytes32/output.json b/test/cmdlineTests/yul_string_format_ascii_bytes32/output.json index 59a93a7bf..84e9ff271 100644 --- a/test/cmdlineTests/yul_string_format_ascii_bytes32/output.json +++ b/test/cmdlineTests/yul_string_format_ascii_bytes32/output.json @@ -10,7 +10,7 @@ object \"C_11\" { code { /// @src 0:78:158 \"contract C { function f() external pure returns (bytes32) { return \\\"abcabc\\\"; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_11() @@ -41,7 +41,7 @@ object \"C_11\" { object \"C_11_deployed\" { code { /// @src 0:78:158 \"contract C { function f() external pure returns (bytes32) { return \\\"abcabc\\\"; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/yul_string_format_ascii_bytes32_from_number/output.json b/test/cmdlineTests/yul_string_format_ascii_bytes32_from_number/output.json index 79d35a338..716a1cc6e 100644 --- a/test/cmdlineTests/yul_string_format_ascii_bytes32_from_number/output.json +++ b/test/cmdlineTests/yul_string_format_ascii_bytes32_from_number/output.json @@ -10,7 +10,7 @@ object \"C_11\" { code { /// @src 0:78:159 \"contract C { function f() external pure returns (bytes4) { return 0x61626364; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_11() @@ -41,7 +41,7 @@ object \"C_11\" { object \"C_11_deployed\" { code { /// @src 0:78:159 \"contract C { function f() external pure returns (bytes4) { return 0x61626364; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/yul_string_format_ascii_long/output.json b/test/cmdlineTests/yul_string_format_ascii_long/output.json index 932a5c28c..1f52e103b 100644 --- a/test/cmdlineTests/yul_string_format_ascii_long/output.json +++ b/test/cmdlineTests/yul_string_format_ascii_long/output.json @@ -10,7 +10,7 @@ object \"C_11\" { code { /// @src 0:78:243 \"contract C { function f() external pure returns (string memory) { return \\\"abcdabcdcafecafeabcdabcdcafecafeffffzzzzoooo0123456789,.<,>.?:;'[{]}|`~!@#$%^&*()-_=+\\\"; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_11() @@ -41,7 +41,7 @@ object \"C_11\" { object \"C_11_deployed\" { code { /// @src 0:78:243 \"contract C { function f() external pure returns (string memory) { return \\\"abcdabcdcafecafeabcdabcdcafecafeffffzzzzoooo0123456789,.<,>.?:;'[{]}|`~!@#$%^&*()-_=+\\\"; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/yul_string_format_hex/output.json b/test/cmdlineTests/yul_string_format_hex/output.json index da8f873a3..04166a760 100644 --- a/test/cmdlineTests/yul_string_format_hex/output.json +++ b/test/cmdlineTests/yul_string_format_hex/output.json @@ -10,7 +10,7 @@ object \"C_11\" { code { /// @src 0:78:159 \"contract C { function f() external pure returns (bytes4) { return 0xaabbccdd; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } constructor_C_11() @@ -41,7 +41,7 @@ object \"C_11\" { object \"C_11_deployed\" { code { /// @src 0:78:159 \"contract C { function f() external pure returns (bytes4) { return 0xaabbccdd; } }\" - mstore(64, 128) + mstore(64, memoryguard(128)) if iszero(lt(calldatasize(), 4)) { diff --git a/test/cmdlineTests/yul_verbatim_msize/output b/test/cmdlineTests/yul_verbatim_msize/output index 5f67aa85e..991fcbdb0 100644 --- a/test/cmdlineTests/yul_verbatim_msize/output +++ b/test/cmdlineTests/yul_verbatim_msize/output @@ -14,7 +14,7 @@ object "object" { Binary representation: -612000515061616002600055 +61200051506161600260005500 Text representation: /* "yul_verbatim_msize/input.yul":125:131 */ @@ -30,3 +30,5 @@ Text representation: 0x00 /* "yul_verbatim_msize/input.yul":162:174 */ sstore + /* "yul_verbatim_msize/input.yul":0:176 */ + stop diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol index 4161cb7d8..06f9bcbbf 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: 203522 +// gas irOptimized: 203312 // gas legacy: 206084 // gas legacyOptimized: 203068 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol index 61b8f3810..ddd536a38 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: 394829 +// gas irOptimized: 377545 // gas legacy: 423563 // gas legacyOptimized: 331391 // test_uint256() -> -// gas irOptimized: 553331 +// gas irOptimized: 528726 // 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 458c11893..8fe170e91 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: 167615 +// gas irOptimized: 167580 // 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 7b7854c23..3a4a23fef 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: 394829 +// gas irOptimized: 377545 // gas legacy: 423563 // gas legacyOptimized: 331391 // test_uint256() -> -// gas irOptimized: 553331 +// gas irOptimized: 528726 // 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 d475ffa19..3e9697698 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: 113296 +// gas irOptimized: 113361 // gas legacy: 114900 // 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 bf57dbe6f..b730f3588 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: 121699 +// gas irOptimized: 120044 // gas legacy: 155221 // gas legacyOptimized: 111678 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 7fceb5935..7832ef601 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: 88225 +// gas irOptimized: 87578 // gas legacy: 99137 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol index 2841ef243..bf42f8776 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: 177581 +// gas irOptimized: 172204 // 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 12f12ef29..1f836bfaf 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: 181123 +// gas irOptimized: 180925 // gas legacy: 184929 // gas legacyOptimized: 181504 // i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224 -// gas irOptimized: 112627 +// gas irOptimized: 112535 // 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 cbdaa381f..b6c6ad5f0 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: 135996 +// gas irOptimized: 135918 // gas legacy: 137190 // gas legacyOptimized: 136082 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 596e76a66..e8d567059 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,7 +14,7 @@ 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: 189239 +// gas irOptimized: 189910 // gas legacy: 211149 // gas legacyOptimized: 206054 // data(uint256,uint256): 0x02, 0x02 -> 0x09 diff --git a/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol b/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol index 251489660..2c238a54b 100644 --- a/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol +++ b/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol @@ -47,7 +47,7 @@ contract c { // gas legacyOptimized: 58606 // storageEmpty -> 0 // test_long() -> 67 -// gas irOptimized: 90759 +// gas irOptimized: 89148 // gas legacy: 103590 // gas legacyOptimized: 101044 // 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 a4403c3d7..31879057a 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: 165224 +// gas irOptimized: 158143 // 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 aaf990ef6..bb4e21e16 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: 110439 +// gas irOptimized: 110433 // 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 4795624b4..2a401cd87 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: 650971 +// gas irOptimized: 650669 // 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 91ae6913f..3449cdc2d 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: 92843 +// gas irOptimized: 92740 // 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 2b74d52e4..73abd2cf7 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: 153927 +// gas irOptimized: 153260 // 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 f8dea7bbe..e90cf7e58 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: 135145 +// gas irOptimized: 135098 // 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 b9e80c1d7..bd596b86c 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: 92855 +// gas irOptimized: 92800 // gas legacy: 93006 // gas legacyOptimized: 92261 // g() -> 0 // h() -> 0 -// gas irOptimized: 92922 +// gas irOptimized: 92862 // 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 1cfbd1733..81607a264 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: 212669 +// gas irOptimized: 212571 // 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 2a58b9256..4f7023250 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: 4660920 +// gas irOptimized: 4652092 // gas legacy: 4578341 // gas legacyOptimized: 4548354 // storageEmpty -> 1 // clear() -> 0, 0 -// gas irOptimized: 4491908 +// gas irOptimized: 4483169 // 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 deb9404e3..0e05c4ea8 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: 690506 +// gas irOptimized: 690205 // 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 cee96209a..cad3c9d49 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: 226130 +// gas irOptimized: 225956 // 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 fcec284cc..4a475ac55 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 @@ -24,6 +24,6 @@ contract c { // compileViaYul: also // ---- // test() -> 3, 4 -// gas irOptimized: 190944 +// gas irOptimized: 190480 // 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 05e038378..202b3ad26 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,7 +17,7 @@ contract c { // ---- // setData1(uint256,uint256,uint256): 10, 5, 4 -> // copyStorageStorage() -> -// gas irOptimized: 111488 +// gas irOptimized: 111426 // gas legacy: 109278 // gas legacyOptimized: 109268 // getData2(uint256): 5 -> 10, 4 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol index 167e2740e..3b8fe6212 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: 272806 +// gas irOptimized: 272736 // 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 3b2ddbde1..d2d7f4e48 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,6 +14,6 @@ contract c { // compileViaYul: also // ---- // test() -> 9, 4 -// gas irOptimized: 123172 +// gas irOptimized: 123162 // gas legacy: 123579 // gas legacyOptimized: 123208 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 8d438013a..c865b8228 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: 236016 +// gas irOptimized: 236090 // 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 35776b6a1..db26b4d47 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: 239134 +// gas irOptimized: 238826 // 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 62f1ee715..3b2815526 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: 161746 +// gas irOptimized: 161780 // 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 537924f14..1daa061a5 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol @@ -20,6 +20,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 132180 +// gas irOptimized: 129167 // 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 36b387971..b42b84dfe 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol @@ -22,6 +22,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0x04000000000000000000000000000000000000000000000000, 0x0, 0x0 -// gas irOptimized: 93855 +// gas irOptimized: 93858 // 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 b0387042f..c87f70244 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol @@ -22,6 +22,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0 -// gas irOptimized: 294958 +// gas irOptimized: 294772 // 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 893fbdba3..c39f80275 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 @@ -22,6 +22,6 @@ contract c { // compileViaYul: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00 -// gas irOptimized: 274022 +// gas irOptimized: 273963 // 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 78f1bef9f..3cc9c9bd9 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: 181755 +// gas irOptimized: 181308 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 158111 +// gas irOptimized: 157901 // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 -// gas irOptimized: 135282 +// gas irOptimized: 135108 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 -// gas irOptimized: 111460 +// gas irOptimized: 111428 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 707e25056..826d48b2b 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: 227254 +// gas irOptimized: 227167 // gas legacy: 227133 // gas legacyOptimized: 226547 // test1() -> 3 // test2() -> 6 // test3() -> 24 -// gas irOptimized: 133753 +// gas irOptimized: 133621 // 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 27f81692c..b3d950ffa 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: 121194 +// gas irOptimized: 121048 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 6f11f6c66..2fe271587 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: 119201 +// gas irOptimized: 119149 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 970a5dced..7d4e1f845 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: 330385 +// gas irOptimized: 328592 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 e4ff169f4..0b1d71bdf 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: 183411 +// gas irOptimized: 183316 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 e23efb666..de38034fd 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: 132580 +// gas irOptimized: 132298 // 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 cee56c23b..dadbceadc 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,7 +12,7 @@ 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: 99873 +// gas irOptimized: 99616 // gas legacy: 103563 // gas legacyOptimized: 101397 // data(uint256): 7 -> 8 diff --git a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol index dd5f2a86a..809ef247d 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol @@ -7,11 +7,11 @@ contract c { // compileViaYul: also // ---- // set(uint256): 1, 2 -> true -// gas irOptimized: 110678 +// gas irOptimized: 110699 // gas legacy: 111091 // gas legacyOptimized: 110736 // set(uint256): 2, 2, 3, 4, 5 -> true -// gas irOptimized: 177635 +// gas irOptimized: 177659 // gas legacy: 178021 // gas legacyOptimized: 177666 // 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 fb4e2159d..87974f053 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: 125470 +// gas irOptimized: 121741 // gas legacy: 124364 // gas legacyOptimized: 119898 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 134121 +// gas irOptimized: 130733 // gas legacy: 135431 // gas legacyOptimized: 130829 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 141217 +// gas irOptimized: 137732 // gas legacy: 142238 // gas legacyOptimized: 137518 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 158957 +// gas irOptimized: 152352 // gas legacy: 160728 // gas legacyOptimized: 152168 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 // gas legacy: 59345 // gas legacyOptimized: 57279 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 419485 +// gas irOptimized: 406089 // 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 7fba61c2c..7c0b3bdbb 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: 111204 +// gas irOptimized: 111161 // 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 6bb47d9d9..ed0fe8f5f 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,11 +37,11 @@ contract C { // compileViaYul: also // ---- // f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000 -// gas irOptimized: 179947 +// gas irOptimized: 179952 // gas legacy: 180694 // gas legacyOptimized: 180088 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas irOptimized: 107322 +// gas irOptimized: 107332 // gas legacy: 107895 // gas legacyOptimized: 107254 // h() -> 0x40, 0x60, 0x00, 0x00 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 26332e6f2..b73f3dc44 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: 121438 +// gas irOptimized: 121145 // gas legacy: 128035 // 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 2401d90d9..8448d2e69 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: 126212 +// gas irOptimized: 126552 // gas legacy: 205196 // gas legacyOptimized: 204987 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 2532c04af..b8ec0d97f 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol @@ -9,7 +9,7 @@ contract c { // compileViaYul: also // ---- // set(): 1, 2, 3, 4, 5 -> true -// gas irOptimized: 177396 +// gas irOptimized: 177417 // gas legacy: 177656 // gas legacyOptimized: 177496 // storageEmpty -> 0 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 5cb657afe..3d4623b79 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: 131095 +// gas irOptimized: 129916 // 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 9f325200d..ec58360cd 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: 207030 +// gas irOptimized: 207785 // 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 5749e3ad8..f94b442f3 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: 202750 +// gas irOptimized: 202840 // 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 8893bd94d..ece6f7969 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: 207030 +// gas irOptimized: 207785 // 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 2e1a2cc3c..556fb5a61 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: 291923 +// gas irOptimized: 291850 // 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 caf1e1dfd..abcd72ee1 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: 114568 +// gas irOptimized: 114120 // gas legacy: 126449 // gas legacyOptimized: 120902 diff --git a/test/libsolidity/semanticTests/array/create_memory_array.sol b/test/libsolidity/semanticTests/array/create_memory_array.sol index adc51585a..8072526ab 100644 --- a/test/libsolidity/semanticTests/array/create_memory_array.sol +++ b/test/libsolidity/semanticTests/array/create_memory_array.sol @@ -20,6 +20,6 @@ contract C { // compileViaYul: also // ---- // f() -> "A", 8, 4, "B" -// gas irOptimized: 140716 +// gas irOptimized: 130594 // gas legacy: 121398 // gas legacyOptimized: 115494 diff --git a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol index f3c4a87b4..149e8768d 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: 230748 +// gas irOptimized: 225894 // 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 36a2eca41..82c8d6b6c 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: 91245 +// gas irOptimized: 91098 diff --git a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol index 46e3606ba..9f4be2119 100644 --- a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol @@ -16,7 +16,7 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 520360 +// gas irOptimized: 519848 // gas legacy: 521773 // gas legacyOptimized: 517048 // 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 f95a93a22..2587442d5 100644 --- a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol +++ b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol @@ -44,7 +44,7 @@ contract c { // ---- // getLengths() -> 0, 0 // setLengths(uint256,uint256): 48, 49 -> -// gas irOptimized: 104851 +// gas irOptimized: 104355 // gas legacy: 108571 // gas legacyOptimized: 100417 // getLengths() -> 48, 49 diff --git a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol index 7d7f4188b..6aecbde32 100644 --- a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol @@ -18,7 +18,7 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> 8 -// gas irOptimized: 123113 +// gas irOptimized: 122528 // gas legacy: 121756 // gas legacyOptimized: 120687 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol index c5a63fa3a..dd131f287 100644 --- a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol @@ -13,7 +13,7 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 465690 +// gas irOptimized: 465585 // gas legacy: 471460 // gas legacyOptimized: 467520 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol index ab9ae1640..5e30621af 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: 120848 +// gas irOptimized: 130328 // gas legacy: 235199 // gas legacyOptimized: 133119 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index 6545dc900..95cb52f11 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: 297690 +// gas irOptimized: 302321 // gas legacy: 462080 // gas legacyOptimized: 294938 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 9788b6136..f2a98f993 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: 2272395 +// gas irOptimized: 2271482 // 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 3ad0d8f32..4be29a15d 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: 192323 +// gas irOptimized: 188649 // 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 dc3b2a861..08a403174 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: 161105 +// gas irOptimized: 159175 // 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 2b893c668..387d21872 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: 111157 +// gas irOptimized: 109503 // 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 bf605984b..c911b1b7c 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: 205254 +// gas irOptimized: 196545 // 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 09e65f0c5..38c0c84d6 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: 146450 +// gas irOptimized: 142640 // 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 ca5909722..6d314fb27 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: 109314 +// gas irOptimized: 108493 // 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 83cceeb56..e8ec36639 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: 111289 +// gas irOptimized: 111317 // 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 39f99a9bd..a4be5ad90 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: 113393 +// gas irOptimized: 113267 // 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 72ab9ea14..04f9544a9 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: 93200 +// gas irOptimized: 93017 // 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 03a2c53b3..60e317770 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: 137074 +// gas irOptimized: 136894 // 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 272b179e9..f6da6a398 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: 139100 +// gas irOptimized: 138785 // gas legacy: 145150 // 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 86ef51a81..78c817d44 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: 185231 +// gas irOptimized: 176848 // 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 f1a245ce4..262ba724a 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: 179867 +// gas irOptimized: 179590 // 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 fe6138a4a..8df809acd 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol @@ -29,14 +29,14 @@ contract C { // ---- // l() -> 0 // f(uint256,uint256): 42, 64 -> -// gas irOptimized: 114151 +// gas irOptimized: 112555 // 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: 119535 +// gas irOptimized: 116427 // gas legacy: 107780 // gas legacyOptimized: 96331 // l() -> 2 diff --git a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol index 093d3aa5a..defbf4149 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol @@ -23,7 +23,7 @@ contract C { // ---- // l() -> 0 // g(uint256): 70 -> -// gas irOptimized: 191389 +// gas irOptimized: 184507 // gas legacy: 184991 // gas legacyOptimized: 180608 // l() -> 70 diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index 7ae96a3d6..7d2b4d995 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: 113954 +// gas irOptimized: 113776 // 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 c55ce061d..63c2acbb5 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: 458295 +// gas irOptimized: 456873 // gas legacy: 590939 // gas legacyOptimized: 448582 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index c0123af13..d4d41d80c 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: 312176 +// gas irOptimized: 308702 // gas legacy: 429173 // gas legacyOptimized: 298384 diff --git a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol index 3bf97c49b..3fdbb0785 100644 --- a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol +++ b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol @@ -19,6 +19,6 @@ contract C { // compileViaYul: also // ---- // f(), 2000 ether -> true -// gas irOptimized: 123090 +// gas irOptimized: 123037 // gas legacy: 123226 // gas legacyOptimized: 123092 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol index 2da24603e..b5db5ca2b 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol @@ -15,6 +15,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c -// gas irOptimized: 114816 +// gas irOptimized: 114746 // gas legacy: 116393 // gas legacyOptimized: 114415 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol index 8e02a5bfc..f833ba37a 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol @@ -16,6 +16,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c -// gas irOptimized: 114816 +// gas irOptimized: 114746 // gas legacy: 116393 // gas legacyOptimized: 114415 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol index f9e773b75..552444dd8 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol @@ -17,6 +17,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d -// gas irOptimized: 185564 +// gas irOptimized: 185444 // gas legacy: 187621 // gas legacyOptimized: 184551 diff --git a/test/libsolidity/semanticTests/events/event_indexed_mixed.sol b/test/libsolidity/semanticTests/events/event_indexed_mixed.sol index d3971c1e9..47aca1e2a 100644 --- a/test/libsolidity/semanticTests/events/event_indexed_mixed.sol +++ b/test/libsolidity/semanticTests/events/event_indexed_mixed.sol @@ -13,6 +13,6 @@ contract C { // ---- // deposit() -> // ~ emit E(uint256,uint256,uint256,bytes): #0x02, 0x01, 0x03, 0x60, 0x03, "def" -// gas irOptimized: 23685 +// gas irOptimized: 23709 // gas legacy: 24342 // gas legacyOptimized: 23753 diff --git a/test/libsolidity/semanticTests/events/event_indexed_string.sol b/test/libsolidity/semanticTests/events/event_indexed_string.sol index a411da3c6..d35db93c4 100644 --- a/test/libsolidity/semanticTests/events/event_indexed_string.sol +++ b/test/libsolidity/semanticTests/events/event_indexed_string.sol @@ -19,6 +19,6 @@ contract C { // ---- // deposit() -> // ~ emit E(string,uint256[4]): #0xa7fb06bb999a5eb9aff9e0779953f4e1e4ce58044936c2f51c7fb879b85c08bd, #0xe755d8cc1a8cde16a2a31160dcd8017ac32d7e2f13215b29a23cdae40a78aa81 -// gas irOptimized: 353515 +// gas irOptimized: 343396 // gas legacy: 390742 // gas legacyOptimized: 376774 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index b7be3cf05..9205de434 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -76,12 +76,12 @@ contract FixedFeeRegistrar is Registrar { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 433748 +// gas irOptimized: 425623 // gas legacy: 936897 -// gas legacyOptimized: 491019 +// gas legacyOptimized: 490983 // reserve(string), 69 ether: 0x20, 3, "abc" -> // ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 -// gas irOptimized: 46070 +// gas irOptimized: 45967 // gas legacy: 46842 // gas legacyOptimized: 46091 // owner(string): 0x20, 3, "abc" -> 0x1212121212121212121212121212120000000012 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 81efd3566..f054497e9 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -178,7 +178,7 @@ contract DepositContract is IDepositContract, ERC165 { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 1657475 +// gas irOptimized: 1558013 // gas legacy: 2580394 // gas legacyOptimized: 1775403 // supportsInterface(bytes4): 0x0 -> 0 @@ -186,27 +186,27 @@ contract DepositContract is IDepositContract, ERC165 { // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # // supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 122599 +// gas irOptimized: 122169 // 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: 122599 +// gas irOptimized: 122169 // 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 # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00 // get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438 -// gas irOptimized: 122606 +// gas irOptimized: 122148 // 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 # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000 // get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee -// gas irOptimized: 122606 +// gas irOptimized: 122148 // gas legacy: 150475 // gas legacyOptimized: 122811 // get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol index 77be50301..01d2403a6 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -50,46 +50,46 @@ contract test { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 1965559 +// gas irOptimized: 1924584 // gas legacy: 2602700 // gas legacyOptimized: 1874490 // div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 -// gas irOptimized: 22244 +// gas irOptimized: 22137 // gas legacy: 22767 // gas legacyOptimized: 22282 // exp(int256): 3141592653589793238 -> 23140692632779268978 -// gas irOptimized: 24358 +// gas irOptimized: 24545 // gas legacy: 25203 // gas legacyOptimized: 24357 // exp2(int256): 3141592653589793238 -> 8824977827076287620 -// gas irOptimized: 24125 +// gas irOptimized: 24257 // gas legacy: 24864 // gas legacyOptimized: 24110 // gm(int256,int256): 3141592653589793238, 88714123 -> 16694419339601 -// gas irOptimized: 23057 +// gas irOptimized: 22970 // gas legacy: 23228 // gas legacyOptimized: 22683 // log10(int256): 3141592653589793238 -> 4971498726941338506 -// gas irOptimized: 30112 +// gas irOptimized: 30609 // gas legacy: 32934 // gas legacyOptimized: 30323 // log2(int256): 3141592653589793238 -> 1651496129472318782 -// gas irOptimized: 28300 +// gas irOptimized: 28819 // gas legacy: 31067 // gas legacyOptimized: 28426 // mul(int256,int256): 3141592653589793238, 88714123 -> 278703637 -// gas irOptimized: 22335 +// gas irOptimized: 22225 // gas legacy: 22807 // gas legacyOptimized: 22295 // pow(int256,uint256): 3141592653589793238, 5 -> 306019684785281453040 -// gas irOptimized: 22861 +// gas irOptimized: 22635 // gas legacy: 23508 // gas legacyOptimized: 22921 // sqrt(int256): 3141592653589793238 -> 1772453850905516027 -// gas irOptimized: 22702 +// gas irOptimized: 22650 // gas legacy: 22802 // gas legacyOptimized: 22422 // benchmark(int256): 3141592653589793238 -> 998882724338592125, 1000000000000000000, 1000000000000000000 -// gas irOptimized: 37899 +// gas irOptimized: 36630 // gas legacy: 36673 // gas legacyOptimized: 34729 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol index 8a096f524..c31664c85 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol @@ -50,46 +50,46 @@ contract test { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 1769431 +// gas irOptimized: 1778342 // gas legacy: 2356230 // gas legacyOptimized: 1746528 // div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 -// gas irOptimized: 22047 +// gas irOptimized: 22004 // gas legacy: 22497 // gas legacyOptimized: 22010 // exp(uint256): 3141592653589793238 -> 23140692632779268978 -// gas irOptimized: 24234 +// gas irOptimized: 24444 // gas legacy: 25104 // gas legacyOptimized: 24258 // exp2(uint256): 3141592653589793238 -> 8824977827076287620 -// gas irOptimized: 24063 +// gas irOptimized: 24198 // gas legacy: 24814 // gas legacyOptimized: 24062 // gm(uint256,uint256): 3141592653589793238, 88714123 -> 16694419339601 -// gas irOptimized: 23036 +// gas irOptimized: 22950 // gas legacy: 23269 // gas legacyOptimized: 22724 // log10(uint256): 3141592653589793238 -> 0x44fe4fc084a52b8a -// gas irOptimized: 29892 +// gas irOptimized: 30269 // gas legacy: 32898 // gas legacyOptimized: 29925 // log2(uint256): 3141592653589793238 -> 1651496129472318782 -// gas irOptimized: 27822 +// gas irOptimized: 28235 // gas legacy: 30986 // gas legacyOptimized: 28001 // mul(uint256,uint256): 3141592653589793238, 88714123 -> 278703637 -// gas irOptimized: 22094 +// gas irOptimized: 22048 // gas legacy: 22604 // gas legacyOptimized: 22090 // pow(uint256,uint256): 3141592653589793238, 5 -> 306019684785281453040 -// gas irOptimized: 22565 +// gas irOptimized: 22406 // gas legacy: 23245 // gas legacyOptimized: 22646 // sqrt(uint256): 3141592653589793238 -> 1772453850905516027 -// gas irOptimized: 22720 +// gas irOptimized: 22672 // gas legacy: 22820 // gas legacyOptimized: 22440 // benchmark(uint256): 3141592653589793238 -> 998882724338592125, 1000000000000000000, 1000000000000000000 -// gas irOptimized: 36587 +// gas irOptimized: 35603 // gas legacy: 35385 // gas legacyOptimized: 33449 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index 2c9376b22..1fc85adff 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -35,10 +35,10 @@ contract test { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 528041 +// gas irOptimized: 465357 // gas legacy: 733634 // gas legacyOptimized: 479606 // prb_pi() -> 3141592656369545286 -// gas irOptimized: 63027 +// gas irOptimized: 57478 // gas legacy: 98903 // gas legacyOptimized: 75735 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index 7a7b95695..8f6b939fd 100644 --- a/test/libsolidity/semanticTests/externalContracts/snark.sol +++ b/test/libsolidity/semanticTests/externalContracts/snark.sol @@ -297,6 +297,6 @@ contract Test { // pair() -> true // verifyTx() -> true // ~ emit Verified(string): 0x20, 0x16, "Successfully verified." -// gas irOptimized: 101054 +// gas irOptimized: 95261 // gas legacy: 114094 // gas legacyOptimized: 83670 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index 1fa79f382..238ed2184 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -51,26 +51,26 @@ contract test { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 778254 +// gas irOptimized: 702619 // gas legacy: 1188228 // gas legacyOptimized: 750416 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 -// gas irOptimized: 22734 +// gas irOptimized: 22660 // gas legacy: 23190 // gas legacyOptimized: 22508 // roundtrip(string): 0x20, 11, "hello world" -> 0x20, 11, "hello world" -// gas irOptimized: 23513 +// gas irOptimized: 23408 // gas legacy: 23820 // gas legacyOptimized: 23123 // utf8len(string): 0x20, 16, "\xf0\x9f\x98\x83\xf0\x9f\x98\x83\xf0\x9f\x98\x83\xf0\x9f\x98\x83" -> 4 # Input: "😃😃😃😃" # -// gas irOptimized: 24266 +// gas irOptimized: 24026 // gas legacy: 25716 // gas legacyOptimized: 24115 // multiconcat(string,uint256): 0x40, 3, 11, "hello world" -> 0x20, 0x58, 0x68656c6c6f20776f726c6468656c6c6f20776f726c6468656c6c6f20776f726c, 0x6468656c6c6f20776f726c6468656c6c6f20776f726c6468656c6c6f20776f72, 49027192869463622675296414541903001712009715982962058146354235762728281047040 # concatenating 3 times # -// gas irOptimized: 28958 +// gas irOptimized: 28440 // gas legacy: 31621 // gas legacyOptimized: 27914 // benchmark(string,bytes32): 0x40, 0x0842021, 8, "solidity" -> 0x2020 -// gas irOptimized: 2235661 +// gas irOptimized: 2040067 // gas legacy: 4381235 // gas legacyOptimized: 2317529 diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index b4e7efbb5..b50890f55 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -18,7 +18,7 @@ contract C { // compileViaYul: also // ---- // constructor(), 20 wei -// gas irOptimized: 219233 +// gas irOptimized: 220113 // gas legacy: 288299 // gas legacyOptimized: 177933 // f(uint256): 20 -> 1370859564726510389319704988634906228201275401179 @@ -26,7 +26,7 @@ contract C { // f(uint256): 20 -> FAILURE // x() -> 1 // stack(uint256): 1023 -> FAILURE -// gas irOptimized: 349023 +// gas irOptimized: 345821 // gas legacy: 535367 // gas legacyOptimized: 354656 // x() -> 1 diff --git a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol index 5d4f25a39..f01a590eb 100644 --- a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol +++ b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol @@ -20,7 +20,7 @@ contract test { // compileViaYul: also // ---- // set(uint8,uint8,uint8,uint8,uint8): 1, 21, 22, 42, 43 -> 0, 0, 0, 0 -// gas irOptimized: 112020 +// gas irOptimized: 111965 // gas legacy: 113806 // gas legacyOptimized: 111781 // get(uint8): 1 -> 21, 22, 42, 43 diff --git a/test/libsolidity/semanticTests/functionTypes/store_function.sol b/test/libsolidity/semanticTests/functionTypes/store_function.sol index ddebc11b7..c2678a91d 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: 99010 +// gas irOptimized: 99186 // gas legacy: 159083 // gas legacyOptimized: 108916 diff --git a/test/libsolidity/semanticTests/immutable/multi_creation.sol b/test/libsolidity/semanticTests/immutable/multi_creation.sol index a18306984..cd5992ce6 100644 --- a/test/libsolidity/semanticTests/immutable/multi_creation.sol +++ b/test/libsolidity/semanticTests/immutable/multi_creation.sol @@ -29,7 +29,7 @@ contract C { // compileViaYul: also // ---- // f() -> 3, 7, 5 -// gas irOptimized: 127613 +// gas irOptimized: 127592 // gas legacy: 151590 // gas legacyOptimized: 125422 // x() -> 7 diff --git a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol index 651ac994e..0dc9845f4 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: 78722 +// gas irOptimized: 77164 // gas legacy: 115012 // g() -> 5 -// gas irOptimized: 78811 +// gas irOptimized: 77231 // gas legacy: 115558 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 85b1fca3b..e012accaf 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: 84629 +// gas irOptimized: 80945 // 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 b4f03446c..4105577f0 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: 105784 +// gas irOptimized: 111913 // gas legacy: 185181 // gas legacyOptimized: 114726 diff --git a/test/libsolidity/semanticTests/inlineAssembly/keccak_yul_optimization.sol b/test/libsolidity/semanticTests/inlineAssembly/keccak_yul_optimization.sol index 88ead1eb3..85a93b3dc 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/keccak_yul_optimization.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/keccak_yul_optimization.sol @@ -26,10 +26,10 @@ contract C { // compileViaYul: also // ---- // f() -> 0xcdb56c384a9682c600315e3470157a4cf7638d0d33e9dae5c40ffd2644fc5a80 -// gas irOptimized: 22306 +// gas irOptimized: 22239 // gas legacy: 23385 // gas legacyOptimized: 23092 // g() -> 0xcdb56c384a9682c600315e3470157a4cf7638d0d33e9dae5c40ffd2644fc5a80 -// gas irOptimized: 21287 +// gas irOptimized: 21277 // gas legacy: 21462 // gas legacyOptimized: 21256 diff --git a/test/libsolidity/semanticTests/interface_inheritance_conversions.sol b/test/libsolidity/semanticTests/interface_inheritance_conversions.sol index 70f52d4c6..11cb93832 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: 87655 +// gas irOptimized: 85640 // convertSubA() -> 1, 2 -// gas irOptimized: 88451 +// gas irOptimized: 86395 // gas legacy: 99303 // convertSubB() -> 1, 3 -// gas irOptimized: 88385 +// gas irOptimized: 86338 // gas legacy: 99237 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create.sol b/test/libsolidity/semanticTests/salted_create/salted_create.sol index 064159de3..5374d2352 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create.sol @@ -22,6 +22,6 @@ contract A { // ---- // different_salt() -> true // same_salt() -> true -// gas irOptimized: 98438948 +// gas irOptimized: 98438914 // gas legacy: 98439116 // gas legacyOptimized: 98438970 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 2e386ee45..17edaf3eb 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: 270255 +// gas irOptimized: 273275 // gas legacy: 422885 // gas legacyOptimized: 287856 diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol index 2fdff6c56..caa385887 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: 135141 +// gas irOptimized: 134587 // 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 3587d8e17..7b84033d8 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: 203716 +// gas irOptimized: 203397 // gas legacy: 209194 // 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 93b63ff5c..0d0aba8c8 100644 --- a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol +++ b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol @@ -25,6 +25,6 @@ contract CopyTest { // compileViaYul: also // ---- // run() -> 2, 23, 42 -// gas irOptimized: 195077 +// gas irOptimized: 193980 // 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 f48c54807..12ec4ca18 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: 111174 +// gas irOptimized: 111179 // 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 070fcf920..a677b5be8 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,7 +25,7 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133819 +// gas irOptimized: 133752 // gas legacy: 134436 // gas legacyOptimized: 133879 // test(uint256): 32 -> "3" diff --git a/test/libsolidity/semanticTests/structs/struct_copy.sol b/test/libsolidity/semanticTests/structs/struct_copy.sol index ccaaeaa52..0bbb6489e 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy.sol @@ -38,12 +38,12 @@ contract c { // compileViaYul: also // ---- // set(uint256): 7 -> true -// gas irOptimized: 109985 +// gas irOptimized: 110011 // gas legacy: 110616 // gas legacyOptimized: 110006 // retrieve(uint256): 7 -> 1, 3, 4, 2 // copy(uint256,uint256): 7, 8 -> true -// gas irOptimized: 118701 +// gas irOptimized: 118707 // gas legacy: 119166 // gas legacyOptimized: 118622 // retrieve(uint256): 7 -> 1, 3, 4, 2 diff --git a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol index 441584a5e..21757ea40 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: 110144 +// gas irOptimized: 110186 // 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 838539628..bc18d3192 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: 117388 +// gas irOptimized: 117289 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 14e170a4c..e759520b4 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: 121704 +// gas irOptimized: 121618 // 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 6425c0d37..6f88df394 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: 112160 +// gas irOptimized: 111896 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 caa2b693f..fe791a68d 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 @@ -32,6 +32,6 @@ contract C { // compileViaYul: also // ---- // f() -> 42, 23, 34, 42, 42 -// gas irOptimized: 110592 +// gas irOptimized: 110966 // gas legacy: 112021 // gas legacyOptimized: 110548 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index 46b596e39..b56a2ec22 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: 134389 +// gas irOptimized: 134335 // gas legacy: 135277 // gas legacyOptimized: 134064 // check() -> true diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol index 3596d2c99..1927b2519 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol @@ -51,11 +51,11 @@ contract C { // compileViaYul: also // ---- // test_f() -> true -// gas irOptimized: 122887 +// gas irOptimized: 122509 // gas legacy: 126168 // gas legacyOptimized: 123199 // test_g() -> true -// gas irOptimized: 96673 +// gas irOptimized: 95980 // gas legacy: 101311 // gas legacyOptimized: 96566 // addresses(uint256): 0 -> 0x18 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol index 9827d6cd1..433d1969c 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol @@ -25,18 +25,18 @@ contract C { // ---- // s() -> 0, 0, 0x00, 0 // f((uint8,uint16,bytes2,uint8)): 1, 0xff, "ab", 15 -> -// gas irOptimized: 44860 +// gas irOptimized: 44786 // gas legacy: 47200 // gas legacyOptimized: 44923 // s() -> 1, 0xff, 0x6162000000000000000000000000000000000000000000000000000000000000, 15 // g(uint16[]): 0x20, 3, 1, 2, 3 -> 0x20, 3, 1, 2, 3 -// gas irOptimized: 69306 +// gas irOptimized: 69097 // gas legacy: 75466 // gas legacyOptimized: 74255 // small(uint256): 0 -> 1 // small(uint256): 1 -> 2 // h(bytes2[]): 0x20, 3, "ab", "cd", "ef" -> 0x20, 3, "ab", "cd", "ef" -// gas irOptimized: 69510 +// gas irOptimized: 69174 // gas legacy: 75156 // gas legacyOptimized: 74342 // l(uint256): 0 -> 0x6162000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 155a4bd87..4db14ff73 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -115,33 +115,33 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 462361 +// gas irOptimized: 442239 // gas legacy: 861547 // gas legacyOptimized: 420959 // totalSupply() -> 20 -// gas irOptimized: 23378 +// gas irOptimized: 23415 // gas legacy: 23653 // gas legacyOptimized: 23368 // transfer(address,uint256): 2, 5 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x05 -// gas irOptimized: 48503 +// gas irOptimized: 48471 // gas legacy: 49572 // gas legacyOptimized: 48575 // decreaseAllowance(address,uint256): 2, 0 -> true // ~ emit Approval(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x00 -// gas irOptimized: 26327 +// gas irOptimized: 26275 // gas legacy: 27204 // gas legacyOptimized: 26317 // decreaseAllowance(address,uint256): 2, 1 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 24040 +// gas irOptimized: 24042 // gas legacy: 24506 // gas legacyOptimized: 24077 // transfer(address,uint256): 2, 14 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x0e -// gas irOptimized: 28603 +// gas irOptimized: 28571 // gas legacy: 29672 // gas legacyOptimized: 28675 // transfer(address,uint256): 2, 2 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 24052 +// gas irOptimized: 24071 // gas legacy: 24492 // gas legacyOptimized: 24074 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol b/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol index e1a7c1c5b..04e993682 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol @@ -25,18 +25,18 @@ contract C { // ---- // s() -> 0, 0, 0x00, 0 // f((uint8,uint16,bytes2,uint8)): 1, 0xff, "ab", 15 -> -// gas irOptimized: 44551 +// gas irOptimized: 44536 // gas legacy: 46213 // gas legacyOptimized: 44671 // s() -> 1, 0xff, 0x6162000000000000000000000000000000000000000000000000000000000000, 15 // g(uint16[]): 0x20, 3, 1, 2, 3 -> 0x20, 3, 1, 2, 3 -// gas irOptimized: 69671 +// gas irOptimized: 69555 // gas legacy: 76557 // gas legacyOptimized: 74834 // small(uint256): 0 -> 1 // small(uint256): 1 -> 2 // h(bytes2[]): 0x20, 3, "ab", "cd", "ef" -> 0x20, 3, "ab", "cd", "ef" -// gas irOptimized: 69928 +// gas irOptimized: 69617 // gas legacy: 76238 // gas legacyOptimized: 74921 // l(uint256): 0 -> 0x6162000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_elementary.sol b/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_elementary.sol index d7b9db30b..d2d46c708 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_elementary.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_elementary.sol @@ -20,18 +20,18 @@ contract C { // compileViaYul: also // ---- // getX() -> 0 -// gas irOptimized: 23353 +// gas irOptimized: 23379 // gas legacy: 23479 // gas legacyOptimized: 23311 // setX(int256): 5 -> -// gas irOptimized: 43511 +// gas irOptimized: 43510 // gas legacy: 43724 // gas legacyOptimized: 43516 // getX() -> 5 -// gas irOptimized: 23353 +// gas irOptimized: 23379 // gas legacy: 23479 // gas legacyOptimized: 23311 // add(int256,int256): 200, 99 -> 299 -// gas irOptimized: 21794 +// gas irOptimized: 21764 // gas legacy: 22394 // gas legacyOptimized: 21813 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_userdefined.sol b/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_userdefined.sol index 29038a861..44d87c397 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_userdefined.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/zero_cost_abstraction_comparison_userdefined.sol @@ -21,18 +21,18 @@ contract C { // compileViaYul: also // ---- // getX() -> 0 -// gas irOptimized: 23353 +// gas irOptimized: 23379 // gas legacy: 23608 // gas legacyOptimized: 23311 // setX(int256): 5 -> -// gas irOptimized: 43511 +// gas irOptimized: 43510 // gas legacy: 43724 // gas legacyOptimized: 43516 // getX() -> 5 -// gas irOptimized: 23353 +// gas irOptimized: 23379 // gas legacy: 23608 // gas legacyOptimized: 23311 // add(int256,int256): 200, 99 -> 299 -// gas irOptimized: 21794 +// gas irOptimized: 21764 // gas legacy: 22523 // gas legacyOptimized: 21813 diff --git a/test/libsolidity/semanticTests/various/destructuring_assignment.sol b/test/libsolidity/semanticTests/various/destructuring_assignment.sol index b8a314d32..ee6f7690d 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: 240334 +// gas irOptimized: 240685 // gas legacy: 240358 // gas legacyOptimized: 239682 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index 6e7487ee5..204e620d6 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -98,33 +98,33 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 459547 +// gas irOptimized: 437697 // gas legacy: 833310 // gas legacyOptimized: 416135 // totalSupply() -> 20 -// gas irOptimized: 23378 +// gas irOptimized: 23415 // gas legacy: 23524 // gas legacyOptimized: 23368 // transfer(address,uint256): 2, 5 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x05 -// gas irOptimized: 48503 +// gas irOptimized: 48471 // gas legacy: 49317 // gas legacyOptimized: 48491 // decreaseAllowance(address,uint256): 2, 0 -> true // ~ emit Approval(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x00 -// gas irOptimized: 26327 +// gas irOptimized: 26275 // gas legacy: 27012 // gas legacyOptimized: 26275 // decreaseAllowance(address,uint256): 2, 1 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 24040 +// gas irOptimized: 24042 // gas legacy: 24467 // gas legacyOptimized: 24056 // transfer(address,uint256): 2, 14 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x0e -// gas irOptimized: 28603 +// gas irOptimized: 28571 // gas legacy: 29417 // gas legacyOptimized: 28591 // transfer(address,uint256): 2, 2 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 24052 +// gas irOptimized: 24071 // gas legacy: 24453 // gas legacyOptimized: 24053 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 a8e9ce1ed..8ef472136 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: 178952 +// gas irOptimized: 178953 // 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 33afcb66f..ab6d6e59a 100644 --- a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol +++ b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol @@ -38,10 +38,10 @@ contract D { // f() -> 0x1 # This should work, next should throw # // gas legacy: 103844 // fview() -> FAILURE -// gas irOptimized: 98438630 +// gas irOptimized: 98438627 // gas legacy: 98438803 // gas legacyOptimized: 98438596 // fpure() -> FAILURE -// gas irOptimized: 98438630 +// gas irOptimized: 98438627 // 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 12e491968..c8398b2bf 100644 --- a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol +++ b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol @@ -30,7 +30,7 @@ contract c { // x() -> 0, 0 // y() -> 0, 0 // set() -> -// gas irOptimized: 109734 +// gas irOptimized: 109733 // gas legacy: 109732 // gas legacyOptimized: 109682 // x() -> 1, 2 diff --git a/test/libsolidity/semanticTests/viaYul/array_memory_index_access.sol b/test/libsolidity/semanticTests/viaYul/array_memory_index_access.sol index 83aefbc61..b603fb786 100644 --- a/test/libsolidity/semanticTests/viaYul/array_memory_index_access.sol +++ b/test/libsolidity/semanticTests/viaYul/array_memory_index_access.sol @@ -28,7 +28,7 @@ contract C { // index(uint256): 10 -> true // index(uint256): 20 -> true // index(uint256): 0xFF -> true -// gas irOptimized: 151952 +// gas irOptimized: 138441 // gas legacy: 248854 // gas legacyOptimized: 152638 // accessIndex(uint256,int256): 10, 1 -> 2 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol b/test/libsolidity/semanticTests/viaYul/array_storage_index_access.sol index 5241f29c0..24d0e9f14 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: 3041780 +// gas irOptimized: 3032986 // gas legacy: 3071205 // gas legacyOptimized: 3011873 // test_indices(uint256): 5 -> -// gas irOptimized: 368208 +// gas irOptimized: 367642 // gas legacy: 369241 // gas legacyOptimized: 366149 // test_indices(uint256): 10 -> // test_indices(uint256): 15 -> -// gas irOptimized: 73803 +// gas irOptimized: 72860 // test_indices(uint256): 0xFF -> -// gas irOptimized: 3455818 +// gas irOptimized: 3438610 // gas legacy: 3514167 // gas legacyOptimized: 3398107 // test_indices(uint256): 1000 -> -// gas irOptimized: 18383600 +// gas irOptimized: 18318372 // gas legacy: 18617999 // gas legacyOptimized: 18178944 // test_indices(uint256): 129 -> -// gas irOptimized: 2742698 +// gas irOptimized: 2733570 // gas legacy: 2772735 // gas legacyOptimized: 2716547 // test_indices(uint256): 128 -> -// gas irOptimized: 434013 +// gas irOptimized: 426682 // gas legacy: 467272 // gas legacyOptimized: 418424 // test_indices(uint256): 1 -> -// gas irOptimized: 363418 +// gas irOptimized: 363074 // 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 4b377ec2d..975130c51 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol @@ -18,11 +18,11 @@ contract C { // test_boundary_check(uint256,uint256): 1, 1 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 10, 10 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 256, 256 -> FAILURE, hex"4e487b71", 0x32 -// gas irOptimized: 139319 +// gas irOptimized: 137849 // gas legacy: 131830 // gas legacyOptimized: 112054 // test_boundary_check(uint256,uint256): 256, 255 -> 0 -// gas irOptimized: 141481 +// gas irOptimized: 140028 // gas legacy: 134149 // gas legacyOptimized: 114233 // test_boundary_check(uint256,uint256): 256, 0xFFFF -> FAILURE, hex"4e487b71", 0x32 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 870f339fc..b2e0cb546 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: 131736 +// gas irOptimized: 131197 // gas legacy: 132367 // gas legacyOptimized: 129586 // test_zeroed_indicies(uint256): 10 -> -// gas irOptimized: 175795 +// gas irOptimized: 174805 // gas legacy: 177329 // gas legacyOptimized: 172224 // test_zeroed_indicies(uint256): 15 -> -// gas irOptimized: 199485 +// gas irOptimized: 198055 // gas legacy: 201954 // gas legacyOptimized: 194604 // test_zeroed_indicies(uint256): 0xFF -> -// gas irOptimized: 6123320 +// gas irOptimized: 6098185 // 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 47b75c08e..c5af58449 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: 96934 +// gas irOptimized: 96690 // gas legacy: 126722 // gas legacyOptimized: 107818 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1221706 +// gas irOptimized: 1217857 // 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 05970805f..5c7c4cba8 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol @@ -13,11 +13,11 @@ contract C { // compileViaYul: also // ---- // pushEmpty(uint256): 128 -// gas irOptimized: 414881 +// gas irOptimized: 412570 // gas legacy: 417287 // gas legacyOptimized: 399048 // pushEmpty(uint256): 256 -// gas irOptimized: 706405 +// gas irOptimized: 702558 // gas legacy: 715083 // gas legacyOptimized: 688908 // pushEmpty(uint256): 38869 -> FAILURE # out-of-gas # 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 06e00f6db..5e5d1c962 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,15 @@ contract C { // set_get_length(uint256): 10 -> 10 // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0 -> 0 -// gas irOptimized: 77961 +// gas irOptimized: 77628 // gas legacy: 77730 // gas legacyOptimized: 77162 // set_get_length(uint256): 0xFF -> 0xFF -// gas irOptimized: 143348 +// gas irOptimized: 141805 // gas legacy: 678237 // gas legacyOptimized: 115104 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1824725 +// gas irOptimized: 1801672 // gas legacy: 9873774 // gas legacyOptimized: 1398546 // set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol b/test/libsolidity/semanticTests/viaYul/array_storage_push_pop.sol index 7cc1f9e54..e802e3687 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: 86888 +// gas irOptimized: 86331 // gas legacy: 85822 // gas legacyOptimized: 83608 // set_get_length(uint256): 0xFF -> 0 -// gas irOptimized: 828783 +// gas irOptimized: 821881 // gas legacy: 810327 // gas legacyOptimized: 786258 // set_get_length(uint256): 0xFFF -> 0 -// gas irOptimized: 12951675 +// gas irOptimized: 12841093 // gas legacy: 12649059 // gas legacyOptimized: 12267870 // set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas # diff --git a/test/libyul/EVMCodeTransformTest.cpp b/test/libyul/EVMCodeTransformTest.cpp index 38ef5ad39..8986acc1b 100644 --- a/test/libyul/EVMCodeTransformTest.cpp +++ b/test/libyul/EVMCodeTransformTest.cpp @@ -20,6 +20,10 @@ #include #include +#include +#include + +#include #include @@ -61,7 +65,18 @@ TestCase::TestResult EVMCodeTransformTest::run(ostream& _stream, string const& _ return TestResult::FatalError; } - m_obtainedResult = evmasm::disassemble(stack.assemble(AssemblyStack::Machine::EVM).bytecode->bytecode, "\n"); + evmasm::Assembly assembly; + EthAssemblyAdapter adapter(assembly); + EVMObjectCompiler::compile( + *stack.parserResult(), + adapter, + EVMDialect::strictAssemblyForEVMObjects(EVMVersion{}), + m_stackOpt + ); + + std::ostringstream output; + output << assembly; + m_obtainedResult = output.str(); return checkResult(_stream, _linePrefix, _formatted); } diff --git a/test/libyul/evmCodeTransform/early_push_on_deep_swap.yul b/test/libyul/evmCodeTransform/early_push_on_deep_swap.yul new file mode 100644 index 000000000..5e119cc73 --- /dev/null +++ b/test/libyul/evmCodeTransform/early_push_on_deep_swap.yul @@ -0,0 +1,54 @@ +{ + extcodecopy(div(div(call(call(gas(),0x10000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000, 0x10000000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000), 0x10000000000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000000, 0x10000000000000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000000000),0x10000000000000000000000000000000000000000000000000000000000000),0x100000000000000000000000000000000000000000000000000000000000000), 0x1000000000000000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000000000001, 0x100000000000000000000000000000000000000000000000000000000000001) +} +// ==== +// stackOptimization: true +// ---- +// /* "":1027:1092 */ +// 0x0100000000000000000000000000000000000000000000000000000000000001 +// /* "":959:1025 */ +// 0x1000000000000000000000000000000000000000000000000000000000000001 +// /* "":891:957 */ +// 0x1000000000000000000000000000000000000000000000000000000000000000 +// /* "":823:888 */ +// 0x0100000000000000000000000000000000000000000000000000000000000000 +// /* "":757:821 */ +// 0x10000000000000000000000000000000000000000000000000000000000000 +// /* "":692:755 */ +// 0x01000000000000000000000000000000000000000000000000000000000000 +// /* "":628:690 */ +// 0x100000000000000000000000000000000000000000000000000000000000 +// /* "":565:626 */ +// 0x010000000000000000000000000000000000000000000000000000000000 +// /* "":503:563 */ +// 0x1000000000000000000000000000000000000000000000000000000000 +// /* "":442:501 */ +// 0x0100000000000000000000000000000000000000000000000000000000 +// /* "":382:440 */ +// 0x10000000000000000000000000000000000000000000000000000000 +// /* "":322:379 */ +// 0x01000000000000000000000000000000000000000000000000000000 +// /* "":264:320 */ +// 0x100000000000000000000000000000000000000000000000000000 +// /* "":207:262 */ +// 0x010000000000000000000000000000000000000000000000000000 +// /* "":151:205 */ +// 0x1000000000000000000000000000000000000000000000000000 +// /* "":96:149 */ +// 0x0100000000000000000000000000000000000000000000000000 +// /* "":42:94 */ +// 0x10000000000000000000000000000000000000000000000000 +// /* "":36:41 */ +// gas +// /* "":31:380 */ +// call +// /* "":26:756 */ +// call +// /* "":22:822 */ +// div +// /* "":18:889 */ +// div +// /* "":6:1093 */ +// extcodecopy +// /* "":0:1095 */ +// stop diff --git a/test/libyul/evmCodeTransform/literal_loop.yul b/test/libyul/evmCodeTransform/literal_loop.yul new file mode 100644 index 000000000..d743836cb --- /dev/null +++ b/test/libyul/evmCodeTransform/literal_loop.yul @@ -0,0 +1,74 @@ +object "main" { + code { + codecopy(0, dataoffset("deployed"), datasize("deployed")) + return(0, datasize("deployed")) + } + object "deployed" { + code { + for {} + add(delegatecall(delegatecall(call(selfbalance(), 0x0, 0x0, 0x0, 0x0, 0x0, 0x0), 0x0, 0x0, 0x0, 0x0, 0x0), 0x0, 0x0, 0x0, 0x0, 0x0),0x0) + {} + {} + } + } +} +// ==== +// stackOptimization: true +// ---- +// /* "":62:82 */ +// dataSize(sub_0) +// /* "":38:60 */ +// dataOffset(sub_0) +// /* "":35:36 */ +// 0x00 +// /* "":26:83 */ +// codecopy +// /* "":96:116 */ +// dataSize(sub_0) +// /* "":93:94 */ +// 0x00 +// /* "":86:117 */ +// return +// stop +// +// sub_0: assembly { +// /* "":164:300 */ +// tag_1: +// /* "":296:299 */ +// 0x00 +// /* "":199:212 */ +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// dup1 +// selfbalance +// /* "":194:243 */ +// call +// /* "":181:269 */ +// delegatecall +// /* "":168:295 */ +// delegatecall +// /* "":164:300 */ +// add +// tag_2 +// jumpi +// /* "":154:312 */ +// tag_3: +// stop +// /* "":310:312 */ +// tag_2: +// /* "":304:306 */ +// jump(tag_1) +// } diff --git a/test/libyul/evmCodeTransform/nonempty_initial_layout.yul b/test/libyul/evmCodeTransform/nonempty_initial_layout.yul new file mode 100644 index 000000000..eb1a787c0 --- /dev/null +++ b/test/libyul/evmCodeTransform/nonempty_initial_layout.yul @@ -0,0 +1,17 @@ +{ + if 0x2000000000000000000000000000000000000000000000000000000000 {} +} +// ==== +// stackOptimization: true +// ---- +// /* "":9:69 */ +// 0x2000000000000000000000000000000000000000000000000000000000 +// /* "":6:72 */ +// tag_1 +// jumpi +// /* "":0:74 */ +// tag_2: +// stop +// /* "":70:72 */ +// tag_1: +// jump(tag_2) diff --git a/test/libyul/evmCodeTransform/stackReuse/for_1.yul b/test/libyul/evmCodeTransform/stackReuse/for_1.yul index e2f4ba128..b02710598 100644 --- a/test/libyul/evmCodeTransform/stackReuse/for_1.yul +++ b/test/libyul/evmCodeTransform/stackReuse/for_1.yul @@ -2,18 +2,15 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// POP -// JUMPDEST -// PUSH1 0x1 -// ISZERO -// PUSH1 0x11 -// JUMPI -// PUSH1 0x3 -// POP -// JUMPDEST -// PUSH1 0x3 -// JUMP -// JUMPDEST -// PUSH1 0x2 -// POP +// /* "":17:18 */ +// 0x00 +// /* "":6:20 */ +// pop +// /* "":27:41 */ +// tag_1: +// /* "":38:39 */ +// 0x03 +// /* "":27:41 */ +// pop +// /* "":23:26 */ +// jump(tag_1) diff --git a/test/libyul/evmCodeTransform/stackReuse/for_2.yul b/test/libyul/evmCodeTransform/stackReuse/for_2.yul index f1f7460d4..37d372fb9 100644 --- a/test/libyul/evmCodeTransform/stackReuse/for_2.yul +++ b/test/libyul/evmCodeTransform/stackReuse/for_2.yul @@ -2,21 +2,19 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// JUMPDEST -// PUSH1 0x1 -// ISZERO -// PUSH1 0x14 -// JUMPI -// PUSH1 0x8 -// SWAP1 -// POP -// PUSH1 0x3 -// POP -// JUMPDEST -// PUSH1 0x2 -// JUMP -// JUMPDEST -// POP -// PUSH1 0x2 -// POP +// /* "":17:18 */ +// 0x00 +// /* "":6:20 */ +// pop +// /* "":27:48 */ +// tag_1: +// /* "":34:35 */ +// 0x08 +// /* "":36:46 */ +// pop +// /* "":45:46 */ +// 0x03 +// /* "":27:48 */ +// pop +// /* "":23:26 */ +// jump(tag_1) diff --git a/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse.yul b/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse.yul index 13048c020..96637da89 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse.yul @@ -4,25 +4,23 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x17 -// JUMP -// JUMPDEST -// ADDRESS -// POP -// DUP3 -// DUP2 -// SSTORE -// POP -// CALLVALUE -// POP -// PUSH1 0x0 -// DUP2 -// SWAP1 -// POP -// JUMPDEST -// SWAP3 -// SWAP2 -// POP -// POP -// JUMP -// JUMPDEST +// /* "":0:88 */ +// stop +// /* "":6:86 */ +// tag_1: +// swap2 +// swap1 +// swap2 +// /* "":37:46 */ +// address +// /* "":33:47 */ +// pop +// /* "":48:60 */ +// sstore +// /* "":65:76 */ +// callvalue +// /* "":61:77 */ +// pop +// /* "":6:86 */ +// swap1 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul b/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul index d1f6b5bdc..385c253df 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul @@ -7,23 +7,31 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x17 -// JUMP -// JUMPDEST -// DUP1 -// PUSH1 0x80 -// MSTORE -// POP -// PUSH1 0x0 -// CALLDATALOAD -// ISZERO -// PUSH1 0x13 -// JUMPI -// DUP1 -// DUP2 -// SSTORE -// JUMPDEST -// POP -// JUMPDEST -// JUMP -// JUMPDEST +// /* "":0:88 */ +// stop +// /* "":4:86 */ +// tag_1: +// /* "":34:38 */ +// 0x80 +// /* "":27:42 */ +// mstore +// /* "":63:64 */ +// 0x00 +// /* "":50:65 */ +// calldataload +// /* "":47:82 */ +// tag_2 +// jumpi +// /* "":21:86 */ +// tag_3: +// /* "":4:86 */ +// pop +// jump // out +// /* "":66:82 */ +// tag_2: +// /* "":68:80 */ +// dup1 +// sstore +// /* "":66:82 */ +// codesize +// jump(tag_3) diff --git a/test/libyul/evmCodeTransform/stackReuse/function_call.yul b/test/libyul/evmCodeTransform/stackReuse/function_call.yul index c14ccff36..507b35441 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_call.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_call.yul @@ -6,28 +6,35 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x9 -// PUSH1 0x2 -// PUSH1 0x1 -// PUSH1 0xD -// JUMP -// JUMPDEST -// PUSH1 0x15 -// JUMP -// JUMPDEST -// POP -// POP -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST -// PUSH1 0x1F -// PUSH1 0x4 -// PUSH1 0x3 -// PUSH1 0xD -// JUMP -// JUMPDEST -// SWAP1 -// POP -// POP +// /* "":15:22 */ +// tag_2 +// /* "":20:21 */ +// 0x02 +// /* "":17:18 */ +// 0x01 +// /* "":15:22 */ +// tag_1 +// jump // in +// tag_2: +// /* "":62:69 */ +// pop +// tag_3 +// /* "":67:68 */ +// 0x04 +// /* "":64:65 */ +// 0x03 +// /* "":62:69 */ +// tag_1 +// jump // in +// tag_3: +// /* "":0:71 */ +// stop +// /* "":27:52 */ +// tag_1: +// pop +// pop +// /* "":47:48 */ +// 0x00 +// /* "":27:52 */ +// swap1 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_many_arguments.yul b/test/libyul/evmCodeTransform/stackReuse/function_many_arguments.yul index aa4567a90..17ccdd3ca 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_many_arguments.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_many_arguments.yul @@ -25,92 +25,86 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x80 -// JUMP -// JUMPDEST -// DUP1 -// PUSH2 0x100 -// MSTORE -// POP -// DUP1 -// PUSH2 0x120 -// MSTORE -// POP -// DUP1 -// PUSH2 0x140 -// MSTORE -// POP -// DUP1 -// PUSH2 0x160 -// MSTORE -// POP -// DUP1 -// PUSH2 0x180 -// MSTORE -// POP -// DUP1 -// PUSH2 0x1A0 -// MSTORE -// POP -// DUP1 -// PUSH2 0x1C0 -// MSTORE -// POP -// DUP1 -// PUSH2 0x1E0 -// MSTORE -// POP -// DUP1 -// PUSH2 0x200 -// MSTORE -// POP -// DUP1 -// PUSH2 0x220 -// MSTORE -// POP -// DUP1 -// PUSH2 0x240 -// MSTORE -// POP -// DUP1 -// PUSH2 0x260 -// MSTORE -// POP -// DUP1 -// PUSH2 0x280 -// MSTORE -// POP -// DUP1 -// PUSH2 0x2A0 -// MSTORE -// POP -// DUP1 -// PUSH2 0x2C0 -// MSTORE -// POP -// DUP1 -// PUSH2 0x2E0 -// MSTORE -// POP -// DUP1 -// PUSH2 0x300 -// MSTORE -// POP -// DUP1 -// PUSH2 0x320 -// MSTORE -// POP -// DUP1 -// PUSH2 0x340 -// MSTORE -// POP -// PUSH1 0x0 -// DUP2 -// SWAP1 -// POP -// JUMPDEST -// SWAP2 -// SWAP1 -// POP -// JUMP -// JUMPDEST +// /* "":0:662 */ +// stop +// /* "":6:660 */ +// tag_1: +// /* "":130:136 */ +// 0x0100 +// /* "":123:141 */ +// mstore +// /* "":157:163 */ +// 0x0120 +// /* "":150:168 */ +// mstore +// /* "":184:190 */ +// 0x0140 +// /* "":177:195 */ +// mstore +// /* "":211:217 */ +// 0x0160 +// /* "":204:222 */ +// mstore +// /* "":238:244 */ +// 0x0180 +// /* "":231:249 */ +// mstore +// /* "":265:271 */ +// 0x01a0 +// /* "":258:276 */ +// mstore +// /* "":292:298 */ +// 0x01c0 +// /* "":285:303 */ +// mstore +// /* "":319:325 */ +// 0x01e0 +// /* "":312:330 */ +// mstore +// /* "":346:352 */ +// 0x0200 +// /* "":339:357 */ +// mstore +// /* "":373:379 */ +// 0x0220 +// /* "":366:385 */ +// mstore +// /* "":401:407 */ +// 0x0240 +// /* "":394:413 */ +// mstore +// /* "":429:435 */ +// 0x0260 +// /* "":422:441 */ +// mstore +// /* "":457:463 */ +// 0x0280 +// /* "":450:469 */ +// mstore +// /* "":485:491 */ +// 0x02a0 +// /* "":478:497 */ +// mstore +// /* "":513:519 */ +// 0x02c0 +// /* "":506:525 */ +// mstore +// /* "":541:547 */ +// 0x02e0 +// /* "":534:553 */ +// mstore +// /* "":569:575 */ +// 0x0300 +// /* "":562:581 */ +// mstore +// /* "":597:603 */ +// 0x0320 +// /* "":590:609 */ +// mstore +// /* "":625:631 */ +// 0x0340 +// /* "":618:637 */ +// mstore +// /* "":6:660 */ +// swap1 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_params.yul b/test/libyul/evmCodeTransform/stackReuse/function_params.yul index 60139bb76..e8d9bb30c 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_params.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_params.yul @@ -4,11 +4,10 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x8 -// JUMP -// JUMPDEST -// POP -// POP -// JUMPDEST -// JUMP -// JUMPDEST +// /* "":0:28 */ +// stop +// /* "":6:26 */ +// tag_1: +// pop +// pop +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams.yul b/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams.yul index 3228637dc..529203400 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams.yul @@ -8,17 +8,18 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x10 -// JUMP -// JUMPDEST -// POP -// POP -// POP -// POP -// PUSH1 0x0 -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// SWAP2 -// JUMP -// JUMPDEST +// /* "":212:254 */ +// stop +// /* "":218:252 */ +// tag_1: +// pop +// pop +// pop +// pop +// /* "":247:248 */ +// 0x00 +// /* "":244:245 */ +// 0x00 +// /* "":218:252 */ +// swap2 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams_partly_used.yul b/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams_partly_used.yul index 089892a66..d0fc0506f 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams_partly_used.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_params_and_retparams_partly_used.yul @@ -4,28 +4,31 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x1E -// JUMP -// JUMPDEST -// POP -// PUSH1 0x3 -// SWAP1 -// POP -// POP -// POP -// POP -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x9 -// PUSH1 0x2 -// SWAP2 -// POP -// DUP2 -// DUP2 -// MSTORE -// POP -// JUMPDEST -// SWAP1 -// SWAP2 -// JUMP -// JUMPDEST +// /* "":0:80 */ +// stop +// /* "":6:78 */ +// tag_1: +// pop +// pop +// pop +// pop +// /* "":32:33 */ +// 0x00 +// /* "":6:78 */ +// swap1 +// /* "":44:45 */ +// 0x03 +// /* "":46:56 */ +// pop +// /* "":55:56 */ +// 0x09 +// /* "":57:63 */ +// swap1 +// /* "":62:63 */ +// 0x02 +// /* "":64:76 */ +// dup1 +// swap3 +// mstore +// /* "":6:78 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam.yul index 4dde5208b..bee0d3f63 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam.yul @@ -4,13 +4,14 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0xC -// JUMP -// JUMPDEST -// PUSH1 0x0 -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// SWAP2 -// JUMP -// JUMPDEST +// /* "":0:32 */ +// stop +// /* "":6:30 */ +// tag_1: +// /* "":25:26 */ +// 0x00 +// /* "":22:23 */ +// 0x00 +// /* "":6:30 */ +// swap2 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_block.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_block.yul index 3c1d90bd3..5a9e7704e 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_block.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_block.yul @@ -4,15 +4,21 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0xD -// JUMP -// JUMPDEST -// ADDRESS -// POP -// PUSH1 0x0 -// CALLVALUE -// POP -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:65 */ +// stop +// /* "":6:63 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:63 */ +// swap1 +// /* "":30:39 */ +// address +// /* "":26:40 */ +// pop +// /* "":47:58 */ +// callvalue +// /* "":43:59 */ +// pop +// /* "":6:63 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_declaration.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_declaration.yul index fe99402f4..97bffac38 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_declaration.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_declaration.yul @@ -4,15 +4,20 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0xD -// JUMP -// JUMPDEST -// ADDRESS -// POP -// PUSH1 0x0 -// CALLVALUE -// POP -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:65 */ +// stop +// /* "":6:63 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:63 */ +// swap1 +// /* "":30:39 */ +// address +// /* "":26:40 */ +// pop +// /* "":50:61 */ +// callvalue +// /* "":6:63 */ +// pop +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_for.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_for.yul index 7dcb39c10..c18fb7c37 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_for.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_for.yul @@ -4,24 +4,21 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x19 -// JUMP -// JUMPDEST -// ADDRESS -// POP -// PUSH1 0x0 -// CALLVALUE -// POP -// JUMPDEST -// PUSH1 0x0 -// ISZERO -// PUSH1 0x15 -// JUMPI -// JUMPDEST -// PUSH1 0xA -// JUMP -// JUMPDEST -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:78 */ +// stop +// /* "":6:76 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:76 */ +// swap1 +// /* "":30:39 */ +// address +// /* "":26:40 */ +// pop +// /* "":51:62 */ +// callvalue +// /* "":47:63 */ +// pop +// /* "":6:76 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_if.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_if.yul index bd882240f..08dda5a3b 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_if.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_if.yul @@ -4,20 +4,32 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x14 -// JUMP -// JUMPDEST -// ADDRESS -// POP -// PUSH1 0x0 -// PUSH1 0x1 -// ISZERO -// PUSH1 0x10 -// JUMPI -// CALLVALUE -// POP -// JUMPDEST -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:70 */ +// stop +// /* "":6:68 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:68 */ +// swap1 +// /* "":44:45 */ +// 0x01 +// /* "":30:39 */ +// address +// /* "":26:40 */ +// pop +// /* "":41:66 */ +// tag_2 +// jumpi +// /* "":24:68 */ +// tag_3: +// /* "":6:68 */ +// jump // out +// /* "":46:66 */ +// tag_2: +// /* "":52:63 */ +// callvalue +// /* "":48:64 */ +// pop +// /* "":46:66 */ +// jump(tag_3) diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_leave.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_leave.yul index 2e16c05d5..9ac0c00bf 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_leave.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_leave.yul @@ -4,17 +4,17 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x10 -// JUMP -// JUMPDEST -// ADDRESS -// POP -// PUSH1 0x0 -// PUSH1 0xD -// JUMP -// CALLVALUE -// POP -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:67 */ +// stop +// /* "":6:65 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:65 */ +// swap1 +// /* "":30:39 */ +// address +// /* "":26:40 */ +// pop +// /* "":41:46 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_read.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_read.yul index d8440b86e..fcc8278e6 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_read.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_read.yul @@ -4,18 +4,27 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x11 -// JUMP -// JUMPDEST -// ADDRESS -// POP -// PUSH1 0x0 -// DUP1 -// PUSH1 0x0 -// SSTORE -// CALLVALUE -// POP -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:74 */ +// stop +// /* "":6:72 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:72 */ +// swap1 +// /* "":30:39 */ +// address +// /* "":26:40 */ +// pop +// /* "":41:53 */ +// dup2 +// /* "":48:49 */ +// 0x00 +// /* "":41:53 */ +// sstore +// /* "":58:69 */ +// callvalue +// /* "":54:70 */ +// pop +// /* "":6:72 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned.yul index c20158eae..1cc19a464 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned.yul @@ -4,13 +4,17 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0xB -// JUMP -// JUMPDEST -// CALLVALUE -// POP -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST +// /* "":0:46 */ +// stop +// /* "":6:44 */ +// tag_1: +// /* "":22:23 */ +// 0x00 +// /* "":6:44 */ +// swap1 +// /* "":30:41 */ +// callvalue +// /* "":26:42 */ +// pop +// /* "":6:44 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned_multiple.yul b/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned_multiple.yul index d9e80547e..e44e3b437 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned_multiple.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_retparam_unassigned_multiple.yul @@ -4,17 +4,21 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x11 -// JUMP -// JUMPDEST -// CALLVALUE -// POP -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// SWAP2 -// SWAP3 -// JUMP -// JUMPDEST +// /* "":0:52 */ +// stop +// /* "":6:50 */ +// tag_1: +// /* "":25:26 */ +// 0x00 +// /* "":28:29 */ +// 0x00 +// /* "":22:23 */ +// 0x00 +// /* "":6:50 */ +// swap3 +// /* "":36:47 */ +// callvalue +// /* "":32:48 */ +// pop +// /* "":6:50 */ +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_trivial.yul b/test/libyul/evmCodeTransform/stackReuse/function_trivial.yul index 2c803e85f..3d6286efd 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_trivial.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_trivial.yul @@ -4,9 +4,8 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x6 -// JUMP -// JUMPDEST -// JUMPDEST -// JUMP -// JUMPDEST +// /* "":0:22 */ +// stop +// /* "":4:20 */ +// tag_1: +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/function_with_body_embedded.yul b/test/libyul/evmCodeTransform/stackReuse/function_with_body_embedded.yul index 60f287734..f8480bc91 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_with_body_embedded.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_with_body_embedded.yul @@ -9,27 +9,22 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x3 -// PUSH1 0x17 -// JUMP -// JUMPDEST -// PUSH1 0x0 -// DUP2 -// POP -// PUSH1 0x3 -// SWAP2 -// POP -// DUP2 -// SWAP1 -// POP -// JUMPDEST -// SWAP3 -// SWAP2 -// POP -// POP -// JUMP -// JUMPDEST -// PUSH1 0x7 -// SWAP1 -// POP -// POP +// /* "":15:16 */ +// 0x03 +// /* "":177:183 */ +// pop +// /* "":182:183 */ +// 0x07 +// /* "":0:185 */ +// stop +// /* "":21:172 */ +// tag_1: +// swap1 +// pop +// /* "":153:159 */ +// pop +// /* "":158:159 */ +// 0x03 +// /* "":21:172 */ +// swap1 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/functions_multi_return.yul b/test/libyul/evmCodeTransform/stackReuse/functions_multi_return.yul index 6189e1614..1ce02483d 100644 --- a/test/libyul/evmCodeTransform/stackReuse/functions_multi_return.yul +++ b/test/libyul/evmCodeTransform/stackReuse/functions_multi_return.yul @@ -10,51 +10,62 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x14 -// JUMP -// JUMPDEST -// POP -// POP -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// JUMP -// JUMPDEST -// PUSH1 0x0 -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// SWAP2 -// JUMP -// JUMPDEST -// PUSH1 0x1E -// PUSH1 0x2 -// PUSH1 0x1 -// PUSH1 0x3 -// JUMP -// JUMPDEST -// PUSH1 0x28 -// PUSH1 0x4 -// PUSH1 0x3 -// PUSH1 0x3 -// JUMP -// JUMPDEST -// SWAP1 -// POP -// POP -// PUSH1 0x31 -// PUSH1 0xB -// JUMP -// JUMPDEST -// PUSH1 0x37 -// PUSH1 0xB -// JUMP -// JUMPDEST -// SWAP2 -// POP -// SWAP2 -// POP -// POP -// POP -// PUSH1 0x7 -// POP +// /* "":74:81 */ +// tag_3 +// /* "":79:80 */ +// 0x02 +// /* "":76:77 */ +// 0x01 +// /* "":74:81 */ +// tag_1 +// jump // in +// tag_3: +// /* "":91:98 */ +// pop +// tag_4 +// /* "":96:97 */ +// 0x04 +// /* "":93:94 */ +// 0x03 +// /* "":91:98 */ +// tag_1 +// jump // in +// tag_4: +// /* "":115:118 */ +// pop +// tag_5 +// tag_2 +// jump // in +// tag_5: +// /* "":131:134 */ +// pop +// pop +// tag_6 +// tag_2 +// jump // in +// tag_6: +// /* "":139:154 */ +// pop +// pop +// /* "":153:154 */ +// 0x07 +// /* "":0:156 */ +// stop +// /* "":6:31 */ +// tag_1: +// pop +// pop +// /* "":26:27 */ +// 0x00 +// /* "":6:31 */ +// swap1 +// jump // out +// /* "":36:60 */ +// tag_2: +// /* "":55:56 */ +// 0x00 +// /* "":52:53 */ +// 0x00 +// /* "":36:60 */ +// swap2 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/if.yul b/test/libyul/evmCodeTransform/stackReuse/if.yul index a407bb54c..cf0b2a044 100644 --- a/test/libyul/evmCodeTransform/stackReuse/if.yul +++ b/test/libyul/evmCodeTransform/stackReuse/if.yul @@ -3,15 +3,22 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// MLOAD -// DUP1 -// ISZERO -// PUSH1 0xA -// JUMPI -// DUP1 -// POP -// JUMPDEST -// POP -// PUSH1 0x3 -// POP +// /* "":72:73 */ +// 0x00 +// /* "":66:74 */ +// mload +// /* "":75:94 */ +// dup1 +// tag_1 +// jumpi +// /* "":55:107 */ +// tag_2: +// /* "":95:105 */ +// pop +// /* "":104:105 */ +// 0x03 +// /* "":55:107 */ +// stop +// /* "":80:94 */ +// tag_1: +// jump(tag_2) diff --git a/test/libyul/evmCodeTransform/stackReuse/last_use_in_nested_block.yul b/test/libyul/evmCodeTransform/stackReuse/last_use_in_nested_block.yul index 1fc780d21..49ffb3971 100644 --- a/test/libyul/evmCodeTransform/stackReuse/last_use_in_nested_block.yul +++ b/test/libyul/evmCodeTransform/stackReuse/last_use_in_nested_block.yul @@ -2,9 +2,11 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// DUP1 -// POP -// POP -// PUSH1 0x1 -// POP +// /* "":11:12 */ +// 0x00 +// /* "":15:21 */ +// pop +// /* "":33:34 */ +// 0x01 +// /* "":0:36 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/multi_reuse_same_variable_name.yul b/test/libyul/evmCodeTransform/stackReuse/multi_reuse_same_variable_name.yul index 88d42510c..3404dc536 100644 --- a/test/libyul/evmCodeTransform/stackReuse/multi_reuse_same_variable_name.yul +++ b/test/libyul/evmCodeTransform/stackReuse/multi_reuse_same_variable_name.yul @@ -2,22 +2,25 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// MLOAD -// PUSH1 0x1 -// PUSH1 0x6 -// SWAP1 -// POP -// DUP1 -// SWAP2 -// POP -// POP -// PUSH1 0x2 -// DUP1 -// SWAP2 -// POP -// PUSH1 0x4 -// SWAP1 -// POP -// POP -// POP +// /* "":17:18 */ +// 0x00 +// /* "":11:19 */ +// mload +// /* "":22:32 */ +// pop +// /* "":31:32 */ +// 0x01 +// /* "":33:39 */ +// pop +// /* "":38:39 */ +// 0x06 +// /* "":51:61 */ +// pop +// /* "":60:61 */ +// 0x02 +// /* "":69:75 */ +// pop +// /* "":74:75 */ +// 0x04 +// /* "":0:79 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot.yul b/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot.yul index ba0ad96e7..a80e66c10 100644 --- a/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot.yul +++ b/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot.yul @@ -2,13 +2,19 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x1 -// PUSH1 0x6 -// SWAP1 -// POP -// POP -// PUSH1 0x2 -// PUSH1 0x4 -// SWAP1 -// POP -// POP +// /* "":11:12 */ +// 0x01 +// /* "":13:19 */ +// pop +// /* "":18:19 */ +// 0x06 +// /* "":20:30 */ +// pop +// /* "":29:30 */ +// 0x02 +// /* "":31:37 */ +// pop +// /* "":36:37 */ +// 0x04 +// /* "":0:39 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot_nested.yul b/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot_nested.yul index b064fcc20..db8783502 100644 --- a/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot_nested.yul +++ b/test/libyul/evmCodeTransform/stackReuse/multi_reuse_single_slot_nested.yul @@ -2,13 +2,19 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x1 -// PUSH1 0x6 -// SWAP1 -// POP -// POP -// PUSH1 0x2 -// PUSH1 0x4 -// SWAP1 -// POP -// POP +// /* "":11:12 */ +// 0x01 +// /* "":13:19 */ +// pop +// /* "":18:19 */ +// 0x06 +// /* "":22:32 */ +// pop +// /* "":31:32 */ +// 0x02 +// /* "":33:39 */ +// pop +// /* "":38:39 */ +// 0x04 +// /* "":0:43 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_not_same_scope.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_not_same_scope.yul index fe50cb997..9be91989d 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_not_same_scope.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_not_same_scope.yul @@ -8,10 +8,10 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x5 -// DUP1 -// DUP1 -// DUP2 -// SSTORE -// POP -// POP +// /* "":15:16 */ +// 0x05 +// /* "":126:138 */ +// dup1 +// sstore +// /* "":0:146 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used.yul index 5e4cfd093..11e77c626 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used.yul @@ -6,11 +6,10 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x5 -// DUP1 -// SWAP1 -// POP -// DUP1 -// DUP2 -// SSTORE -// POP +// /* "":15:16 */ +// 0x05 +// /* "":74:86 */ +// dup1 +// sstore +// /* "":0:88 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used_expr.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used_expr.yul index 89a82f65c..214020ccd 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used_expr.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_last_used_expr.yul @@ -6,13 +6,14 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x5 -// PUSH1 0x2 -// DUP2 -// ADD -// SWAP1 -// POP -// DUP1 -// DUP2 -// SSTORE -// POP +// /* "":37:38 */ +// 0x02 +// /* "":15:16 */ +// 0x05 +// /* "":30:39 */ +// add +// /* "":82:94 */ +// dup1 +// sstore +// /* "":0:96 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_not_last_used.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_not_last_used.yul index 7c7cdfd55..e3002f34d 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_not_last_used.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_on_decl_assign_to_not_last_used.yul @@ -6,10 +6,11 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x5 -// DUP1 -// DUP2 -// DUP2 -// SSTORE -// POP -// POP +// /* "":15:16 */ +// 0x05 +// /* "":21:31 */ +// dup1 +// /* "":107:119 */ +// sstore +// /* "":0:121 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_slots.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_slots.yul index 44b916670..13decd323 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_slots.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_slots.yul @@ -2,22 +2,26 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// POP -// PUSH1 0x2 -// SWAP2 -// POP -// PUSH1 0x3 -// DUP4 -// DUP4 -// MSTORE -// DUP2 -// DUP2 -// MSTORE -// POP -// POP -// POP -// POP +// /* "":2:16 */ +// 0x00 +// dup1 +// dup1 +// dup1 +// /* "":17:27 */ +// pop +// swap2 +// swap1 +// pop +// /* "":26:27 */ +// 0x02 +// /* "":28:38 */ +// swap1 +// /* "":37:38 */ +// 0x03 +// /* "":39:51 */ +// swap2 +// mstore +// /* "":52:64 */ +// mstore +// /* "":0:66 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function.yul index f5e855a46..13e3065cc 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function.yul @@ -5,36 +5,39 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x12 -// JUMP -// JUMPDEST -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// SWAP2 -// SWAP3 -// SWAP4 -// JUMP -// JUMPDEST -// PUSH1 0x18 -// PUSH1 0x3 -// JUMP -// JUMPDEST -// POP -// PUSH1 0x2 -// SWAP2 -// POP -// PUSH1 0x3 -// DUP4 -// DUP4 -// MSTORE -// DUP2 -// DUP2 -// MSTORE -// POP -// POP -// POP -// POP +// /* "":58:61 */ +// tag_2 +// tag_1 +// jump // in +// tag_2: +// /* "":62:73 */ +// pop +// swap2 +// swap1 +// pop +// /* "":72:73 */ +// 0x02 +// /* "":74:85 */ +// swap1 +// /* "":84:85 */ +// 0x03 +// /* "":86:99 */ +// swap2 +// mstore +// /* "":100:113 */ +// mstore +// /* "":0:115 */ +// stop +// /* "":6:35 */ +// tag_1: +// /* "":25:26 */ +// 0x00 +// /* "":28:29 */ +// 0x00 +// /* "":31:32 */ +// 0x00 +// /* "":22:23 */ +// 0x00 +// /* "":6:35 */ +// swap4 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function_with_gaps.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function_with_gaps.yul index 36800b204..f1cde362a 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function_with_gaps.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_slots_function_with_gaps.yul @@ -9,42 +9,41 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x5 -// PUSH1 0x6 -// PUSH1 0x7 -// DUP2 -// DUP4 -// MSTORE -// PUSH1 0x1B -// JUMP -// JUMPDEST -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// PUSH1 0x0 -// JUMPDEST -// SWAP1 -// SWAP2 -// SWAP3 -// SWAP4 -// JUMP -// JUMPDEST -// PUSH1 0x21 -// PUSH1 0xC -// JUMP -// JUMPDEST -// SWAP6 -// POP -// SWAP4 -// POP -// POP -// DUP1 -// DUP3 -// MSTORE -// POP -// POP -// DUP2 -// DUP2 -// MSTORE -// POP -// POP +// /* "":106:107 */ +// 0x05 +// /* "":118:119 */ +// 0x06 +// /* "":130:131 */ +// 0x07 +// /* "":136:150 */ +// swap2 +// mstore +// /* "":207:210 */ +// tag_2 +// tag_1 +// jump // in +// tag_2: +// /* "":211:224 */ +// swap4 +// swap1 +// swap3 +// swap2 +// pop +// mstore +// /* "":225:237 */ +// mstore +// /* "":0:239 */ +// stop +// /* "":155:184 */ +// tag_1: +// /* "":174:175 */ +// 0x00 +// /* "":177:178 */ +// 0x00 +// /* "":180:181 */ +// 0x00 +// /* "":171:172 */ +// 0x00 +// /* "":155:184 */ +// swap4 +// jump // out diff --git a/test/libyul/evmCodeTransform/stackReuse/reuse_too_deep_slot.yul b/test/libyul/evmCodeTransform/stackReuse/reuse_too_deep_slot.yul index badcc0969..2adfe7892 100644 --- a/test/libyul/evmCodeTransform/stackReuse/reuse_too_deep_slot.yul +++ b/test/libyul/evmCodeTransform/stackReuse/reuse_too_deep_slot.yul @@ -33,78 +33,108 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x7 -// PUSH1 0x42 -// DUP16 -// PUSH1 0x0 -// SSTORE -// PUSH1 0x43 -// DUP2 -// PUSH1 0x1 -// MSTORE -// DUP1 -// PUSH1 0x1 -// MSTORE -// POP -// POP -// DUP15 -// PUSH1 0x1 -// SSTORE -// DUP14 -// PUSH1 0x1 -// SSTORE -// DUP13 -// PUSH1 0x1 -// SSTORE -// DUP12 -// PUSH1 0x1 -// SSTORE -// DUP11 -// PUSH1 0x1 -// SSTORE -// DUP10 -// PUSH1 0x1 -// SSTORE -// DUP9 -// PUSH1 0x1 -// SSTORE -// DUP8 -// PUSH1 0x1 -// SSTORE -// DUP7 -// PUSH1 0x1 -// SSTORE -// DUP6 -// PUSH1 0x1 -// SSTORE -// DUP5 -// PUSH1 0x1 -// SSTORE -// DUP4 -// PUSH1 0x1 -// SSTORE -// DUP3 -// PUSH1 0x1 -// SSTORE -// DUP2 -// PUSH1 0x1 -// SSTORE -// DUP1 -// PUSH1 0x1 -// SSTORE -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP -// POP +// /* "":15:16 */ +// 0x07 +// /* "":94:121 */ +// verbatimbytecode_6042 +// /* "":280:291 */ +// swap15 +// /* "":287:288 */ +// 0x00 +// /* "":280:291 */ +// swap15 +// swap2 +// swap15 +// swap14 +// swap3 +// swap14 +// swap13 +// swap4 +// swap13 +// swap12 +// swap5 +// swap12 +// swap11 +// swap6 +// swap11 +// swap10 +// swap7 +// swap10 +// swap9 +// swap8 +// swap9 +// sstore +// /* "":370:396 */ +// verbatimbytecode_6043 +// /* "":514:527 */ +// swap1 +// /* "":521:522 */ +// 0x01 +// /* "":514:527 */ +// mstore +// /* "":539:540 */ +// 0x01 +// /* "":532:545 */ +// mstore +// /* "":653:654 */ +// 0x01 +// /* "":646:659 */ +// sstore +// /* "":671:672 */ +// 0x01 +// /* "":664:677 */ +// sstore +// /* "":689:690 */ +// 0x01 +// /* "":682:695 */ +// sstore +// /* "":707:708 */ +// 0x01 +// /* "":700:713 */ +// sstore +// /* "":725:726 */ +// 0x01 +// /* "":718:731 */ +// sstore +// /* "":743:744 */ +// 0x01 +// /* "":736:749 */ +// sstore +// /* "":761:762 */ +// 0x01 +// /* "":754:767 */ +// sstore +// /* "":779:780 */ +// 0x01 +// /* "":772:785 */ +// sstore +// /* "":797:798 */ +// 0x01 +// /* "":790:803 */ +// sstore +// /* "":815:816 */ +// 0x01 +// /* "":808:822 */ +// sstore +// /* "":834:835 */ +// 0x01 +// /* "":827:841 */ +// sstore +// /* "":853:854 */ +// 0x01 +// /* "":846:860 */ +// sstore +// /* "":872:873 */ +// 0x01 +// /* "":865:879 */ +// sstore +// /* "":891:892 */ +// 0x01 +// /* "":884:898 */ +// sstore +// /* "":910:911 */ +// 0x01 +// /* "":903:917 */ +// sstore +// /* "":0:919 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/single_var.yul b/test/libyul/evmCodeTransform/stackReuse/single_var.yul index 06957305e..09a0d6fee 100644 --- a/test/libyul/evmCodeTransform/stackReuse/single_var.yul +++ b/test/libyul/evmCodeTransform/stackReuse/single_var.yul @@ -2,5 +2,7 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// POP +// /* "":2:7 */ +// 0x00 +// /* "":0:9 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/single_var_assigned.yul b/test/libyul/evmCodeTransform/stackReuse/single_var_assigned.yul index 6bc5f504f..ed497467d 100644 --- a/test/libyul/evmCodeTransform/stackReuse/single_var_assigned.yul +++ b/test/libyul/evmCodeTransform/stackReuse/single_var_assigned.yul @@ -2,5 +2,7 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x1 -// POP +// /* "":11:12 */ +// 0x01 +// /* "":0:14 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code.yul b/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code.yul index 9fdccea85..bec4c834f 100644 --- a/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code.yul +++ b/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code.yul @@ -2,8 +2,15 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x1 -// POP -// PUSH1 0x4 -// PUSH1 0x3 -// MSTORE +// /* "":11:12 */ +// 0x01 +// /* "":13:25 */ +// pop +// /* "":23:24 */ +// 0x04 +// /* "":20:21 */ +// 0x03 +// /* "":13:25 */ +// mstore +// /* "":0:27 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code_and_reused.yul b/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code_and_reused.yul index 2d66c74db..b9a814700 100644 --- a/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code_and_reused.yul +++ b/test/libyul/evmCodeTransform/stackReuse/single_var_assigned_plus_code_and_reused.yul @@ -2,11 +2,17 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x1 -// PUSH1 0x4 -// PUSH1 0x3 -// MSTORE -// DUP1 -// MLOAD -// POP -// POP +// /* "":11:12 */ +// 0x01 +// /* "":23:24 */ +// 0x04 +// /* "":20:21 */ +// 0x03 +// /* "":13:25 */ +// mstore +// /* "":30:38 */ +// mload +// /* "":26:39 */ +// pop +// /* "":0:41 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/smoke.yul b/test/libyul/evmCodeTransform/stackReuse/smoke.yul index 0a212e9ca..aa46f7a4a 100644 --- a/test/libyul/evmCodeTransform/stackReuse/smoke.yul +++ b/test/libyul/evmCodeTransform/stackReuse/smoke.yul @@ -2,3 +2,5 @@ // ==== // stackOptimization: true // ---- +// /* "":0:2 */ +// stop diff --git a/test/libyul/evmCodeTransform/stackReuse/switch.yul b/test/libyul/evmCodeTransform/stackReuse/switch.yul index 480343dcc..f72d80fad 100644 --- a/test/libyul/evmCodeTransform/stackReuse/switch.yul +++ b/test/libyul/evmCodeTransform/stackReuse/switch.yul @@ -2,25 +2,34 @@ // ==== // stackOptimization: true // ---- -// PUSH1 0x0 -// DUP1 -// PUSH1 0x0 -// DUP2 -// EQ -// PUSH1 0x11 -// JUMPI -// PUSH1 0x3 -// SWAP2 -// POP -// PUSH1 0x18 -// JUMP -// JUMPDEST -// PUSH1 0x2 -// POP -// PUSH1 0x3 -// POP -// JUMPDEST -// POP -// POP -// PUSH1 0x9 -// POP +// /* "":11:12 */ +// 0x00 +// /* "":27:28 */ +// 0x00 +// /* "":22:54 */ +// eq +// tag_1 +// jumpi +// /* "":13:73 */ +// tag_2: +// /* "":70:71 */ +// 0x03 +// /* "":63:73 */ +// pop +// /* "":13:73 */ +// tag_3: +// /* "":83:84 */ +// 0x09 +// /* "":13:73 */ +// stop +// /* "":29:54 */ +// tag_1: +// /* "":40:41 */ +// 0x02 +// /* "":42:52 */ +// pop +// /* "":51:52 */ +// 0x03 +// /* "":29:54 */ +// pop +// jump(tag_3) diff --git a/test/libyul/evmCodeTransform/stub.yul b/test/libyul/evmCodeTransform/stub.yul new file mode 100644 index 000000000..ef7cd668c --- /dev/null +++ b/test/libyul/evmCodeTransform/stub.yul @@ -0,0 +1,86 @@ +{ + fun_c() + function fun_c() + { + switch iszero(calldataload(0)) + case 0 { } + default { + if calldataload(1) + { + leave + } + if calldataload(2) + { + revert(0, 0) + } + } + revert(0, 0) + } +} +// ==== +// stackOptimization: true +// ---- +// /* "":14:21 */ +// tag_2 +// tag_1 +// jump // in +// tag_2: +// /* "":0:460 */ +// stop +// /* "":34:458 */ +// tag_1: +// /* "":108:109 */ +// 0x00 +// /* "":95:110 */ +// calldataload +// /* "":88:111 */ +// iszero +// /* "":133:134 */ +// 0x00 +// /* "":128:138 */ +// eq +// tag_3 +// jumpi +// /* "":81:415 */ +// tag_4: +// /* "":201:202 */ +// 0x01 +// /* "":188:203 */ +// calldataload +// /* "":185:277 */ +// tag_5 +// jumpi +// /* "":81:415 */ +// tag_6: +// /* "":301:316 */ +// pop +// /* "":314:315 */ +// 0x02 +// /* "":301:316 */ +// calldataload +// /* "":298:397 */ +// tag_7 +// jumpi +// /* "":81:415 */ +// tag_8: +// tag_9: +// /* "":442:443 */ +// 0x00 +// /* "":432:444 */ +// dup1 +// revert +// /* "":337:397 */ +// tag_7: +// /* "":373:374 */ +// 0x00 +// /* "":363:375 */ +// dup1 +// revert +// /* "":224:277 */ +// tag_5: +// /* "":250:255 */ +// jump // out +// /* "":135:138 */ +// tag_3: +// pop +// jump(tag_9) diff --git a/test/libyul/objectCompiler/long_object_name.yul b/test/libyul/objectCompiler/long_object_name.yul index ad8266d1e..67ef5e407 100644 --- a/test/libyul/objectCompiler/long_object_name.yul +++ b/test/libyul/objectCompiler/long_object_name.yul @@ -16,10 +16,14 @@ object "t" { // 0x00 // /* "source":23:147 */ // sstore +// /* "source":19:150 */ +// stop // stop // // sub_0: assembly { +// /* "source":272:274 */ +// stop // } -// Bytecode: 6000600055fe -// Opcodes: PUSH1 0x0 PUSH1 0x0 SSTORE INVALID -// SourceMappings: 33:113:0:-:0;30:1;23:124 +// Bytecode: 600160005500fe +// Opcodes: PUSH1 0x1 PUSH1 0x0 SSTORE STOP INVALID +// SourceMappings: 33:113:0:-:0;30:1;23:124;19:131 diff --git a/test/libyul/objectCompiler/nested_optimizer.yul b/test/libyul/objectCompiler/nested_optimizer.yul index e6f8b1f23..7b972286f 100644 --- a/test/libyul/objectCompiler/nested_optimizer.yul +++ b/test/libyul/objectCompiler/nested_optimizer.yul @@ -20,22 +20,26 @@ object "a" { // Assembly: // /* "source":48:49 */ // 0x00 -// dup1 // /* "source":35:50 */ +// dup1 // calldataload // /* "source":107:127 */ // sstore +// /* "source":20:131 */ +// stop // stop // // sub_0: assembly { // /* "source":188:189 */ // 0x00 -// dup1 // /* "source":175:190 */ +// dup1 // calldataload // /* "source":253:273 */ // sstore +// /* "source":158:279 */ +// stop // } -// Bytecode: 6000803555fe -// Opcodes: PUSH1 0x0 DUP1 CALLDATALOAD SSTORE INVALID -// SourceMappings: 48:1:0:-:0;;35:15;107:20 +// Bytecode: 600080355500fe +// Opcodes: PUSH1 0x0 DUP1 CALLDATALOAD SSTORE STOP INVALID +// SourceMappings: 48:1:0:-:0;35:15;;107:20;20:111 diff --git a/test/libyul/objectCompiler/simple_optimizer.yul b/test/libyul/objectCompiler/simple_optimizer.yul index cf7658ea0..47fa6553a 100644 --- a/test/libyul/objectCompiler/simple_optimizer.yul +++ b/test/libyul/objectCompiler/simple_optimizer.yul @@ -10,11 +10,13 @@ // Assembly: // /* "source":26:27 */ // 0x00 -// dup1 // /* "source":13:28 */ +// dup1 // calldataload // /* "source":79:99 */ // sstore -// Bytecode: 6000803555 -// Opcodes: PUSH1 0x0 DUP1 CALLDATALOAD SSTORE -// SourceMappings: 26:1:0:-:0;;13:15;79:20 +// /* "source":0:101 */ +// stop +// Bytecode: 600080355500 +// Opcodes: PUSH1 0x0 DUP1 CALLDATALOAD SSTORE STOP +// SourceMappings: 26:1:0:-:0;13:15;;79:20;0:101 diff --git a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul index ae1ca7848..2b2205579 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul @@ -237,87 +237,85 @@ // { // mstore(0x80, 7673901602397024137095011250362199966051872585513276903826533215767972925880) // mstore(0xa0, 8489654445897228341090914135473290831551238522473825886865492707826370766375) -// let _1 := calldataload(0x04) -// let notes := add(0x04, _1) -// let m := calldataload(0x24) +// let notes := add(0x04, calldataload(0x04)) // let n := calldataload(notes) -// let _2 := 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001 -// let challenge := mod(calldataload(0x44), _2) -// if gt(m, n) +// if gt(calldataload(0x24), n) // { // mstore(0x00, 404) // revert(0x00, 0x20) // } // let kn := calldataload(add(calldatasize(), not(191))) -// mstore(0x2a0, caller()) +// let _1 := 0x2a0 +// mstore(_1, caller()) // mstore(0x2c0, kn) -// mstore(0x2e0, m) -// kn := mulmod(sub(_2, kn), challenge, _2) +// mstore(0x2e0, calldataload(0x24)) +// kn := mulmod(sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, kn), mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // hashCommitments(notes, n) // let b := add(0x300, shl(7, n)) // let i := 0 // for { } lt(i, n) { i := add(i, 0x01) } // { -// let _3 := add(_1, mul(i, 0xc0)) -// let noteIndex := add(_3, 0x24) +// let noteIndex := add(add(calldataload(0x04), mul(i, 0xc0)), 0x24) // let k := 0 -// let a := calldataload(add(_3, 0x44)) -// let c := challenge -// let _4 := add(i, 0x01) -// switch eq(_4, n) +// let a := calldataload(add(add(calldataload(0x04), mul(i, 0xc0)), 0x44)) +// let c := mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// let _2 := add(i, 0x01) +// switch eq(_2, n) // case 1 { // k := kn -// if eq(m, n) { k := sub(_2, kn) } +// if eq(calldataload(0x24), n) +// { +// k := sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, kn) +// } // } // case 0 { k := calldataload(noteIndex) } // validateCommitment(noteIndex, k, a) -// switch gt(_4, m) +// switch gt(_2, calldataload(0x24)) // case 1 { -// kn := addmod(kn, sub(_2, k), _2) -// let x := mod(mload(0), _2) -// k := mulmod(k, x, _2) -// a := mulmod(a, x, _2) -// c := mulmod(challenge, x, _2) +// kn := addmod(kn, sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, k), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// let x := mod(mload(0), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// k := mulmod(k, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// a := mulmod(a, x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// c := mulmod(mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), x, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) // mstore(0, keccak256(0, 0x20)) // } -// case 0 { kn := addmod(kn, k, _2) } -// let _5 := 0x40 -// calldatacopy(0xe0, add(_3, 164), _5) -// calldatacopy(0x20, add(_3, 100), _5) -// let _6 := 0x120 -// mstore(_6, sub(_2, c)) -// let _7 := 0x60 -// mstore(_7, k) +// case 0 { +// kn := addmod(kn, k, 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001) +// } +// calldatacopy(0xe0, add(add(calldataload(0x04), mul(i, 0xc0)), 164), 0x40) +// calldatacopy(0x20, add(add(calldataload(0x04), mul(i, 0xc0)), 100), 0x40) +// mstore(0x120, sub(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001, c)) +// mstore(0x60, k) // mstore(0xc0, a) -// let result := call(gas(), 7, 0, 0xe0, _7, 0x1a0, _5) -// let result_1 := and(result, call(gas(), 7, 0, 0x20, _7, _6, _5)) -// let _8 := 0x160 -// let result_2 := and(result_1, call(gas(), 7, 0, 0x80, _7, _8, _5)) -// let result_3 := and(result_2, call(gas(), 6, 0, _6, 0x80, _8, _5)) -// result := and(result_3, call(gas(), 6, 0, _8, 0x80, b, _5)) -// if eq(i, m) +// let result := call(gas(), 7, 0, 0xe0, 0x60, 0x1a0, 0x40) +// let result_1 := and(result, call(gas(), 7, 0, 0x20, 0x60, 0x120, 0x40)) +// let result_2 := and(result_1, call(gas(), 7, 0, 0x80, 0x60, 0x160, 0x40)) +// let result_3 := and(result_2, call(gas(), 6, 0, 0x120, 0x80, 0x160, 0x40)) +// result := and(result_3, call(gas(), 6, 0, 0x160, 0x80, b, 0x40)) +// if eq(i, calldataload(0x24)) // { // mstore(0x260, mload(0x20)) -// mstore(0x280, mload(_5)) +// mstore(0x280, mload(0x40)) // mstore(0x1e0, mload(0xe0)) // mstore(0x200, sub(0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47, mload(0x100))) // } -// if gt(i, m) +// if gt(i, calldataload(0x24)) // { -// mstore(_7, c) -// let result_4 := and(result, call(gas(), 7, 0, 0x20, _7, 0x220, _5)) -// let result_5 := and(result_4, call(gas(), 6, 0, 0x220, 0x80, 0x260, _5)) -// result := and(result_5, call(gas(), 6, 0, 0x1a0, 0x80, 0x1e0, _5)) +// mstore(0x60, c) +// let _3 := 0x220 +// let result_4 := and(result, call(gas(), 7, 0, 0x20, 0x60, _3, 0x40)) +// let result_5 := and(result_4, call(gas(), 6, 0, _3, 0x80, 0x260, 0x40)) +// result := and(result_5, call(gas(), 6, 0, 0x1a0, 0x80, 0x1e0, 0x40)) // } // if iszero(result) // { // mstore(0, 400) // revert(0, 0x20) // } -// b := add(b, _5) +// b := add(b, 0x40) // } -// if lt(m, n) { validatePairing() } -// if iszero(eq(mod(keccak256(0x2a0, add(b, not(671))), _2), challenge)) +// if lt(calldataload(0x24), n) { validatePairing() } +// if iszero(eq(mod(keccak256(_1, add(b, not(671))), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001), mod(calldataload(0x44), 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001))) // { // mstore(0, 404) // revert(0, 0x20) diff --git a/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul b/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul index b417991c2..d670f002f 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/stack_compressor_msize.yul @@ -33,25 +33,30 @@ sstore(0,0) sstore(3,1) } +// ==== +// EVMVersion: >homestead // ---- // step: fullSuite // // { // { -// let _1 := gt(not(gcd(10, 15)), 1) -// let _2 := gcd(10, 15) -// let _3 := not(0) -// let _4 := lt(or(1, add(gcd(10, 15), _3)), 1) -// let _5 := gcd(10, 15) -// let _6 := gcd(10, 15) -// pop(keccak256(gcd(10, 15), or(gt(not(gcd(10, 15)), 1), 1))) -// mstore(lt(or(gt(1, or(or(gt(or(or(or(gt(or(gt(_3, _6), 1), _5), _4), _2), 1), 1), _1), 1)), 1), 1), 1) -// sstore(not(gcd(10, 15)), 1) +// let _1 := 1 +// let _2 := 15 +// let _3 := 10 +// let _4 := gt(not(gcd(_3, _2)), _1) +// let _5 := gcd(_3, _2) +// let _6 := not(0) +// let _7 := lt(or(_1, add(gcd(_3, _2), _6)), _1) +// let _8 := gcd(_3, _2) +// let _9 := gcd(_3, _2) +// pop(keccak256(gcd(_3, _2), or(gt(not(gcd(_3, _2)), _1), _1))) +// mstore(lt(or(gt(_1, or(or(gt(or(or(or(gt(or(gt(_6, _9), _1), _8), _7), _5), _1), _1), _4), _1)), _1), _1), _1) +// sstore(not(gcd(_3, _2)), _1) // sstore(0, 0) -// sstore(2, 1) -// extcodecopy(1, msize(), 1, 1) +// sstore(2, _1) +// extcodecopy(_1, msize(), _1, _1) // sstore(0, 0) -// sstore(3, 1) +// sstore(3, _1) // } // function gcd(_a, _b) -> out // { diff --git a/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul b/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul index 4ff056157..382bd201d 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul @@ -3,6 +3,8 @@ let y := calldataload(calldataload(9)) mstore(y, add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(y, 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1)) } +// ==== +// EVMVersion: =homestead // ---- // step: stackCompressor // diff --git a/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul b/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul index f237ea8bb..ed85fe7b8 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul @@ -5,6 +5,8 @@ mstore(y, add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(y, 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1)) } } +// ==== +// EVMVersion: =homestead // ---- // step: stackCompressor // diff --git a/test/libyul/yulOptimizerTests/stackCompressor/unusedPrunerWithMSize.yul b/test/libyul/yulOptimizerTests/stackCompressor/unusedPrunerWithMSize.yul index 7e3acd9b6..dc10737ad 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/unusedPrunerWithMSize.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/unusedPrunerWithMSize.yul @@ -18,6 +18,8 @@ extcodecopy(1, msize(), 1, 1) } } +// ==== +// EVMVersion: =homestead // ---- // step: stackCompressor // diff --git a/test/libyul/yulStackLayout/literal_loop.yul b/test/libyul/yulStackLayout/literal_loop.yul new file mode 100644 index 000000000..841c41062 --- /dev/null +++ b/test/libyul/yulStackLayout/literal_loop.yul @@ -0,0 +1,69 @@ +{ + for {} + add(delegatecall(delegatecall(call(gas(), 0x0, 0x0, 0x0, 0x0, 0x0, 0x0), 0x0, 0x0, 0x0, 0x0, 0x0), 0x0, 0x0, 0x0, 0x0, 0x0),0x0) + {} + {} +} +// ---- +// digraph CFG { +// nodesep=0.7; +// node[shape=box]; +// +// Entry [label="Entry"]; +// Entry -> Block0; +// Block0 [label="\ +// [ ]\l\ +// [ ]\l\ +// "]; +// Block0 -> Block0Exit [arrowhead=none]; +// Block0Exit [label="Jump" shape=oval]; +// Block0Exit -> Block1; +// +// Block1 [label="\ +// [ ]\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ]\l\ +// gas\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 TMP[gas, 0] ]\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 TMP[gas, 0] ]\l\ +// call\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 TMP[call, 0] ]\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 TMP[call, 0] ]\l\ +// delegatecall\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 TMP[delegatecall, 0] ]\l\ +// [ 0x00 0x00 0x00 0x00 0x00 0x00 TMP[delegatecall, 0] ]\l\ +// delegatecall\l\ +// [ 0x00 TMP[delegatecall, 0] ]\l\ +// [ 0x00 TMP[delegatecall, 0] ]\l\ +// add\l\ +// [ TMP[add, 0] ]\l\ +// [ TMP[add, 0] ]\l\ +// "]; +// Block1 -> Block1Exit; +// Block1Exit [label="{ TMP[add, 0]| { <0> Zero | <1> NonZero }}" shape=Mrecord]; +// Block1Exit:0 -> Block2; +// Block1Exit:1 -> Block3; +// +// Block2 [label="\ +// [ ]\l\ +// [ ]\l\ +// "]; +// Block2Exit [label="MainExit"]; +// Block2 -> Block2Exit; +// +// Block3 [label="\ +// [ ]\l\ +// [ ]\l\ +// "]; +// Block3 -> Block3Exit [arrowhead=none]; +// Block3Exit [label="Jump" shape=oval]; +// Block3Exit -> Block4; +// +// Block4 [label="\ +// [ ]\l\ +// [ ]\l\ +// "]; +// Block4 -> Block4Exit [arrowhead=none]; +// Block4Exit [label="BackwardsJump" shape=oval]; +// Block4Exit -> Block1; +// +// }