diff options
author | 2017-11-21 16:31:53 -0800 | |
---|---|---|
committer | 2017-11-24 17:06:40 -0800 | |
commit | f0010dd946b17490d2f792d845ea4f304a0bea28 (patch) | |
tree | e68b071ef742766090d722129c8c1d04ba2f90b0 /compiler/optimizing/intrinsics.h | |
parent | 6f99acac2e1d60dfb1ed45ce69ec5a542847687e (diff) |
Apply individual intrinsic recognition during inliner.
Rationale:
Inliner could introduce new method calls, in particular
it could change invoke-interface to invoke-virtual,
which could expose new intrinsics. This situation
happens, for example, in Kotlin generated code where
String operations first go through the CharSequence
interface. Rather than running a full new phase,
we just recognize intrinsics when interface calls
are replaced by virtual calls.
This optimization boosts KotlinMicroItems by 100%
Test: test-art-host test-art-target
Change-Id: Ibd0519283d67ed6997b056e34b4eafdd49fcbc2d
Diffstat (limited to 'compiler/optimizing/intrinsics.h')
-rw-r--r-- | compiler/optimizing/intrinsics.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h index 818d7f63a3..8088ab25a7 100644 --- a/compiler/optimizing/intrinsics.h +++ b/compiler/optimizing/intrinsics.h @@ -44,6 +44,11 @@ class IntrinsicsRecognizer : public HOptimization { void Run() OVERRIDE; + // Static helper that recognizes intrinsic call. Returns true on success. + // If it fails due to invoke type mismatch, wrong_invoke_type is set. + // Useful to recognize intrinsics on invidual calls outside this full pass. + static bool Recognize(HInvoke* invoke, /*out*/ bool* wrong_invoke_type); + static constexpr const char* kIntrinsicsRecognizerPassName = "intrinsics_recognition"; private: |