diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2017-02-28 17:41:45 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2017-03-24 14:02:54 +0000 |
commit | f6d4668c42933e2f85ddbc94e276c49db4e2b1dd (patch) | |
tree | 3343addb8cde45eb4070d4876f26bef1002248dc /compiler/optimizing/optimizing_compiler.cc | |
parent | 0bbb750f6ff9a52bc4649995fc78ebea87e31dd1 (diff) |
Improvements in the Inliner.
- Change from a depth limit to a total number of HInstructions
inlined limit. Remove the dex2oat depth limit argument.
- Add more stats to diagnose reasons for not inlining.
- Clean up logging to easily parse output.
Individual Ritz benchmarks improve from 3 to 10%.
No change in other heuristics. There was already an instruction budget.
Note that the instruction budget is rarely hit in the "apps" I've tried
with.
Compile-times improve from 5 to 15%.
Code size go from 4% increase (Gms) to 1% decrease (Docs).
bug:35724239
test: test-art-host test-art-target
Change-Id: I5a35c4bd826cf21fead77859709553c5b57608d6
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 23ccd9e953..3c6d2d64a9 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -499,7 +499,8 @@ static HOptimization* BuildOptimization( handles, stats, number_of_dex_registers, - /* depth */ 0); + /* total_number_of_instructions */ 0, + /* parent */ nullptr); } else if (opt_name == HSharpening::kSharpeningPassName) { return new (arena) HSharpening(graph, codegen, dex_compilation_unit, driver, handles); } else if (opt_name == HSelectGenerator::kSelectGeneratorPassName) { @@ -607,8 +608,7 @@ void OptimizingCompiler::MaybeRunInliner(HGraph* graph, VariableSizedHandleScope* handles) const { OptimizingCompilerStats* stats = compilation_stats_.get(); const CompilerOptions& compiler_options = driver->GetCompilerOptions(); - bool should_inline = (compiler_options.GetInlineDepthLimit() > 0) - && (compiler_options.GetInlineMaxCodeUnits() > 0); + bool should_inline = (compiler_options.GetInlineMaxCodeUnits() > 0); if (!should_inline) { return; } @@ -623,7 +623,8 @@ void OptimizingCompiler::MaybeRunInliner(HGraph* graph, handles, stats, number_of_dex_registers, - /* depth */ 0); + /* total_number_of_instructions */ 0, + /* parent */ nullptr); HOptimization* optimizations[] = { inliner }; RunOptimizations(optimizations, arraysize(optimizations), pass_observer); |