Skip to content

JIT: Set profile flag on async OSR jump blocks - #134325

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-133841
Sep 21, 2026
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-133841

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

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

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
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 21, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch
jakobbotsch marked this pull request as ready for review September 21, 2026 12:01
Copilot AI lite review requested due to automatic review settings September 21, 2026 12:01
@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

The same fix as #134311, although I removed the caller side PGO inheritance too.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_WEIGHT on OSR jump blocks created by AsyncTransformation::CreateOSRJumpBB when fgIsUsingProfileWeights() is true.
  • Remove the now-redundant caller-side inheritWeightPercentage(..., 0) assignment for the OSR jump block in CreateResumptionSwitch.
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.

@jakobbotsch
jakobbotsch merged commit 6f4751a into dotnet:main Sep 21, 2026
140 of 141 checks passed
@jakobbotsch
jakobbotsch deleted the fix-133841 branch September 21, 2026 20:37
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failed '!"Missing BBF_PROF_WEIGHT flag"' during 'Transform async'

3 participants