Things have progressed far enough that its time to use a friendlier name. The feature still still has performance aspects that need to be investigated and improved, but I don't want to scare people off simply because it isn't as fast as it could be.
This also updates to use a newer CoreFX version for JitBench since that appeared to be broken, and updated some comments and usage of the tieredcompilation variable.
<!-- Scenario tests install this version of Microsoft.NetCore.App, then patch coreclr binaries via xcopy. At the moment it is
updated manually whenever breaking changes require it to move forward, but it would be nice if we could update it automatically
as we do with many of the package versions above -->
- <BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview3-26319-04</BaselineMicrosoftNetCoreAppPackageVersion>
+ <BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview3-26327-01</BaselineMicrosoftNetCoreAppPackageVersion>
</PropertyGroup>
<!-- Package versions used as toolsets -->
/// Tiered Compilation
///
#ifdef FEATURE_TIERED_COMPILATION
-RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TieredCompilation, W("EXPERIMENTAL_TieredCompilation"), 0, "Enables tiered compilation")
+RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TieredCompilation, W("TieredCompilation"), 0, "Enables tiered compilation")
+RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_LEGACY_TieredCompilation, W("EXPERIMENTAL_TieredCompilation"), 0, "Deprecated - Use COMPLUS_TieredCompilation")
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TieredCompilation_Tier1CallCountThreshold, W("TieredCompilation_Tier1CallCountThreshold"), 30, "Number of times a method must be called after which it is promoted to tier 1.")
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TieredCompilation_Tier1CallCountingDelayMs, W("TieredCompilation_Tier1CallCountingDelayMs"), 100, "Delay in milliseconds since process startup or the last tier 0 JIT before call counting begins for tier 1 promotion.")
#endif
dwSleepOnExit = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_SleepOnExit);
#if defined(FEATURE_TIERED_COMPILATION)
- fTieredCompilation = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_TieredCompilation) != 0;
+ fTieredCompilation = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_TieredCompilation) != 0 ||
+ //this older name is deprecated, but still accepted for a time. Preserving it is a very small overhead not to needlessly break things.
+ CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_LEGACY_TieredCompilation) != 0;
+
tieredCompilation_tier1CallCountThreshold =
CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_TieredCompilation_Tier1CallCountThreshold);
if (tieredCompilation_tier1CallCountThreshold < 1)
//
// # Current feature state
//
-// This feature is incomplete and currently experimental. To enable it
-// you need to set COMPLUS_EXPERIMENTAL_TieredCompilation = 1. When the environment
-// variable is unset the runtime should work as normal, but when it is there are a few
-// known issues
-// ETW - Native to IL maps aren't correctly emitted (probably tier1 wrong, tier0 right)
-// Profiler - Still missing APIs that allow profilers to correctly get native to IL
-// maps for all code bodies.
-//
-// Diagnostic tools have minimal testing that we are aware of and its possible they
-// made additional assumptions about runtime implementation that have been invalidated
-// by this feature. VS debugging does appear to work at a basic level at least.
-//
-// I aim to keep this comment updated as things change.
+// This feature is a work in progress. It should be functionally correct for a
+// good range of scenarios, but performance varies by scenario. To enable it
+// you need to set COMPLUS_TieredCompilation = 1. This feature has been
+// tested with all of our runtime and CoreFX functional tests, as well as
+// diagnostics tests and various partner testing in Visual Studio.
//
//
// # Important entrypoints in this code:
if /i "%1" == "PerfTests" (set __PerfTests=true&shift&goto Arg_Loop)
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
if /i "%1" == "link" (set DoLink=true&set ILLINK=%2&shift&shift&goto Arg_Loop)
-if /i "%1" == "tieredcompilation" (set COMPLUS_EXPERIMENTAL_TieredCompilation=1&shift&goto Arg_Loop)
+if /i "%1" == "tieredcompilation" (set COMPLUS_TieredCompilation=1&shift&goto Arg_Loop)
if /i "%1" == "gcname" (set COMPlus_GCName=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "timeout" (set __TestTimeout=%2&shift&shift&goto Arg_Loop)
echo 4: GC on every allowable JITed instruction
echo 8: GC on every allowable NGEN instruction
echo 16: GC only on a unique stack trace
-echo tieredcompilation - Run the tests with COMPlus_EXPERIMENTAL_TieredCompilation=1
+echo tieredcompilation - Run the tests with COMPlus_TieredCompilation=1
echo gcname ^<name^> - Runs the tests with COMPlus_GCName=name
echo timeout ^<n^> - Sets the per-test timeout in milliseconds ^(default is 10 minutes = 10 * 60 * 1000 = 600000^).
echo Note: some options override this ^(gcstresslevel, longgc, gcsimulator^).
echo ' 8: GC on every allowable NGEN instr 16: GC only on a unique stack trace'
echo ' --long-gc : Runs the long GC tests'
echo ' --gcsimulator : Runs the GCSimulator tests'
- echo ' --tieredcompilation : Runs the tests with COMPlus_EXPERIMENTAL_TieredCompilation=1'
+ echo ' --tieredcompilation : Runs the tests with COMPlus_TieredCompilation=1'
echo ' --link <ILlink> : Runs the tests after linking via ILlink'
echo ' --show-time : Print execution sequence and running time for each test'
echo ' --no-lf-conversion : Do not execute LF conversion before running test script'
export DoLink=true
;;
--tieredcompilation)
- export COMPlus_EXPERIMENTAL_TieredCompilation=1
+ export COMPlus_TieredCompilation=1
;;
--jitdisasm)
jitdisasm=1
if optLevel == 'min_opts':
myEnv['COMPlus_JITMinOpts'] = '1'
elif optLevel == 'tiered':
- myEnv['COMPLUS_EXPERIMENTAL_TieredCompilation'] = '1'
+ myEnv['COMPLUS_TieredCompilation'] = '1'
if not 'XUNIT_PERFORMANCE_MAX_ITERATION' in myEnv:
myEnv['XUNIT_PERFORMANCE_MAX_ITERATION'] = '21'
]]></BashCLRTestEnvironmentCompatibilityCheck>
<BashCLRTestEnvironmentCompatibilityCheck Condition="'$(JitOptimizationSensitive)' == 'true'"><![CDATA[
$(BashCLRTestEnvironmentCompatibilityCheck)
-if [[ ( ! -z "$COMPlus_JitStress" ) || ( ! -z "$COMPlus_JitStressRegs" ) || ( ! -z "$COMPlus_JITMinOpts" ) || ( ! -z "$COMPlus_TailcallStress" ) || ( ! -z "$COMPlus_EXPERIMENTAL_TieredCompilation" ) ]]
+if [[ ( ! -z "$COMPlus_JitStress" ) || ( ! -z "$COMPlus_JitStressRegs" ) || ( ! -z "$COMPlus_JITMinOpts" ) || ( ! -z "$COMPlus_TailcallStress" ) || ( ! -z "$COMPlus_EXPERIMENTAL_TieredCompilation" ) || ( ! -z "$COMPlus_TieredCompilation" ) ]]
then
- echo "SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts, COMPlus_TailcallStress, COMPlus_EXPERIMENTAL_TieredCompilation) IS SET"
+ echo "SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts, COMPlus_TailcallStress, COMPlus_EXPERIMENTAL_TieredCompilation, COMPlus_TieredCompilation) IS SET"
exit $(GCBashScriptExitCode)
fi
]]></BashCLRTestEnvironmentCompatibilityCheck>
]]></BatchCLRTestEnvironmentCompatibilityCheck>
<BatchCLRTestEnvironmentCompatibilityCheck Condition="'$(JitOptimizationSensitive)' == 'true'"><![CDATA[
$(BatchCLRTestEnvironmentCompatibilityCheck)
-IF "%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_JITMinOpts%"=="" IF "%COMPlus_TailcallStress%"=="" IF "%COMPlus_EXPERIMENTAL_TieredCompilation%"=="" goto :Compatible1
- ECHO SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts, COMPlus_TailcallStress, COMPlus_EXPERIMENTAL_TieredCompilation) IS SET
+IF "%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_JITMinOpts%"=="" IF "%COMPlus_TailcallStress%"=="" IF "%COMPlus_EXPERIMENTAL_TieredCompilation%"=="" IF "%COMPlus_TieredCompilation%"=="" goto :Compatible1
+ ECHO SKIPPING EXECUTION BECAUSE ONE OR MORE OF (COMPlus_JitStress, COMPlus_JitStressRegs, COMPlus_JITMinOpts, COMPlus_TailcallStress, COMPlus_EXPERIMENTAL_TieredCompilation, COMPlus_TieredCompilation) IS SET
popd
Exit /b 0
:Compatible1
<PropertyGroup>
<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
-set COMPlus_EXPERIMENTAL_TieredCompilation=1
+set COMPlus_TieredCompilation=1
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
-export COMPlus_EXPERIMENTAL_TieredCompilation=1
+export COMPlus_TieredCompilation=1
]]></BashCLRTestPreCommands>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
public BenchmarkConfiguration WithTiering()
{
- return WithModifier("Tiering", "COMPLUS_EXPERIMENTAL_TieredCompilation", "1");
+ return WithModifier("Tiering", "COMPLUS_TieredCompilation", "1");
}
public BenchmarkConfiguration WithMinOpts()
static IEnumerable<BenchmarkConfiguration> GetBenchmarkConfigurations(CommandLineOptions options)
{
- string tieredEnv = Environment.GetEnvironmentVariable("COMPLUS_EXPERIMENTAL_TieredCompilation");
+ string tieredEnv = Environment.GetEnvironmentVariable("COMPLUS_TieredCompilation");
string minoptsEnv = Environment.GetEnvironmentVariable("COMPLUS_JitMinopts");
string r2rEnv = Environment.GetEnvironmentVariable("COMPLUS_ReadyToRun");
string ngenEnv = Environment.GetEnvironmentVariable("COMPLUS_ZapDisable");
<PropertyGroup>
<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
-set COMPlus_EXPERIMENTAL_TieredCompilation=1
+set COMPlus_TieredCompilation=1
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
-export COMPlus_EXPERIMENTAL_TieredCompilation=1
+export COMPlus_TieredCompilation=1
]]></BashCLRTestPreCommands>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />