Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions src/coreclr/jit/inline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,16 +792,39 @@ void InlineResult::Report()
// IS_NOINLINE, then we've uncovered a reason why this method
// can't ever be inlined. Update the callee method attributes
// so that future inline attempts for this callee fail faster.

//
InlineObservation obs = m_Policy->GetObservation();

if ((m_Callee != nullptr) && (obs != InlineObservation::CALLEE_IS_NOINLINE))
bool report = (m_Callee != nullptr);
bool suppress = (obs == InlineObservation::CALLEE_IS_NOINLINE);
bool dynamicPgo = m_RootCompiler->fgPgoDynamic;

// If dynamic pgo is active, only propagate noinline back to metadata
// when there is a CALLEE FATAL observation. We want to make sure
// not to block future inlines based on performance or throughput considerations.
//
// Note fgPgoDynamic (and hence dynamicPgo) is true iff TieredPGO is enabled globally.
// In particular this value does not depend on the root method having PGO data.
//
if (dynamicPgo)
{
InlineTarget target = InlGetTarget(obs);
InlineImpact impact = InlGetImpact(obs);
suppress = (target != InlineTarget::CALLEE) || (impact != InlineImpact::FATAL);
}

if (report && !suppress)
{
JITDUMP("\nINLINER: Marking %s as NOINLINE because of %s\n", callee, InlGetObservationString(obs));
JITDUMP("\nINLINER: Marking %s as NOINLINE (observation %s)\n", callee, InlGetObservationString(obs));

COMP_HANDLE comp = m_RootCompiler->info.compCompHnd;
comp->setMethodAttribs(m_Callee, CORINFO_FLG_BAD_INLINEE);
}
else if (suppress)
{
JITDUMP("\nINLINER: Not marking %s NOINLINE; %s (observation %s)\n", callee,
dynamicPgo ? "pgo active" : "already known", InlGetObservationString(obs));
}
}

if (IsDecided() || m_reportFailureAsVmFailure || m_successResult != INLINE_PASS)
Expand Down
Loading