Skip to content

Commit

Permalink
JIT: Add an in-release flag to enable physical promotion (#84689)
Browse files Browse the repository at this point in the history
Allow customers to enable this and also to be able to measure TP in the
pass.
  • Loading branch information
jakobbotsch authored Apr 12, 2023
1 parent 63e39e2 commit 7526a4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/coreclr/jit/jitconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/promotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/tests/Common/testenvironment.proj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
DOTNET_JitStress;
DOTNET_JitStressProcedureSplitting;
DOTNET_JitStressRegs;
DOTNET_JitStressModeNames;
DOTNET_JitEnablePhysicalPromotion;
DOTNET_TailcallStress;
DOTNET_ReadyToRun;
DOTNET_ZapDisable;
Expand Down Expand Up @@ -215,8 +215,8 @@
<TestEnvironment Include="jitpartialcompilation" TC_PartialCompilation="1" TC_QuickJitForLoops="1" TieredCompilation="1" />
<TestEnvironment Include="jitpartialcompilation_pgo" TC_PartialCompilation="1" TC_QuickJitForLoops="1" TieredCompilation="1" TieredPGO="1" />
<TestEnvironment Include="jitobjectstackallocation" JitObjectStackAllocation="1" TieredCompilation="0" />
<TestEnvironment Include="jitphysicalpromotion" JitStressModeNames="STRESS_PHYSICAL_PROMOTION" TieredCompilation="0" />
<TestEnvironment Include="jitphysicalpromotion_full" JitStressModeNames="STRESS_PHYSICAL_PROMOTION STRESS_PHYSICAL_PROMOTION_COST STRESS_NO_OLD_PROMOTION" TieredCompilation="0" />
<TestEnvironment Include="jitphysicalpromotion" JitEnablePhysicalPromotion="1" TieredCompilation="0" />
<TestEnvironment Include="jitphysicalpromotion_full" JitEnablePhysicalPromotion="1" JitStressModeNames="STRESS_PHYSICAL_PROMOTION_COST STRESS_NO_OLD_PROMOTION" TieredCompilation="0" />
<TestEnvironment Include="jitcfg" JitForceControlFlowGuard="1" />
<TestEnvironment Include="jitcfg_dispatcher_always" JitForceControlFlowGuard="1" JitCFGUseDispatcher="1" />
<TestEnvironment Include="jitcfg_dispatcher_never" JitForceControlFlowGuard="1" JitCFGUseDispatcher="0" />
Expand Down

0 comments on commit 7526a4c

Please sign in to comment.