diff options
author | chriseth <c@ethdev.com> | 2016-08-02 05:13:56 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-08-02 05:41:11 +0800 |
commit | c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d (patch) | |
tree | b3a7ac61c925ad445489507d3086d982aed29c79 /libevmasm | |
parent | fb90e8876f6d1172405890bee694ccc6000b9387 (diff) | |
download | dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.tar dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.tar.gz dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.tar.bz2 dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.tar.lz dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.tar.xz dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.tar.zst dexon-solidity-c0afb4549ebecfc5e4ad05e8e24d26d92f4ec64d.zip |
Further fixes to the optimizer.
Diffstat (limited to 'libevmasm')
-rw-r--r-- | libevmasm/ControlFlowGraph.cpp | 7 | ||||
-rw-r--r-- | libevmasm/ControlFlowGraph.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index 61b24e4b..d4801562 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -250,10 +250,11 @@ void ControlFlowGraph::gatherKnowledge() KnownStatePointer state = item.state; if (block.startState) { - if (m_joinKnowledge) - state->reduceToCommonKnowledge(*block.startState, !item.blocksSeen.count(item.blockId)); - else + // We call reduceToCommonKnowledge even in the non-join setting to get the correct + // sequence number + if (!m_joinKnowledge) state->reset(); + state->reduceToCommonKnowledge(*block.startState, !item.blocksSeen.count(item.blockId)); if (*state == *block.startState) continue; } diff --git a/libevmasm/ControlFlowGraph.h b/libevmasm/ControlFlowGraph.h index a6a9df8e..03a1f717 100644 --- a/libevmasm/ControlFlowGraph.h +++ b/libevmasm/ControlFlowGraph.h @@ -116,7 +116,7 @@ private: unsigned m_lastUsedId = 0; AssemblyItems const& m_items; - bool m_joinKnowledge; + bool m_joinKnowledge = true; std::map<BlockId, BasicBlock> m_blocks; }; |