diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-03 22:58:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 22:58:11 +0800 |
commit | 0edce4b570c157927933697b30f0f94cbdf173b2 (patch) | |
tree | a7ec50f920090e529b435e878e4df8cedd1f0eb4 /test/libevmasm | |
parent | 7753249f646f239819c62ab6847438dc84b6e04b (diff) | |
parent | deadff263fbf4d5da911d7c544821cc77081a6d3 (diff) | |
download | dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar.gz dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar.zst dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.zip |
Merge pull request #3693 from ethereum/optimizeMLOAD
Optimize across MLOAD if MSIZE is not used.
Diffstat (limited to 'test/libevmasm')
-rw-r--r-- | test/libevmasm/Optimiser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp index f630b304..28f6b8c0 100644 --- a/test/libevmasm/Optimiser.cpp +++ b/test/libevmasm/Optimiser.cpp @@ -69,8 +69,9 @@ namespace { AssemblyItems input = addDummyLocations(_input); + bool usesMsize = (find(_input.begin(), _input.end(), AssemblyItem{Instruction::MSIZE}) != _input.end()); eth::CommonSubexpressionEliminator cse(_state); - BOOST_REQUIRE(cse.feedItems(input.begin(), input.end()) == input.end()); + BOOST_REQUIRE(cse.feedItems(input.begin(), input.end(), usesMsize) == input.end()); AssemblyItems output = cse.getOptimizedItems(); for (AssemblyItem const& item: output) @@ -124,7 +125,7 @@ BOOST_AUTO_TEST_CASE(cse_intermediate_swap) Instruction::SLOAD, Instruction::SWAP1, u256(100), Instruction::EXP, Instruction::SWAP1, Instruction::DIV, u256(0xff), Instruction::AND }; - BOOST_REQUIRE(cse.feedItems(input.begin(), input.end()) == input.end()); + BOOST_REQUIRE(cse.feedItems(input.begin(), input.end(), false) == input.end()); AssemblyItems output = cse.getOptimizedItems(); BOOST_CHECK(!output.empty()); } |