From e482cccb1182af357919d8b0208a7df1a2c9258d Mon Sep 17 00:00:00 2001 From: "Aman Khalid (from Dev Box)" Date: Wed, 12 Feb 2025 15:33:35 -0500 Subject: [PATCH] Use fgCalledCount in inlinee weight computation --- src/coreclr/jit/importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index d3de5273c0b613..60f1c92b63017d 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -12878,7 +12878,7 @@ void Compiler::impMakeDiscretionaryInlineObservations(InlineInfo* pInlineInfo, I if ((pInlineInfo != nullptr) && rootCompiler->fgHaveSufficientProfileWeights()) { const weight_t callSiteWeight = pInlineInfo->iciBlock->bbWeight; - const weight_t entryWeight = rootCompiler->fgFirstBB->bbWeight; + const weight_t entryWeight = rootCompiler->fgCalledCount; profileFreq = fgProfileWeightsEqual(entryWeight, 0.0) ? 0.0 : callSiteWeight / entryWeight; hasProfile = true;