Skip to content

Commit 3747edb

Browse files
authored
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.
1 parent c0bb818 commit 3747edb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/coreclr/jit/fgprofile.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,7 @@ void EfficientEdgeCountReconstructor::Propagate()
36273627
// for the OSR entry block.
36283628
//
36293629
// Arguments:
3630-
// block - block in question
3630+
// block - block in question (OSR entry)
36313631
// info - model info for the block
36323632
// nSucc - number of successors of the block in the flow graph
36333633
//
@@ -3666,7 +3666,13 @@ void EfficientEdgeCountReconstructor::PropagateOSREntryEdges(BasicBlock* block,
36663666
}
36673667

36683668
assert(nEdges == nSucc);
3669-
assert(info->m_weight > BB_ZERO_WEIGHT);
3669+
3670+
if (info->m_weight == BB_ZERO_WEIGHT)
3671+
{
3672+
JITDUMP("\nPropagate: OSR entry block weight is zero\n");
3673+
EntryWeightZero();
3674+
return;
3675+
}
36703676

36713677
// Transfer model edge weight onto the FlowEdges as likelihoods.
36723678
//

0 commit comments

Comments
 (0)