diff options
author | 2016-01-19 14:08:02 +0000 | |
---|---|---|
committer | 2016-01-20 16:28:39 +0000 | |
commit | 82fc9bb45dbf8ff728122fb7ab72d1eb7b2f4869 (patch) | |
tree | 3a22cf5bb2e0012723ecdc7640e4db0dd5be2f0a /compiler/optimizing/inliner.cc | |
parent | 17ccfff2de292fd2b4a78aef87d79b662381f920 (diff) |
Inline methods with loops.
Compiling Gms/Fb/Framework/Docs:
- Overall compilation-time increase: 2.2%
- Overall code size increase: 1.1%
Performance improvements:
- Richards with jit: +6%
- Takl: +11%
Change-Id: I0a6fcf2a360e5ad193cd95b5c4fe92227ac6bd96
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r-- | compiler/optimizing/inliner.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 20c4f1f698..2e79df1b84 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -419,7 +419,10 @@ bool HInliner::TryInline(HInvoke* invoke_instruction, ArtMethod* method, bool do size_t inline_max_code_units = compiler_driver_->GetCompilerOptions().GetInlineMaxCodeUnits(); if (code_item->insns_size_in_code_units_ > inline_max_code_units) { VLOG(compiler) << "Method " << PrettyMethod(method) - << " is too big to inline"; + << " is too big to inline: " + << code_item->insns_size_in_code_units_ + << " > " + << inline_max_code_units; return false; } @@ -639,9 +642,12 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method, for (; !it.Done(); it.Advance()) { HBasicBlock* block = it.Current(); - if (block->IsLoopHeader()) { + + if (block->IsLoopHeader() && block->GetLoopInformation()->IsIrreducible()) { + // Don't inline methods with irreducible loops, they could prevent some + // optimizations to run. VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) - << " could not be inlined because it contains a loop"; + << " could not be inlined because it contains an irreducible loop"; return false; } |