Skip to content
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
2 changes: 1 addition & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ CONFIG_DWORD_INFO(INTERNAL_OSR_HighId, W("OSR_HighId"), 10000000, "High end of e
RETAIL_CONFIG_STRING_INFO(INTERNAL_PGODataPath, W("PGODataPath"), "Read/Write PGO data from/to the indicated file.")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ReadPGOData, W("ReadPGOData"), 0, "Read PGO data")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_WritePGOData, W("WritePGOData"), 0, "Write PGO data")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TieredPGO, W("TieredPGO"), 0, "Instrument Tier0 code and make counts available to Tier1")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TieredPGO, W("TieredPGO"), 0, "Instrument Tier0 code and make counts available to Tier1")
#endif

///
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/vm/eeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ HRESULT EEConfig::Init()
tieredCompilation_DeleteCallCountingStubsAfter = 0;
#endif

#if defined(FEATURE_PGO)
fTieredPGO = false;
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
dwOSR_HitLimit = 10;
dwOSR_CounterBump = 5000;
Expand Down Expand Up @@ -769,6 +773,10 @@ HRESULT EEConfig::sync()
}
#endif

#if defined(FEATURE_PGO)
fTieredPGO = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredPGO"), CLRConfig::EXTERNAL_TieredPGO);
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
dwOSR_HitLimit = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_OSR_HitLimit);
dwOSR_CounterBump = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_OSR_CounterBump);
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/vm/eeconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class EEConfig
DWORD TieredCompilation_DeleteCallCountingStubsAfter() const { LIMITED_METHOD_CONTRACT; return tieredCompilation_DeleteCallCountingStubsAfter; }
#endif

#if defined(FEATURE_PGO)
bool TieredPGO(void) const { LIMITED_METHOD_CONTRACT; return fTieredPGO; }
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
// OSR Config
DWORD OSR_CounterBump() const { LIMITED_METHOD_CONTRACT; return dwOSR_CounterBump; }
Expand Down Expand Up @@ -648,6 +652,10 @@ class EEConfig
DWORD tieredCompilation_DeleteCallCountingStubsAfter;
#endif

#if defined(FEATURE_PGO)
bool fTieredPGO;
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
DWORD dwOSR_HitLimit;
DWORD dwOSR_CounterBump;
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12640,7 +12640,7 @@ CORJIT_FLAGS GetCompileFlags(MethodDesc * ftn, CORJIT_FLAGS flags, CORINFO_METHO
{
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_BBINSTR);
}
else if ((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_TieredPGO) > 0)
else if ((g_pConfig->TieredPGO())
&& (flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER0) || flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_OSR)))
{
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_BBINSTR);
Expand All @@ -12650,8 +12650,7 @@ CORJIT_FLAGS GetCompileFlags(MethodDesc * ftn, CORJIT_FLAGS flags, CORINFO_METHO
{
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_BBOPT);
}
else if ((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_TieredPGO) > 0)
&& flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER1))
else if (g_pConfig->TieredPGO() && flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER1))
{
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_BBOPT);
}
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/pgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ void PgoManager::ReadPgoData()
{
// Skip, if we're not reading, or we're writing profile data, or doing tiered pgo
//
if ((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_WritePGOData) > 0) ||
(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_TieredPGO) > 0) ||
if (g_pConfig->TieredPGO() ||
(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_WritePGOData) > 0) ||
(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_ReadPGOData) == 0))
{
return;
Expand Down