summaryrefslogtreecommitdiff
path: root/compiler/optimizing/inliner.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2024-01-29 14:24:31 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2024-01-30 17:22:07 +0000
commit33e9f1a70d5f58639b524f40bf39a8e233c04ba8 (patch)
treef78d2949cac297400c0854ef57a4190f77d28e1b /compiler/optimizing/inliner.h
parent516020a3fbfe3db43f7faf0ac3daf5a45dbeeb6b (diff)
Reland^2 "Run optimizations with baseline compilation."
This reverts commit 3dccb13f4e92db37a13359e126c5ddc12cb674b5. Also includes the fix for incrementing hotness that got reverted: aosp/2906378 Bug: 313040662 Reduces jank on compose view scrolling for 4 iterations: - For Go Mokey: - Before: ~698 frames drawn / ~13.87% janky frames - After: ~937 frames drawn / ~5.52% janky frames - For Pixel 8 pro: - Before: ~2440 frames drawn / ~0.90% janky frames - After: ~2450 frames drawn / ~0.55% janky frames Reason for revert: Reduce inlining threshold for baseline. Change-Id: Iee5cd4c3ceb7715caf9299b56551aae6f0259769
Diffstat (limited to 'compiler/optimizing/inliner.h')
-rw-r--r--compiler/optimizing/inliner.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/optimizing/inliner.h b/compiler/optimizing/inliner.h
index 5e68dd866e..48600543c6 100644
--- a/compiler/optimizing/inliner.h
+++ b/compiler/optimizing/inliner.h
@@ -43,6 +43,7 @@ class HInliner : public HOptimization {
size_t total_number_of_dex_registers,
size_t total_number_of_instructions,
HInliner* parent,
+ HEnvironment* caller_environment,
size_t depth,
bool try_catch_inlining_allowed,
const char* name = kInlinerPassName)
@@ -54,6 +55,7 @@ class HInliner : public HOptimization {
total_number_of_dex_registers_(total_number_of_dex_registers),
total_number_of_instructions_(total_number_of_instructions),
parent_(parent),
+ caller_environment_(caller_environment),
depth_(depth),
inlining_budget_(0),
try_catch_inlining_allowed_(try_catch_inlining_allowed),
@@ -64,6 +66,12 @@ class HInliner : public HOptimization {
static constexpr const char* kInlinerPassName = "inliner";
+ const HInliner* GetParent() const { return parent_; }
+ const HEnvironment* GetCallerEnvironment() const { return caller_environment_; }
+
+ const HGraph* GetOutermostGraph() const { return outermost_graph_; }
+ const HGraph* GetGraph() const { return graph_; }
+
private:
enum InlineCacheType {
kInlineCacheNoData = 0,
@@ -109,6 +117,7 @@ class HInliner : public HOptimization {
// Run simple optimizations on `callee_graph`.
void RunOptimizations(HGraph* callee_graph,
+ HEnvironment* caller_environment,
const dex::CodeItem* code_item,
const DexCompilationUnit& dex_compilation_unit,
bool try_catch_inlining_allowed_for_recursive_inline)
@@ -321,9 +330,10 @@ class HInliner : public HOptimization {
const size_t total_number_of_dex_registers_;
size_t total_number_of_instructions_;
- // The 'parent' inliner, that means the inlinigng optimization that requested
+ // The 'parent' inliner, that means the inlining optimization that requested
// `graph_` to be inlined.
const HInliner* const parent_;
+ const HEnvironment* const caller_environment_;
const size_t depth_;
// The budget left for inlining, in number of instructions.