diff options
author | Aart Bik <ajcbik@google.com> | 2016-10-04 17:33:56 -0700 |
---|---|---|
committer | Aart Bik <ajcbik@google.com> | 2016-10-05 11:50:42 -0700 |
commit | 9620230700d4b451097c2163faa70627c9d8088a (patch) | |
tree | 695b96b9efeaa4c2cb3816e51904e19540fe3883 /compiler/optimizing/loop_optimization.h | |
parent | 4aa6a93c46a959df1ab71ee7a68ad345338046ef (diff) |
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
Diffstat (limited to 'compiler/optimizing/loop_optimization.h')
-rw-r--r-- | compiler/optimizing/loop_optimization.h | 16 |
1 files changed, 7 insertions, 9 deletions
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 <string> - #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<kArenaAllocInductionVarAnalysis> { + struct LoopNode : public ArenaObject<kArenaAllocLoopOptimization> { 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_; |