From 3747edb1812106f0b88a42b724c3e44b69dc79c4 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 9 May 2023 16:02:55 -0700 Subject: [PATCH] JIT: enable profile repairs of OSR entry block weight is zero (#86011) 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 a3a467a97fcf8..63e5b7efd56d9 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. //