From 37d878ce22d151c218061b0920bff90f59c26382 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Wed, 9 Jul 2025 18:23:33 -0700 Subject: [PATCH] JIT: fix regressions from inlining policy change Don't boost the IL size threshold at Tier1+Instr, since this can cause us to lose profile data for key inlinees. Fixes most of the regressions from #115904 --- src/coreclr/jit/inlinepolicy.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/inlinepolicy.cpp b/src/coreclr/jit/inlinepolicy.cpp index 6ddd8c6278fe02..242bf7834752b9 100644 --- a/src/coreclr/jit/inlinepolicy.cpp +++ b/src/coreclr/jit/inlinepolicy.cpp @@ -1377,8 +1377,16 @@ void ExtendedDefaultPolicy::NoteInt(InlineObservation obs, int value) } else if (m_RootCompiler->fgHaveSufficientProfileWeights()) { - JITDUMP("Root has sufficient profile\n"); - maxCodeSize = static_cast(JitConfig.JitExtDefaultPolicyMaxILRoot()); + // For now we want to inline somewhat less aggressively in Tier1+Instr. We can reconsider + // when we have inlinee instrumentation. Otherwise we may lose profile data for key inlinees. + // + const bool isTier1Instr = m_RootCompiler->opts.IsInstrumentedAndOptimized(); + JITDUMP("Root has sufficient profile%s\n", + isTier1Instr ? "; but we are not boosting max IL size for Tier1+Instr" : ""); + if (!isTier1Instr) + { + maxCodeSize = static_cast(JitConfig.JitExtDefaultPolicyMaxILRoot()); + } } else {