From 7526a4c6a0a095670f1135d983a349b4e867f2e2 Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Wed, 12 Apr 2023 18:44:56 +0200 Subject: [PATCH] JIT: Add an in-release flag to enable physical promotion (#84689) Allow customers to enable this and also to be able to measure TP in the pass. --- src/coreclr/jit/jitconfigvalues.h | 3 +++ src/coreclr/jit/promotion.cpp | 2 +- src/tests/Common/testenvironment.proj | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/coreclr/jit/jitconfigvalues.h b/src/coreclr/jit/jitconfigvalues.h index 9400b3017cd5e..49b382a96885a 100644 --- a/src/coreclr/jit/jitconfigvalues.h +++ b/src/coreclr/jit/jitconfigvalues.h @@ -618,6 +618,9 @@ CONFIG_INTEGER(JitCFGUseDispatcher, W("JitCFGUseDispatcher"), 2) // Enable tail merging CONFIG_INTEGER(JitEnableTailMerge, W("JitEnableTailMerge"), 1) +// Enable physical promotion +CONFIG_INTEGER(JitEnablePhysicalPromotion, W("JitEnablePhysicalPromotion"), 0) + #if defined(DEBUG) // JitFunctionFile: Name of a file that contains a list of functions. If the currently compiled function is in the // file, certain other JIT config variables will be active. If the currently compiled function is not in the file, diff --git a/src/coreclr/jit/promotion.cpp b/src/coreclr/jit/promotion.cpp index e23bae7133624..af25903693dba 100644 --- a/src/coreclr/jit/promotion.cpp +++ b/src/coreclr/jit/promotion.cpp @@ -20,7 +20,7 @@ PhaseStatus Compiler::PhysicalPromotion() return PhaseStatus::MODIFIED_NOTHING; } - if (!compStressCompile(STRESS_PHYSICAL_PROMOTION, 25)) + if ((JitConfig.JitEnablePhysicalPromotion() == 0) && !compStressCompile(STRESS_PHYSICAL_PROMOTION, 25)) { return PhaseStatus::MODIFIED_NOTHING; } diff --git a/src/tests/Common/testenvironment.proj b/src/tests/Common/testenvironment.proj index f745c2d128585..edf656273fadc 100644 --- a/src/tests/Common/testenvironment.proj +++ b/src/tests/Common/testenvironment.proj @@ -49,7 +49,7 @@ DOTNET_JitStress; DOTNET_JitStressProcedureSplitting; DOTNET_JitStressRegs; - DOTNET_JitStressModeNames; + DOTNET_JitEnablePhysicalPromotion; DOTNET_TailcallStress; DOTNET_ReadyToRun; DOTNET_ZapDisable; @@ -215,8 +215,8 @@ - - + +