diff options
author | chriseth <c@ethdev.com> | 2015-05-28 20:43:46 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-28 20:48:07 +0800 |
commit | beab869e1443a9ef8c4bbf27affda0265e8d1947 (patch) | |
tree | 78bc79f7d9d0f39e130f57dc4f04ba35fd6f441e /Assembly.cpp | |
parent | 7f55e26eb8fd9c321c679f7e4c758070b8d670c1 (diff) | |
download | dexon-solidity-beab869e1443a9ef8c4bbf27affda0265e8d1947.tar.gz dexon-solidity-beab869e1443a9ef8c4bbf27affda0265e8d1947.tar.zst dexon-solidity-beab869e1443a9ef8c4bbf27affda0265e8d1947.zip |
Allow duplicate code removal for loops.
Diffstat (limited to 'Assembly.cpp')
-rw-r--r-- | Assembly.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Assembly.cpp b/Assembly.cpp index 5cf3b787..8c659188 100644 --- a/Assembly.cpp +++ b/Assembly.cpp @@ -307,6 +307,11 @@ Assembly& Assembly::optimise(bool _enable) count = 0; copt << "Performing optimisation..."; + // This only modifies PushTags, we have to run again to actually remove code. + BlockDeduplicator dedup(m_items); + if (dedup.deduplicate()) + count++; + { ControlFlowGraph cfg(m_items); AssemblyItems optimisedItems; @@ -349,11 +354,6 @@ Assembly& Assembly::optimise(bool _enable) m_items = move(optimisedItems); count++; } - - // This only modifies PushTags, we have to run again to actually remove code. - BlockDeduplicator dedup(m_items); - if (dedup.deduplicate()) - count++; } } |