From 72411e6b3b286d91e4da894cd5b12e7a3dc88f40 Mon Sep 17 00:00:00 2001 From: Artem Serov Date: Thu, 19 Oct 2017 16:18:07 +0100 Subject: ART: Implement scalar loop peeling. Implement scalar loop peeling for invariant exits elimination (on arm64). If the loop exit condition is loop invariant then loop peeling + GVN + DCE can eliminate this exit in the loop body. Note: GVN and DCE aren't applied during loop optimizations. Note: this functionality is turned off by default now. Test: test-art-host, test-art-target, boot-to-gui. Change-Id: I98d20054a431838b452dc06bd25c075eb445960c --- compiler/optimizing/loop_optimization.h | 13 ++++--------- 1 file changed, 4 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 0120cffa56..f9a31a34d4 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -145,19 +145,14 @@ class HLoopOptimization : public HOptimization { // Performs optimizations specific to inner loop. Returns true if anything changed. bool OptimizeInnerLoop(LoopNode* node); - // Performs loop peeling/unrolling once (depends on the 'do_unrolling'); the transformation - // preserves the header and the loop info. - // - // Note: the function records copying information about blocks and instructions. - void PeelOrUnrollOnce(LoopNode* loop_node, - bool do_unrolling, - SuperblockCloner::HBasicBlockMap* bb_map, - SuperblockCloner::HInstructionMap* hir_map); - // Tries to apply loop unrolling for branch penalty reduction and better instruction scheduling // opportunities. Returns whether transformation happened. bool TryUnrollingForBranchPenaltyReduction(LoopNode* loop_node); + // Tries to apply loop peeling for loop invariant exits elimination. Returns whether + // transformation happened. + bool TryPeelingForLoopInvariantExitsElimination(LoopNode* loop_node); + // // Vectorization analysis and synthesis. // -- cgit v1.2.3-59-g8ed1b