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 /libevmasm/CommonSubexpressionEliminator.h | |
parent | 7753249f646f239819c62ab6847438dc84b6e04b (diff) | |
parent | deadff263fbf4d5da911d7c544821cc77081a6d3 (diff) | |
download | dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar.gz dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar.bz2 dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar.lz dexon-solidity-0edce4b570c157927933697b30f0f94cbdf173b2.tar.xz 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 'libevmasm/CommonSubexpressionEliminator.h')
-rw-r--r-- | libevmasm/CommonSubexpressionEliminator.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libevmasm/CommonSubexpressionEliminator.h b/libevmasm/CommonSubexpressionEliminator.h index 0b957a0e..b20de246 100644 --- a/libevmasm/CommonSubexpressionEliminator.h +++ b/libevmasm/CommonSubexpressionEliminator.h @@ -65,8 +65,9 @@ public: /// Feeds AssemblyItems into the eliminator and @returns the iterator pointing at the first /// item that must be fed into a new instance of the eliminator. + /// @param _msizeImportant if false, do not consider modification of MSIZE a side-effect template <class _AssemblyItemIterator> - _AssemblyItemIterator feedItems(_AssemblyItemIterator _iterator, _AssemblyItemIterator _end); + _AssemblyItemIterator feedItems(_AssemblyItemIterator _iterator, _AssemblyItemIterator _end, bool _msizeImportant); /// @returns the resulting items after optimization. AssemblyItems getOptimizedItems(); @@ -168,11 +169,12 @@ private: template <class _AssemblyItemIterator> _AssemblyItemIterator CommonSubexpressionEliminator::feedItems( _AssemblyItemIterator _iterator, - _AssemblyItemIterator _end + _AssemblyItemIterator _end, + bool _msizeImportant ) { assertThrow(!m_breakingItem, OptimizerException, "Invalid use of CommonSubexpressionEliminator."); - for (; _iterator != _end && !SemanticInformation::breaksCSEAnalysisBlock(*_iterator); ++_iterator) + for (; _iterator != _end && !SemanticInformation::breaksCSEAnalysisBlock(*_iterator, _msizeImportant); ++_iterator) feedItem(*_iterator); if (_iterator != _end) m_breakingItem = &(*_iterator++); |