Uh oh!
There was an error while loading. Please reload this page.
JIT: Share suspension epilogs in async transformation - #125174
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR changes the CoreCLR JIT async transformation to share a single GT_RETURN_SUSPEND “shared return” block when there are multiple awaits, so multiple suspension points can branch to one epilog.
Changes:
- Refactors await discovery into
FindAwaits(...), tracking normal vs tail-awaits and total await counts. - Transforms tail awaits in a first pass (
TransformTailAwaits(...)) and re-scans when needed. - Introduces
CreateSharedReturnBB()to create a sharedGT_RETURN_SUSPENDblock when#awaits > 1.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/jit/async.h | Adds declarations for await discovery, tail-await batch transform, and shared return block creation. |
| src/coreclr/jit/async.cpp | Implements the refactor and shared return block creation, and updates tail-await suspension to use m_sharedReturnBB. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jakobbotsch
commented
Mar 6, 2026
/azp run runtime-coreclr superpmi-diffs |
|
Azure Pipelines successfully started running 1 pipeline(s). |
If we have more than one await, then create a shared `GT_RETURN_SUSPEND` block and use that for suspension always.
899702f to
b5f17f9CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b5f17f9 to
a7f7ee7CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cc @dotnet/jit-contrib PTAL @dhartglassMSFT |
jakobbotsch
commented
Apr 7, 2026
Ping @dhartglassMSFT. I have a couple of PRs depending on this. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
If we have more than one await, then create a shared
GT_RETURN_SUSPENDblock and use that for suspension always.Pretty modest R2R size diffs for x64.
R2R size diffs x64
Detailed asp.net+runtimeasync crossgen2 diffs:
https://gist.github.com/jakobbotsch/ab57d97f2ea63f30ada41cb57713c779