Skip to content

Commit

Permalink
Don't instrument methods with [Intrinsic] (#81983)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Feb 12, 2023
1 parent 77b5016 commit 6826a7f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/coreclr/jit/fgprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,15 @@ PhaseStatus Compiler::fgPrepareToInstrumentMethod()
const bool minimalProfiling =
prejit ? (JitConfig.JitMinimalPrejitProfiling() > 0) : (JitConfig.JitMinimalJitProfiling() > 0);

// In majority of cases, methods marked with [Intrinsic] are imported directly
// in Tier1 so the profile will never be consumed. Thus, let's avoid unnecessary probes.
if (minimalProfiling && (info.compFlags & CORINFO_FLG_INTRINSIC) != 0)
{
fgCountInstrumentor = new (this, CMK_Pgo) NonInstrumentor(this);
fgHistogramInstrumentor = new (this, CMK_Pgo) NonInstrumentor(this);
return PhaseStatus::MODIFIED_NOTHING;
}

if (minimalProfiling && (fgBBcount < 2))
{
// Don't instrumenting small single-block methods.
Expand Down

0 comments on commit 6826a7f

Please sign in to comment.