From c97e79c06af98a4e331733d15784c188c4999477 Mon Sep 17 00:00:00 2001 From: Ross McIlroy Date: Fri, 9 Oct 2020 14:46:45 +0100 Subject: [PATCH] [TurboProp] Enable mid-tier register allocator for TurboProp BUG=v8:9684 Change-Id: I064b552b021597a80e57303cab3c2fbf552be6a2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2463228 Commit-Queue: Ross McIlroy Reviewed-by: Georg Neis Cr-Commit-Position: refs/heads/master@{#70427} --- src/codegen/optimized-compilation-info.h | 1 + src/compiler/pipeline.cc | 4 +--- src/flags/flag-definitions.h | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/codegen/optimized-compilation-info.h b/src/codegen/optimized-compilation-info.h index cbeb426ca6..1225307c61 100644 --- a/src/codegen/optimized-compilation-info.h +++ b/src/codegen/optimized-compilation-info.h @@ -149,6 +149,7 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final { bool IsNativeContextIndependent() const { return code_kind() == CodeKind::NATIVE_CONTEXT_INDEPENDENT; } + bool IsTurboprop() const { return code_kind() == CodeKind::TURBOPROP; } bool IsStub() const { return code_kind() == CodeKind::DEOPT_ENTRIES_OR_FOR_TESTING; } diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc index 3979b3bb14..5c914172d1 100644 --- a/src/compiler/pipeline.cc +++ b/src/compiler/pipeline.cc @@ -3375,7 +3375,7 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) { config = RegisterConfiguration::Default(); } - if (FLAG_turboprop_mid_tier_reg_alloc) { + if (data->info()->IsTurboprop() && FLAG_turboprop_mid_tier_reg_alloc) { AllocateRegistersForMidTier(config, call_descriptor, run_verifier); } else { AllocateRegistersForTopTier(config, call_descriptor, run_verifier); @@ -3698,8 +3698,6 @@ void PipelineImpl::AllocateRegistersForMidTier( data->sequence()->ValidateDeferredBlockEntryPaths(); data->sequence()->ValidateDeferredBlockExitPaths(); #endif - - if (info()->is_osr()) data->osr_helper()->SetupFrame(data->frame()); data->InitializeMidTierRegisterAllocationData(config, call_descriptor); TraceSequence(info(), data, "before register allocation"); diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index 1a48b26b92..3137eb2ad3 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -549,8 +549,8 @@ DEFINE_BOOL(trace_generalization, false, "trace map generalization") // Flags for TurboProp. DEFINE_BOOL(turboprop, false, "enable experimental turboprop mid-tier compiler") -DEFINE_BOOL(turboprop_mid_tier_reg_alloc, false, - "enable experimental mid-tier register allocator") +DEFINE_BOOL(turboprop_mid_tier_reg_alloc, true, + "enable mid-tier register allocator for turboprop") DEFINE_NEG_IMPLICATION(turboprop, turbo_inlining) DEFINE_IMPLICATION(turboprop, concurrent_inlining) DEFINE_VALUE_IMPLICATION(turboprop, interrupt_budget, 15 * KB)