JIT: Look harder for async calls in ASYNC_CONTINUATION lowering#122866
Merged
jakobbotsch merged 1 commit intodotnet:mainfrom Jan 6, 2026
Merged
JIT: Look harder for async calls in ASYNC_CONTINUATION lowering#122866jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch merged 1 commit intodotnet:mainfrom
Conversation
When the `AsyncHelpers.AsyncCallContinuation` intrinsic is used explicitly the introduced `ASYNC_CONTINUATION` node needs to appear right after the async call in linear order. That would usually be the case, but in some cases we can have a `stloc` for the call result that turns into an intervening helper call. Fix by trying harder to locate the previous async call and allow skipping over other non-async calls.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where the JIT's ASYNC_CONTINUATION lowering phase could fail when intervening non-async calls (e.g., helper calls from stloc operations) appear between an async call and its continuation node. The fix modifies the search logic to skip over non-async calls instead of stopping at the first call encountered.
Key Changes
- Modified the async continuation lookup logic to filter for async calls specifically, allowing the search to skip over intervening non-async helper calls
- Removed an assertion that became redundant after incorporating the async check into the loop condition
Member
Author
|
PTAL @dotnet/jit-contrib |
AndyAyersMS
approved these changes
Jan 5, 2026
Member
Author
|
/ba-g iOS dead letter |
This was referenced Jan 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
AsyncHelpers.AsyncCallContinuationintrinsic is used explicitly the introducedASYNC_CONTINUATIONnode needs to appear right after the async call in linear order. That would usually be the case, but in some cases we can have astlocfor the call result that turns into an intervening helper call.Fix by trying harder to locate the previous async call and allow skipping over other non-async calls. Hopefully that doesn't lead to any hard to diagnose issues.
Fix #122582