Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Add an in-release flag to enable physical promotion #84689

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be || instead or do we want to do physical promotion if JitEnablePhysicalPromotion == 1 and !compStressCompile(STRESS_PHYSICAL_PROMOTION, 25) is true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be && -- I want to allow it to be enabled by either JitEnablePhysicalPromotion=1 or the stress mode. compStressCompile is always false in release builds

{
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