mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6448 from ethereum/forceYulOptimization
Run tests with both ABIV2 and Yul optimizer.
This commit is contained in:
commit
3795569da6
@ -203,7 +203,7 @@ do
|
|||||||
force_abiv2_flag=""
|
force_abiv2_flag=""
|
||||||
if [[ "$abiv2" == "yes" ]]
|
if [[ "$abiv2" == "yes" ]]
|
||||||
then
|
then
|
||||||
force_abiv2_flag="--abiencoderv2"
|
force_abiv2_flag="--abiencoderv2 --optimize-yul"
|
||||||
fi
|
fi
|
||||||
printTask "--> Running tests using "$optimize" --evm-version "$vm" $force_abiv2_flag..."
|
printTask "--> Running tests using "$optimize" --evm-version "$vm" $force_abiv2_flag..."
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ struct CommonOptions: boost::noncopyable
|
|||||||
boost::filesystem::path ipcPath;
|
boost::filesystem::path ipcPath;
|
||||||
boost::filesystem::path testPath;
|
boost::filesystem::path testPath;
|
||||||
bool optimize = false;
|
bool optimize = false;
|
||||||
|
bool optimizeYul = false;
|
||||||
bool disableIPC = false;
|
bool disableIPC = false;
|
||||||
bool disableSMT = false;
|
bool disableSMT = false;
|
||||||
|
|
||||||
|
@ -57,10 +57,14 @@ ExecutionFramework::ExecutionFramework():
|
|||||||
ExecutionFramework::ExecutionFramework(string const& _ipcPath, langutil::EVMVersion _evmVersion):
|
ExecutionFramework::ExecutionFramework(string const& _ipcPath, langutil::EVMVersion _evmVersion):
|
||||||
m_rpc(RPCSession::instance(_ipcPath)),
|
m_rpc(RPCSession::instance(_ipcPath)),
|
||||||
m_evmVersion(_evmVersion),
|
m_evmVersion(_evmVersion),
|
||||||
m_optimiserSettings(dev::test::Options::get().optimize ? solidity::OptimiserSettings::standard() : solidity::OptimiserSettings::minimal()),
|
m_optimiserSettings(solidity::OptimiserSettings::minimal()),
|
||||||
m_showMessages(dev::test::Options::get().showMessages),
|
m_showMessages(dev::test::Options::get().showMessages),
|
||||||
m_sender(m_rpc.account(0))
|
m_sender(m_rpc.account(0))
|
||||||
{
|
{
|
||||||
|
if (dev::test::Options::get().optimizeYul)
|
||||||
|
m_optimiserSettings = solidity::OptimiserSettings::full();
|
||||||
|
else if (dev::test::Options::get().optimize)
|
||||||
|
m_optimiserSettings = solidity::OptimiserSettings::standard();
|
||||||
m_rpc.test_rewindToBlock(0);
|
m_rpc.test_rewindToBlock(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ Options::Options()
|
|||||||
|
|
||||||
options.add_options()
|
options.add_options()
|
||||||
("optimize", po::bool_switch(&optimize), "enables optimization")
|
("optimize", po::bool_switch(&optimize), "enables optimization")
|
||||||
|
("optimize-yul", po::bool_switch(&optimizeYul), "enables Yul optimization")
|
||||||
("abiencoderv2", po::bool_switch(&useABIEncoderV2), "enables abi encoder v2")
|
("abiencoderv2", po::bool_switch(&useABIEncoderV2), "enables abi encoder v2")
|
||||||
("show-messages", po::bool_switch(&showMessages), "enables message output");
|
("show-messages", po::bool_switch(&showMessages), "enables message output");
|
||||||
|
|
||||||
|
@ -72,7 +72,12 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
|||||||
CHECK_GAS(133899, 130591, 100);
|
CHECK_GAS(133899, 130591, 100);
|
||||||
// This is only correct on >=Constantinople.
|
// This is only correct on >=Constantinople.
|
||||||
else if (Options::get().useABIEncoderV2)
|
else if (Options::get().useABIEncoderV2)
|
||||||
|
{
|
||||||
|
if (Options::get().optimizeYul)
|
||||||
|
CHECK_GAS(151283, 128285, 100);
|
||||||
|
else
|
||||||
CHECK_GAS(151283, 136003, 100);
|
CHECK_GAS(151283, 136003, 100);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
CHECK_GAS(126689, 120159, 100);
|
CHECK_GAS(126689, 120159, 100);
|
||||||
if (Options::get().evmVersion() >= EVMVersion::byzantium())
|
if (Options::get().evmVersion() >= EVMVersion::byzantium())
|
||||||
@ -82,7 +87,12 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
|||||||
CHECK_GAS(21551, 21526, 20);
|
CHECK_GAS(21551, 21526, 20);
|
||||||
// This is only correct on >=Constantinople.
|
// This is only correct on >=Constantinople.
|
||||||
else if (Options::get().useABIEncoderV2)
|
else if (Options::get().useABIEncoderV2)
|
||||||
|
{
|
||||||
|
if (Options::get().optimizeYul)
|
||||||
|
CHECK_GAS(21713, 21567, 20);
|
||||||
|
else
|
||||||
CHECK_GAS(21713, 21635, 20);
|
CHECK_GAS(21713, 21635, 20);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
CHECK_GAS(21546, 21526, 20);
|
CHECK_GAS(21546, 21526, 20);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user