JIT: Set profile flag on async OSR jump blocks - #134325
Conversation
Initialize BBF_PROF_WEIGHT in CreateOSRJumpBB so tail-await-only methods preserve profile bookkeeping under stress. Remove the redundant caller-side weight assignment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6639633d-4070-488c-b82e-e29727e09f65
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS The same fix as #134311, although I removed the caller side PGO inheritance too. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change directly addresses the missing BBF_PROF_WEIGHT flag for a newly created block under profile weights, and the removed weight inheritance is redundant given the block is already made cold (bbSetRunRarely()) and now explicitly flagged.
Review effort: Lite
Findings: None
What changed in this PR
This PR fixes a JIT debug invariant violation during async transformation when profile weights are in use by ensuring OSR jump blocks created for async resumption are marked as having profile-derived weights.
Changes:
- Set
BBF_PROF_WEIGHTon OSR jump blocks created byAsyncTransformation::CreateOSRJumpBBwhenfgIsUsingProfileWeights()is true. - Remove the now-redundant caller-side
inheritWeightPercentage(..., 0)assignment for the OSR jump block inCreateResumptionSwitch.
| File | Description |
|---|---|
| src/coreclr/jit/async.cpp | Ensures OSR jump blocks are flagged with BBF_PROF_WEIGHT under profile-weighted compilation, avoiding profile-weight verification asserts during async transform. |
Initialize BBF_PROF_WEIGHT in CreateOSRJumpBB so tail-await-only methods preserve profile bookkeeping under stress. Remove the redundant caller-side weight assignment.
Fix #133841