From 281c681a0852c10f5ca99b351650b244e878aea3 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Fri, 26 Aug 2016 11:31:48 -0700 Subject: A first implementation of a loop optimization framework. Rationale: We are planning to add more and more loop related optimizations and this framework provides the basis to do so. For starters, the framework optimizes dead induction, induction that can be replaced with a simpler closed-form, and eliminates dead loops completely (either pre-existing or as a result of induction removal). Speedup on e.g. Benchpress Loop is 73x (17.5us. -> 0.24us.) [with the potential for more exploiting outer loop too] Test: 618-checker-induction et al. Change-Id: If80a809acf943539bf6726b0030dcabd50c9babc --- compiler/optimizing/nodes.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index ef9bf23a17..f1ca928851 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -522,7 +522,10 @@ static bool IsLinearOrderWellFormed(const HGraph& graph) { return true; } +// TODO: return order, and give only liveness analysis ownership of graph's linear_order_? void HGraph::Linearize() { + linear_order_.clear(); + // Create a reverse post ordering with the following properties: // - Blocks in a loop are consecutive, // - Back-edge is the last block before loop exits. -- cgit v1.2.3-59-g8ed1b