diff --git a/src/coreclr/jit/fginline.cpp b/src/coreclr/jit/fginline.cpp index c7d1fcef0cb33b..467bd4d182900a 100644 --- a/src/coreclr/jit/fginline.cpp +++ b/src/coreclr/jit/fginline.cpp @@ -781,6 +781,17 @@ PhaseStatus Compiler::fgInline() Metrics.ProfileConsistentBeforeInline++; } + if (!fgHaveProfileWeights()) + { + JITDUMP("INLINER: no pgo data\n"); + } + else + { + JITDUMP("INLINER: pgo source is %s; pgo data is %sconsistent; %strusted; %ssufficient\n", + compGetPgoSourceName(), fgPgoConsistent ? "" : "not ", fgHaveTrustedProfileWeights() ? "" : "not ", + fgHaveSufficientProfileWeights() ? "" : "not "); + } + noway_assert(fgFirstBB != nullptr); BasicBlock* block = fgFirstBB; diff --git a/src/coreclr/jit/inlinepolicy.cpp b/src/coreclr/jit/inlinepolicy.cpp index d852ce9d8c0bda..6ddd8c6278fe02 100644 --- a/src/coreclr/jit/inlinepolicy.cpp +++ b/src/coreclr/jit/inlinepolicy.cpp @@ -1372,13 +1372,24 @@ void ExtendedDefaultPolicy::NoteInt(InlineObservation obs, int value) // TODO: Enable for PgoSource::Static as well if it's not the generic profile we bundle. if (m_HasProfileWeights && (m_RootCompiler->fgHaveTrustedProfileWeights())) { + JITDUMP("Callee and root has trusted profile\n"); maxCodeSize = static_cast(JitConfig.JitExtDefaultPolicyMaxILProf()); } + else if (m_RootCompiler->fgHaveSufficientProfileWeights()) + { + JITDUMP("Root has sufficient profile\n"); + maxCodeSize = static_cast(JitConfig.JitExtDefaultPolicyMaxILRoot()); + } + else + { + JITDUMP("Callee has %s profile\n", m_HasProfileWeights ? "untrusted" : "no"); + } unsigned alwaysInlineSize = InlineStrategy::ALWAYS_INLINE_SIZE; if (m_InsideThrowBlock) { // Inline only small code in BBJ_THROW blocks, e.g. <= 8 bytes of IL + JITDUMP("Call site in throw block\n"); alwaysInlineSize /= 2; maxCodeSize = min(alwaysInlineSize + 1, maxCodeSize); } @@ -1401,6 +1412,7 @@ void ExtendedDefaultPolicy::NoteInt(InlineObservation obs, int value) else { // Callee too big, not a candidate + JITDUMP("Callee IL size %u exceeds maxCodeSize %u\n", m_CodeSize, maxCodeSize); SetNever(InlineObservation::CALLEE_TOO_MUCH_IL); } break; @@ -1425,6 +1437,7 @@ void ExtendedDefaultPolicy::NoteInt(InlineObservation obs, int value) if ((unsigned)value > bbLimit) { + JITDUMP("Callee BB count %u exceeds bbLimit %u\n", value, bbLimit); SetNever(InlineObservation::CALLEE_TOO_MANY_BASIC_BLOCKS); } } diff --git a/src/coreclr/jit/jitconfigvalues.h b/src/coreclr/jit/jitconfigvalues.h index 92a1cb5bf8f9ae..1bcde8ca322639 100644 --- a/src/coreclr/jit/jitconfigvalues.h +++ b/src/coreclr/jit/jitconfigvalues.h @@ -658,6 +658,7 @@ CONFIG_STRING(JitInlineReplayFile, "JitInlineReplayFile") // relies on PGO if it exists and generally is more aggressive. RELEASE_CONFIG_INTEGER(JitExtDefaultPolicy, "JitExtDefaultPolicy", 1) RELEASE_CONFIG_INTEGER(JitExtDefaultPolicyMaxIL, "JitExtDefaultPolicyMaxIL", 0x80) +RELEASE_CONFIG_INTEGER(JitExtDefaultPolicyMaxILRoot, "JitExtDefaultPolicyMaxILRoot", 0x100) RELEASE_CONFIG_INTEGER(JitExtDefaultPolicyMaxILProf, "JitExtDefaultPolicyMaxILProf", 0x400) RELEASE_CONFIG_INTEGER(JitExtDefaultPolicyMaxBB, "JitExtDefaultPolicyMaxBB", 7)