diff options
author | Aart Bik <ajcbik@google.com> | 2016-08-26 11:31:48 -0700 |
---|---|---|
committer | Aart Bik <ajcbik@google.com> | 2016-10-03 15:15:27 -0700 |
commit | 281c681a0852c10f5ca99b351650b244e878aea3 (patch) | |
tree | 33036cbfb76ee497eedf60e0e5785a2267c9dd02 /compiler/optimizing/optimizing_compiler.cc | |
parent | a845d07bbd57f8beaea8b4fb47192a3382ef25b2 (diff) |
A first implementation of a loop optimization framework.
Rationale:
We are planning to add more and more loop related optimizations
and this framework provides the basis to do so. For starters,
the framework optimizes dead induction, induction that can be
replaced with a simpler closed-form, and eliminates dead loops
completely (either pre-existing or as a result of induction
removal).
Speedup on e.g. Benchpress Loop is 73x (17.5us. -> 0.24us.)
[with the potential for more exploiting outer loop too]
Test: 618-checker-induction et al.
Change-Id: If80a809acf943539bf6726b0030dcabd50c9babc
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index d3a55dd365..c2fe1b144b 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -76,6 +76,7 @@ #include "jni/quick/jni_compiler.h" #include "licm.h" #include "load_store_elimination.h" +#include "loop_optimization.h" #include "nodes.h" #include "oat_quick_method_header.h" #include "prepare_for_register_allocation.h" @@ -737,6 +738,7 @@ void OptimizingCompiler::RunOptimizations(HGraph* graph, LoadStoreElimination* lse = new (arena) LoadStoreElimination(graph, *side_effects); HInductionVarAnalysis* induction = new (arena) HInductionVarAnalysis(graph); BoundsCheckElimination* bce = new (arena) BoundsCheckElimination(graph, *side_effects, induction); + HLoopOptimization* loop = new (arena) HLoopOptimization(graph, induction); HSharpening* sharpening = new (arena) HSharpening(graph, codegen, dex_compilation_unit, driver); InstructionSimplifier* simplify2 = new (arena) InstructionSimplifier( graph, stats, "instruction_simplifier$after_bce"); @@ -765,6 +767,7 @@ void OptimizingCompiler::RunOptimizations(HGraph* graph, licm, induction, bce, + loop, fold3, // evaluates code generated by dynamic bce simplify2, lse, |