Skip to content

Commit 4ae1cf2

Browse files
JIT: Mark profile inconsistent during flow opts if OSR entry is involved (dotnet#111362)
OSR entry weights are frequently imbalanced, so we skip profile consistency checks for them. However, fgUpdateFlowGraph can propagate these weights to normal blocks, which are checked for profile consistency. If we think this happened, liberally mark the profile as inconsistent. Fixes dotnet#111343.
1 parent 56d28a6 commit 4ae1cf2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/coreclr/jit/fgopt.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -6108,6 +6108,15 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
61086108
}
61096109
} while (change);
61106110

6111+
// OSR entry blocks will frequently have a profile imbalance as original method execution was hijacked at them.
6112+
// Mark the profile as inconsistent if we might have propagated the OSR entry weight.
6113+
if (modified && opts.IsOSR())
6114+
{
6115+
JITDUMP("fgUpdateFlowGraph: Inconsistent OSR entry weight may have been propagated. Data %s consistent.\n",
6116+
fgPgoConsistent ? "is now" : "was already");
6117+
fgPgoConsistent = false;
6118+
}
6119+
61116120
#ifdef DEBUG
61126121
if (!isPhase)
61136122
{

0 commit comments

Comments
 (0)