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
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 6331a70..3abbbae 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -469,6 +469,9 @@
/* 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 @@
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 24d0153..58d65bb 100644
--- a/compiler/optimizing/optimizing_compiler_stats.h
+++ b/compiler/optimizing/optimizing_compiler_stats.h
@@ -37,6 +37,7 @@
kCompiledBytecode,
kCHAInline,
kInlinedInvoke,
+ kInlinedLastInvoke,
kReplacedInvokeWithSimplePattern,
kInstructionSimplifications,
kInstructionSimplificationsArch,
@@ -73,6 +74,7 @@
kSelectGenerated,
kRemovedInstanceOf,
kInlinedInvokeVirtualOrInterface,
+ kInlinedLastInvokeVirtualOrInterface,
kImplicitNullCheckGenerated,
kExplicitNullCheckGenerated,
kSimplifyIf,