diff options
author | 2023-04-06 16:13:44 +0100 | |
---|---|---|
committer | 2023-04-14 13:52:59 +0000 | |
commit | 81869cc06c19d5e549d369ff86d581efb87cf2b8 (patch) | |
tree | 2551a10e80f17b713e326a3f73f438ff4bbf6909 /compiler/optimizing/code_sinking.h | |
parent | 77bbd1d06fc0d074eb53f88005c4c549351963ec (diff) |
Coalesce Return/ReturnVoid instructions
We do this to avoid generating the exit frame code several times.
We don't create new Return/ReturnVoid instructions after the
inliner, and CodeSinking looks like a logical place to add this
optimization.
Locally, speed-compiling in Pixel 5:
* system server: -516.05KB (1.1%)
* SystemUIGoogle: -216.50KB (0.8%)
* AGSA: -3021.91KB (0.93%)
Bug: 203237752
Bug: 188926997
Bug: 194133637
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ib149382462efac82a0bbc114cbdbc773e1a5228c
Diffstat (limited to 'compiler/optimizing/code_sinking.h')
-rw-r--r-- | compiler/optimizing/code_sinking.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/code_sinking.h b/compiler/optimizing/code_sinking.h index 14f62f2417..c743db40d9 100644 --- a/compiler/optimizing/code_sinking.h +++ b/compiler/optimizing/code_sinking.h @@ -39,10 +39,16 @@ class CodeSinking : public HOptimization { static constexpr const char* kCodeSinkingPassName = "code_sinking"; private: - // Try to move code only used by `end_block` and all its post-dominated / dominated + // Tries to sink code to uncommon branches. + void UncommonBranchSinking(); + // Tries to move code only used by `end_block` and all its post-dominated / dominated // blocks, to these blocks. void SinkCodeToUncommonBranch(HBasicBlock* end_block); + // Coalesces the Return/ReturnVoid instructions into one, if we have two or more. We do this to + // avoid generating the exit frame code several times. + void ReturnSinking(); + DISALLOW_COPY_AND_ASSIGN(CodeSinking); }; |