From 9620230700d4b451097c2163faa70627c9d8088a Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Tue, 4 Oct 2016 17:33:56 -0700 Subject: Refactoring of graph linearization and linear order. Rationale: Ownership of graph's linear order and iterators was a bit unclear now that other phases are using it. New approach allows phases to compute their own order, while ssa_liveness is sole owner for graph (since it is not mutated afterwards). Also shortens lifetime of loop's arena. Test: test-art-host Change-Id: Ib7137d1203a1e0a12db49868f4117d48a4277f30 --- compiler/optimizing/loop_optimization.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'compiler/optimizing/loop_optimization.h') diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index 591e45a7fb..6092955221 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -17,8 +17,6 @@ #ifndef ART_COMPILER_OPTIMIZING_LOOP_OPTIMIZATION_H_ #define ART_COMPILER_OPTIMIZING_LOOP_OPTIMIZATION_H_ -#include - #include "induction_var_range.h" #include "nodes.h" #include "optimization.h" @@ -32,9 +30,6 @@ namespace art { class HLoopOptimization : public HOptimization { public: HLoopOptimization(HGraph* graph, HInductionVarAnalysis* induction_analysis); - HLoopOptimization(HGraph* graph, - HInductionVarAnalysis* induction_analysis, - ArenaAllocator* allocator); void Run() OVERRIDE; @@ -44,7 +39,7 @@ class HLoopOptimization : public HOptimization { /** * A single loop inside the loop hierarchy representation. */ - struct LoopNode : public ArenaObject { + struct LoopNode : public ArenaObject { explicit LoopNode(HLoopInformation* lp_info) : loop_info(lp_info), outer(nullptr), @@ -58,6 +53,8 @@ class HLoopOptimization : public HOptimization { LoopNode* next; }; + void LocalRun(); + void AddLoop(HLoopInformation* loop_info); void RemoveLoop(LoopNode* node); @@ -70,14 +67,15 @@ class HLoopOptimization : public HOptimization { HInstruction* replacement, HInstruction* exclusion); - // Range analysis based on induction variables. + // Range information based on prior induction variable analysis. InductionVarRange induction_range_; // Phase-local heap memory allocator for the loop optimizer. Storage obtained - // through this allocator is released when the loop optimizer is done. + // through this allocator is immediately released when the loop optimizer is done. ArenaAllocator* loop_allocator_; - // Entries into the loop hierarchy representation. + // Entries into the loop hierarchy representation. The hierarchy resides + // in phase-local heap memory. LoopNode* top_loop_; LoopNode* last_loop_; -- cgit v1.2.3-59-g8ed1b