diff options
author | 2023-04-03 12:34:45 +0100 | |
---|---|---|
committer | 2023-04-04 12:31:27 +0000 | |
commit | 76d519b039fcdebf58e05dd42df4dc6cc08251e5 (patch) | |
tree | 9ab4e5e9c6cd0be1c90e6aef425f84e7a90dd960 /compiler/optimizing/code_generator.h | |
parent | edf865bdfba5cd48726b8b668baf2be19a285025 (diff) |
Inline unimplemented intrinsics
There are intrinsics that are unimplemented i.e. we didn't
hand-craft code for them. Allow the inliner to inline those.
Since our optimizations expect InvokeVirtual, I stopped the
de-virtualization of intrinsics. That could be re-added
if we modify optimizations like TryReplaceStringBuilderAppend.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: art/test/testrunner/testrunner.py --target --64 --optimizing
Test: compiling the APK in the bug and seeing the inline
Bug: 262585898
Fixes: 262585898
Change-Id: I501b69c4ffd9082ca8ffacb1cd1cd5d1ab3668a8
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r-- | compiler/optimizing/code_generator.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index ee80357791..9872efaa4a 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -304,6 +304,12 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { // Returns whether we should split long moves in parallel moves. virtual bool ShouldSplitLongMoves() const { return false; } + // Returns true if `invoke` is an implemented intrinsic in this codegen's arch. + bool IsImplementedIntrinsic(HInvoke* invoke) const { + return invoke->IsIntrinsic() && + !unimplemented_intrinsics_[static_cast<size_t>(invoke->GetIntrinsic())]; + } + size_t GetNumberOfCoreCalleeSaveRegisters() const { return POPCOUNT(core_callee_save_mask_); } @@ -749,7 +755,8 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { uint32_t core_callee_save_mask, uint32_t fpu_callee_save_mask, const CompilerOptions& compiler_options, - OptimizingCompilerStats* stats); + OptimizingCompilerStats* stats, + const art::ArrayRef<const bool>& unimplemented_intrinsics); virtual HGraphVisitor* GetLocationBuilder() = 0; virtual HGraphVisitor* GetInstructionVisitor() = 0; @@ -893,6 +900,9 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> { // CodeGenerator::Compile() and remains alive until the CodeGenerator is destroyed. std::unique_ptr<CodeGenerationData> code_generation_data_; + // Which intrinsics we don't have handcrafted code for. + art::ArrayRef<const bool> unimplemented_intrinsics_; + friend class OptimizingCFITest; ART_FRIEND_TEST(CodegenTest, ARM64FrameSizeSIMD); ART_FRIEND_TEST(CodegenTest, ARM64FrameSizeNoSIMD); |