From 55fff044d3a4f7196098e25bab1dad106d9b54a2 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 10 Jul 2014 12:42:52 +0100 Subject: Rewrite topological sort order and improve GVN. Rewrite the topological sort order to include a full loop before the blocks that go after the loop. Add a new iterator class LoopRepeatingTopologicalSortIterator that differs from the RepeatingTopologicalSortIterator by repeating only loops and repeating them early. It returns to the loop head if the head needs recalculation when we reach the end of the loop. In GVN, use the new loop-repeating topological sort iterator and for a loop head merge only the preceding blocks' LVNs if we're not currently recalculating this loop. Also fix LocalValueNumbering::InPlaceIntersectMaps() which was keeping only the last element of the intersection, avoid some unnecessary processing during LVN merge and add some missing braces to MIRGraph::InferTypeAndSize(). Bug: 16398693 Change-Id: I4e10d4acb626a5b8a28ec0de106a7b37f9cbca32 --- compiler/dex/mir_optimization_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/dex/mir_optimization_test.cc') diff --git a/compiler/dex/mir_optimization_test.cc b/compiler/dex/mir_optimization_test.cc index 4a0cf5c78e..c510b528ff 100644 --- a/compiler/dex/mir_optimization_test.cc +++ b/compiler/dex/mir_optimization_test.cc @@ -195,7 +195,7 @@ class ClassInitCheckEliminationTest : public testing::Test { cu_.mir_graph->SSATransformationEnd(); bool gate_result = cu_.mir_graph->EliminateClassInitChecksGate(); ASSERT_TRUE(gate_result); - RepeatingTopologicalSortIterator iterator(cu_.mir_graph.get()); + LoopRepeatingTopologicalSortIterator iterator(cu_.mir_graph.get()); bool change = false; for (BasicBlock* bb = iterator.Next(change); bb != nullptr; bb = iterator.Next(change)) { change = cu_.mir_graph->EliminateClassInitChecks(bb); -- cgit v1.2.3