From dfb3436076e16681b6578c3b6df1e5eabbbbe50f Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 9 May 2023 12:00:53 -0700 Subject: [PATCH] JIT: enable profile repairs of OSR entry block weight is zero If the PGO solver finds the OSR entry block weight is zero, schedule the method for profile repairs (similar to what we do for normal methods when the method entry block weight is zero, see #84312). Fixes #85838. --- src/coreclr/jit/fgprofile.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/fgprofile.cpp b/src/coreclr/jit/fgprofile.cpp index 33f922344cffcd..37a781894b815d 100644 --- a/src/coreclr/jit/fgprofile.cpp +++ b/src/coreclr/jit/fgprofile.cpp @@ -3627,7 +3627,7 @@ void EfficientEdgeCountReconstructor::Propagate() // for the OSR entry block. // // Arguments: -// block - block in question +// block - block in question (OSR entry) // info - model info for the block // nSucc - number of successors of the block in the flow graph // @@ -3666,7 +3666,13 @@ void EfficientEdgeCountReconstructor::PropagateOSREntryEdges(BasicBlock* block, } assert(nEdges == nSucc); - assert(info->m_weight > BB_ZERO_WEIGHT); + + if (info->m_weight == BB_ZERO_WEIGHT) + { + JITDUMP("\nPropagate: OSR entry block weight is zero\n"); + EntryWeightZero(); + return; + } // Transfer model edge weight onto the FlowEdges as likelihoods. //