From beab869e1443a9ef8c4bbf27affda0265e8d1947 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 28 May 2015 14:43:46 +0200 Subject: Allow duplicate code removal for loops. --- Assembly.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Assembly.cpp') 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++; } } -- cgit