From 23b343dc3fc98fbb2401e037274fa6999ecde435 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 20 Aug 2025 11:10:22 -0700 Subject: [PATCH 1/3] Disable Tiered Compilation if DOTNET_Interpreter or DOTNET_InterpMode are used. --- src/coreclr/inc/clrconfigvalues.h | 1 + src/coreclr/vm/eeconfig.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/coreclr/inc/clrconfigvalues.h b/src/coreclr/inc/clrconfigvalues.h index 882a88839a933e..2462ec7e0aecf9 100644 --- a/src/coreclr/inc/clrconfigvalues.h +++ b/src/coreclr/inc/clrconfigvalues.h @@ -305,6 +305,7 @@ RETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJitExcludeAssemblies, W("AltJitExcludeAsse RETAIL_CONFIG_STRING_INFO(EXTERNAL_InterpreterName, W("InterpreterName"), "Primary interpreter to use") CONFIG_STRING_INFO(INTERNAL_InterpreterPath, W("InterpreterPath"), "Full path to the interpreter to use") RETAIL_CONFIG_STRING_INFO(EXTERNAL_Interpreter, W("Interpreter"), "Enables Interpreter and selectively limits it to the specified methods.") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_InterpMode, W("InterpMode"), 0, "Enables Interpreter for a subset of all methods depending on the specified mode.") #endif // FEATURE_INTERPRETER RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitHostMaxSlabCache, W("JitHostMaxSlabCache"), 0x1000000, "Sets jit host max slab cache size, 16MB default") diff --git a/src/coreclr/vm/eeconfig.cpp b/src/coreclr/vm/eeconfig.cpp index d0679d620bd1c8..2c2bd899de03df 100644 --- a/src/coreclr/vm/eeconfig.cpp +++ b/src/coreclr/vm/eeconfig.cpp @@ -635,6 +635,25 @@ HRESULT EEConfig::sync() #if defined(FEATURE_TIERED_COMPILATION) fTieredCompilation = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredCompilation"), CLRConfig::EXTERNAL_TieredCompilation); + +#if defined(FEATURE_INTERPRETER) + if (fTieredCompilation) + { + LPWSTR pwzInterpreterMaybe; + IfFailThrow(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Interpreter, &pwzInterpreterMaybe)); + if (pwzInterpreterMaybe && pwzInterpreterMaybe[0] != 0) + { + printf("Disabling tiered compilation because DOTNET_Interpreter is set.\n"); + fTieredCompilation = false; + } + else if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) != 0) + { + printf("Disabling tiered compilation because DOTNET_InterpMode is set.\n"); + fTieredCompilation = false; + } + } +#endif + if (fTieredCompilation) { fTieredCompilation_QuickJit = From bda298501df93c8e611c11a518559a97b5993fb1 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 20 Aug 2025 11:32:55 -0700 Subject: [PATCH 2/3] Remove diagnostic message --- src/coreclr/vm/eeconfig.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/coreclr/vm/eeconfig.cpp b/src/coreclr/vm/eeconfig.cpp index 2c2bd899de03df..e5e81a991c5af7 100644 --- a/src/coreclr/vm/eeconfig.cpp +++ b/src/coreclr/vm/eeconfig.cpp @@ -643,12 +643,10 @@ HRESULT EEConfig::sync() IfFailThrow(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Interpreter, &pwzInterpreterMaybe)); if (pwzInterpreterMaybe && pwzInterpreterMaybe[0] != 0) { - printf("Disabling tiered compilation because DOTNET_Interpreter is set.\n"); fTieredCompilation = false; } else if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) != 0) { - printf("Disabling tiered compilation because DOTNET_InterpMode is set.\n"); fTieredCompilation = false; } } From da6467a7db422aa61141ab14d57454f7d9f6bac8 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 20 Aug 2025 11:51:19 -0700 Subject: [PATCH 3/3] Update src/coreclr/vm/eeconfig.cpp Co-authored-by: Jan Kotas --- src/coreclr/vm/eeconfig.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/coreclr/vm/eeconfig.cpp b/src/coreclr/vm/eeconfig.cpp index e5e81a991c5af7..2b7c2c3bd71bfa 100644 --- a/src/coreclr/vm/eeconfig.cpp +++ b/src/coreclr/vm/eeconfig.cpp @@ -639,6 +639,8 @@ HRESULT EEConfig::sync() #if defined(FEATURE_INTERPRETER) if (fTieredCompilation) { + // Disable tiered compilation for interpreter testing. Tiered compilation and interpreter + // do not work well together currently. LPWSTR pwzInterpreterMaybe; IfFailThrow(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Interpreter, &pwzInterpreterMaybe)); if (pwzInterpreterMaybe && pwzInterpreterMaybe[0] != 0)