diff options
author | Aart Bik <ajcbik@google.com> | 2017-01-11 10:20:43 -0800 |
---|---|---|
committer | Aart Bik <ajcbik@google.com> | 2017-01-13 10:04:42 -0800 |
commit | 6b69e0acb0e4c506ce2587e362c38e36e41e34ab (patch) | |
tree | 976f08c78d3c5efa2dac8ec0409f36fae51456cb /compiler/optimizing/loop_optimization.h | |
parent | 93939824c7e6e16cf98941cd4724278e87d6259d (diff) |
Complete unrolling of loops with small body and trip count one.
Rationale:
Avoids the unnecessary loop control overhead, suspend check,
and exposes more opportunities for constant folding in the
resulting loop body. Fully unrolls loop in execute() of
the Dhrystone benchmark (3% to 8% improvements).
Test: test-art-host
Change-Id: If30f38caea9e9f87a929df041dfb7ed1c227aba3
Diffstat (limited to 'compiler/optimizing/loop_optimization.h')
-rw-r--r-- | compiler/optimizing/loop_optimization.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index 0f05b24c37..9ddab4150c 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -60,19 +60,21 @@ class HLoopOptimization : public HOptimization { void TraverseLoopsInnerToOuter(LoopNode* node); + // Simplification. void SimplifyInduction(LoopNode* node); void SimplifyBlocks(LoopNode* node); - void RemoveIfEmptyInnerLoop(LoopNode* node); + bool SimplifyInnerLoop(LoopNode* node); + // Helpers. bool IsPhiInduction(HPhi* phi); bool IsEmptyHeader(HBasicBlock* block); bool IsEmptyBody(HBasicBlock* block); - bool IsOnlyUsedAfterLoop(HLoopInformation* loop_info, HInstruction* instruction, + bool collect_loop_uses, /*out*/ int32_t* use_count); - void ReplaceAllUses(HInstruction* instruction, HInstruction* replacement); bool TryReplaceWithLastValue(HInstruction* instruction, HBasicBlock* block); + void RemoveDeadInstructions(const HInstructionList& list); // Range information based on prior induction variable analysis. InductionVarRange induction_range_; |