Skip to content

Commit

Permalink
JIT: Fix reporting of tier name metadata (dotnet#110610)
Browse files Browse the repository at this point in the history
The tier name was reported for both the root and the inlinees. On the
SPMI side this would result in using the last tier name reported, which
usually would be from an inlinee. The inlinee tier does not always match
the root tier, for example when OSR is enabled.
  • Loading branch information
jakobbotsch authored and hez2010 committed Dec 14, 2024
1 parent 57e0e9c commit c0e3f59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 5 additions & 7 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4053,6 +4053,11 @@ void Compiler::compSetOptimizationLevel()
{
codeGen->SetAlignLoops(JitConfig.JitAlignLoops() == 1);
}

#ifdef DEBUG
const char* tieringName = compGetTieringName(true);
JitMetadata::report(this, JitMetadata::TieringName, tieringName, strlen(tieringName));
#endif
}

fgCanRelocateEHRegions = true;
Expand Down Expand Up @@ -7152,13 +7157,6 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
opts.disAsm = false;
}

#ifdef DEBUG
{
const char* tieringName = compGetTieringName(true);
JitMetadata::report(this, JitMetadata::TieringName, tieringName, strlen(tieringName));
}
#endif

#if COUNT_BASIC_BLOCKS
bbCntTable.record(fgBBcount);

Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/tools/superpmi/superpmi/superpmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ static void PrintDiffsCsvRow(
bool hasDiff)
{
fw.Printf("%d,%u,", context, contextSize);
fw.PrintQuotedCsvField(baseRes.CompileResults->MethodFullName == nullptr ? "" : baseRes.CompileResults->MethodFullName);
fw.PrintQuotedCsvField(diffRes.CompileResults->MethodFullName == nullptr ? "" : diffRes.CompileResults->MethodFullName);
fw.Printf(
",%s,%s,%s,%s,%s,%lld,%lld",
baseRes.CompileResults->TieringName == nullptr ? "" : baseRes.CompileResults->TieringName,
diffRes.CompileResults->TieringName == nullptr ? "" : diffRes.CompileResults->TieringName,
ResultToString(baseRes.Result), ResultToString(diffRes.Result),
baseRes.IsMinOpts ? "True" : "False",
diffRes.IsMinOpts ? "True" : "False",
hasDiff ? "True" : "False",
baseRes.NumExecutedInstructions, diffRes.NumExecutedInstructions);

Expand Down

0 comments on commit c0e3f59

Please sign in to comment.