@@ -98,11 +98,7 @@ NativeCodeVersion::OptimizationTier TieredCompilationManager::GetInitialOptimiza
98
98
return NativeCodeVersion::OptimizationTierOptimized;
99
99
}
100
100
101
- if (pMethodDesc->RequestedAggressiveOptimization ())
102
- {
103
- // Methods flagged with MethodImplOptions.AggressiveOptimization start with and stay at tier 1
104
- return NativeCodeVersion::OptimizationTier1;
105
- }
101
+ _ASSERT (!pMethodDesc->RequestedAggressiveOptimization ());
106
102
107
103
if (!pMethodDesc->GetLoaderAllocator ()->GetCallCountingManager ()->IsCallCountingEnabled (NativeCodeVersion (pMethodDesc)))
108
104
{
@@ -1075,50 +1071,40 @@ CORJIT_FLAGS TieredCompilationManager::GetJitFlags(PrepareCodeConfig *config)
1075
1071
return flags;
1076
1072
}
1077
1073
1078
- NativeCodeVersion::OptimizationTier newOptimizationTier;
1079
- if (!methodDesc->RequestedAggressiveOptimization ())
1074
+ _ASSERT (!methodDesc->RequestedAggressiveOptimization ());
1075
+
1076
+ if (g_pConfig->TieredCompilation_QuickJit ())
1080
1077
{
1081
1078
NativeCodeVersion::OptimizationTier currentTier = nativeCodeVersion.GetOptimizationTier ();
1082
-
1083
- if (g_pConfig->TieredCompilation_QuickJit ())
1079
+ if (currentTier == NativeCodeVersion::OptimizationTier::OptimizationTier0Instrumented)
1084
1080
{
1085
- if (currentTier == NativeCodeVersion::OptimizationTier::OptimizationTier0Instrumented)
1086
- {
1087
- flags.Set (CORJIT_FLAGS::CORJIT_FLAG_BBINSTR);
1088
- flags.Set (CORJIT_FLAGS::CORJIT_FLAG_TIER0);
1089
- return flags;
1090
- }
1091
-
1092
- if (currentTier == NativeCodeVersion::OptimizationTier::OptimizationTier1Instrumented)
1093
- {
1094
- flags.Set (CORJIT_FLAGS::CORJIT_FLAG_BBINSTR);
1095
- flags.Set (CORJIT_FLAGS::CORJIT_FLAG_TIER1);
1096
- return flags;
1097
- }
1098
-
1099
- _ASSERTE (!nativeCodeVersion.IsFinalTier ());
1081
+ flags.Set (CORJIT_FLAGS::CORJIT_FLAG_BBINSTR);
1100
1082
flags.Set (CORJIT_FLAGS::CORJIT_FLAG_TIER0);
1101
- if (g_pConfig->TieredPGO () && g_pConfig->TieredPGO_InstrumentOnlyHotCode ())
1102
- {
1103
- // If we plan to only instrument hot code we have to make an exception
1104
- // for cold methods with loops so if those self promote to OSR they need
1105
- // some profile to optimize, so here we allow JIT to enable instrumentation
1106
- // if current method has loops and is eligible for OSR.
1107
- flags.Set (CORJIT_FLAGS::CORJIT_FLAG_BBINSTR_IF_LOOPS);
1108
- }
1109
1083
return flags;
1110
1084
}
1111
1085
1112
- newOptimizationTier = NativeCodeVersion::OptimizationTierOptimized;
1113
- }
1114
- else
1115
- {
1116
- newOptimizationTier = NativeCodeVersion::OptimizationTier1;
1117
- flags.Set (CORJIT_FLAGS::CORJIT_FLAG_TIER1);
1086
+ if (currentTier == NativeCodeVersion::OptimizationTier::OptimizationTier1Instrumented)
1087
+ {
1088
+ flags.Set (CORJIT_FLAGS::CORJIT_FLAG_BBINSTR);
1089
+ flags.Set (CORJIT_FLAGS::CORJIT_FLAG_TIER1);
1090
+ return flags;
1091
+ }
1092
+
1093
+ _ASSERTE (!nativeCodeVersion.IsFinalTier ());
1094
+ flags.Set (CORJIT_FLAGS::CORJIT_FLAG_TIER0);
1095
+ if (g_pConfig->TieredPGO () && g_pConfig->TieredPGO_InstrumentOnlyHotCode ())
1096
+ {
1097
+ // If we plan to only instrument hot code we have to make an exception
1098
+ // for cold methods with loops so if those self promote to OSR they need
1099
+ // some profile to optimize, so here we allow JIT to enable instrumentation
1100
+ // if current method has loops and is eligible for OSR.
1101
+ flags.Set (CORJIT_FLAGS::CORJIT_FLAG_BBINSTR_IF_LOOPS);
1102
+ }
1103
+ return flags;
1118
1104
}
1119
1105
1120
1106
methodDesc->GetLoaderAllocator ()->GetCallCountingManager ()->DisableCallCounting (nativeCodeVersion);
1121
- nativeCodeVersion.SetOptimizationTier (newOptimizationTier );
1107
+ nativeCodeVersion.SetOptimizationTier (NativeCodeVersion::OptimizationTierOptimized );
1122
1108
#ifdef FEATURE_INTERPRETER
1123
1109
flags.Set (CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE);
1124
1110
#endif
0 commit comments