diff options
author | chriseth <chris@ethereum.org> | 2018-03-09 02:41:29 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-04-03 20:34:32 +0800 |
commit | 6777f7a57fed6b39128773f13084da729dd64588 (patch) | |
tree | 87b74e6f8e3f12eec98ca6b2265b23cf1e9f3a71 /libevmasm/Assembly.cpp | |
parent | d21382157cbda53d98f3a4e0d7c0d0a7d213aebf (diff) | |
download | dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.tar dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.tar.gz dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.tar.bz2 dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.tar.lz dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.tar.xz dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.tar.zst dexon-solidity-6777f7a57fed6b39128773f13084da729dd64588.zip |
Optimize across MLOAD if MSIZE is not used.
Diffstat (limited to 'libevmasm/Assembly.cpp')
-rw-r--r-- | libevmasm/Assembly.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index bd4ebf59..b71bc80c 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -438,13 +438,15 @@ map<u256, u256> Assembly::optimiseInternal( // function types that can be stored in storage. AssemblyItems optimisedItems; + bool usesMSize = (find(m_items.begin(), m_items.end(), AssemblyItem(Instruction::MSIZE)) != m_items.end()); + auto iter = m_items.begin(); while (iter != m_items.end()) { KnownState emptyState; CommonSubexpressionEliminator eliminator(emptyState); auto orig = iter; - iter = eliminator.feedItems(iter, m_items.end()); + iter = eliminator.feedItems(iter, m_items.end(), usesMSize); bool shouldReplace = false; AssemblyItems optimisedChunk; try |