diff options
author | 2021-10-12 13:11:29 +0100 | |
---|---|---|
committer | 2021-10-12 13:55:05 +0000 | |
commit | 1558048c31b90ff5b3baf611d4dd70c1a003adfb (patch) | |
tree | 0d4eb1b5ac1464edc1e679f065bd5b9e432a8567 | |
parent | 5cbb0a9658e4c3a906139df2d1cf5b929d989faf (diff) |
Add stats for last step inlining of invokes
Add kInlinedLastInvoke(VirtualOrInterface) which counts the amount of invokes we inlined on the parent-most method. This is useful to know since it is the invoke that matters the most. The other inlinings are about recursive inlinings but those will not get into the graph if the last invoke fails to be inlined.
Change-Id: I4d293864033c950477f50149fd0318c501dcfb6f
-rw-r--r-- | compiler/optimizing/inliner.cc | 6 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler_stats.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 6331a70dd5..3abbbae573 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -469,6 +469,9 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) { /* do_rtp= */ true); if (result) { MaybeRecordStat(stats_, MethodCompilationStat::kInlinedInvokeVirtualOrInterface); + if (outermost_graph_ == graph_) { + MaybeRecordStat(stats_, MethodCompilationStat::kInlinedLastInvokeVirtualOrInterface); + } } else { HInvoke* invoke_to_analyze = nullptr; if (TryDevirtualize(invoke_instruction, actual_method, &invoke_to_analyze)) { @@ -1483,6 +1486,9 @@ bool HInliner::TryBuildAndInline(HInvoke* invoke_instruction, LOG_SUCCESS() << method->PrettyMethod(); MaybeRecordStat(stats_, MethodCompilationStat::kInlinedInvoke); + if (outermost_graph_ == graph_) { + MaybeRecordStat(stats_, MethodCompilationStat::kInlinedLastInvoke); + } return true; } diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h index 24d01539df..58d65bb97d 100644 --- a/compiler/optimizing/optimizing_compiler_stats.h +++ b/compiler/optimizing/optimizing_compiler_stats.h @@ -37,6 +37,7 @@ enum class MethodCompilationStat { kCompiledBytecode, kCHAInline, kInlinedInvoke, + kInlinedLastInvoke, kReplacedInvokeWithSimplePattern, kInstructionSimplifications, kInstructionSimplificationsArch, @@ -73,6 +74,7 @@ enum class MethodCompilationStat { kSelectGenerated, kRemovedInstanceOf, kInlinedInvokeVirtualOrInterface, + kInlinedLastInvokeVirtualOrInterface, kImplicitNullCheckGenerated, kExplicitNullCheckGenerated, kSimplifyIf, |