From 2ccac33c87791e5a4117ab935c74f96f1369a9cc Mon Sep 17 00:00:00 2001 From: Mythri Alle Date: Wed, 23 Aug 2023 16:49:44 +0000 Subject: Enable intrinsic optimization for polymorphic intrinsics Polymorphic invokes are expensive and some of the methods in Atomic* classes uses polymorphic methods. We use intrinsics to generate efficient code for them. Intrinsic optimization was disabled in debuggable runtimes to be able to support breakpoint in intrinsic functions. It might be less useful to break in such methods so we want to enable intrinsic optimization for polymorphic invokes which are performance sensitive. Bug: 296298460 Test: art/test.py Change-Id: I575695d82e8bc7d703cfbf5ff22ea7d5a35f6937 --- compiler/optimizing/instruction_builder.cc | 3 +-- compiler/optimizing/nodes.h | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 2576b02c9f..fd599f789e 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -1364,8 +1364,7 @@ bool HInstructionBuilder::BuildInvokePolymorphic(uint32_t dex_pc, method_reference, resolved_method, resolved_method_reference, - proto_idx, - !graph_->IsDebuggable()); + proto_idx); if (!HandleInvoke(invoke, operands, shorty, /* is_unresolved= */ false)) { return false; } diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 9f085acdb3..b173764f2f 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -4871,8 +4871,7 @@ class HInvokePolymorphic final : public HInvoke { // to pass intrinsic information to the HInvokePolymorphic node. ArtMethod* resolved_method, MethodReference resolved_method_reference, - dex::ProtoIndex proto_idx, - bool enable_intrinsic_opt) + dex::ProtoIndex proto_idx) : HInvoke(kInvokePolymorphic, allocator, number_of_arguments, @@ -4883,9 +4882,8 @@ class HInvokePolymorphic final : public HInvoke { resolved_method, resolved_method_reference, kPolymorphic, - enable_intrinsic_opt), - proto_idx_(proto_idx) { - } + /* enable_intrinsic_opt= */ true), + proto_idx_(proto_idx) {} bool IsClonable() const override { return true; } -- cgit v1.2.3-59-g8ed1b