diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2016-10-07 16:51:06 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-10-07 16:51:07 +0000 |
commit | 6ed8fc7a68910ebfe9df7cc080c9a9fc835c658a (patch) | |
tree | c45da31d70ab476836ad97b27f5b57812807c842 /compiler/optimizing/loop_optimization.h | |
parent | f13f84fd9fb6151c382b1f14062d6ff8c9c3b51e (diff) | |
parent | 8c4a8542ff5f899f430a65feaa114d6288077224 (diff) |
Merge "Improved and simplified loop optimizations."
Diffstat (limited to 'compiler/optimizing/loop_optimization.h')
-rw-r--r-- | compiler/optimizing/loop_optimization.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index 6092955221..b2bf1c8507 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -63,9 +63,13 @@ class HLoopOptimization : public HOptimization { void SimplifyInduction(LoopNode* node); void RemoveIfEmptyLoop(LoopNode* node); - void ReplaceAllUses(HInstruction* instruction, - HInstruction* replacement, - HInstruction* exclusion); + bool IsOnlyUsedAfterLoop(const HLoopInformation& loop_info, + HInstruction* instruction, + /*out*/ int32_t* use_count); + void ReplaceAllUses(HInstruction* instruction, HInstruction* replacement); + bool TryReplaceWithLastValue(HInstruction* instruction, + int32_t use_count, + HBasicBlock* block); // Range information based on prior induction variable analysis. InductionVarRange induction_range_; @@ -79,6 +83,10 @@ class HLoopOptimization : public HOptimization { LoopNode* top_loop_; LoopNode* last_loop_; + // Temporary bookkeeping of a set of instructions. + // Contents reside in phase-local heap memory. + ArenaSet<HInstruction*>* iset_; + friend class LoopOptimizationTest; DISALLOW_COPY_AND_ASSIGN(HLoopOptimization); |