Lower GT_RETURN_SUSPEND blocks to BBJ_RETURN#124177
Merged
jakobbotsch merged 3 commits intodotnet:mainfrom Feb 10, 2026
Merged
Conversation
When the AsyncSuspend intrinsic is used we can end up with GT_RETURN_SUSPEND present in a block that is not `BBJ_RETURN`. That would happen for instance because of return merging due to ELT profiler hooks. Expand the lowering for this node to convert the block containing `GT_RETURN_SUSPEND` into a `BBJ_RETURN` block.
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates JIT lowering to ensure blocks containing GT_RETURN_SUSPEND are properly treated as BBJ_RETURN blocks, addressing cases where return merging (e.g., due to ELT profiler hooks) can leave GT_RETURN_SUSPEND in a non-return block and break downstream assumptions.
Changes:
- Extend
Lowering::LowerReturnSuspendto scrub successor predecessor links and convert the containing block toBBJ_RETURN. - Adjust successor profile weights when removing outgoing flow and mark PGO data inconsistent when propagation would be required.
- Invalidate DFS tree after modifying control flow.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Feb 9, 2026
Member
Author
|
/azp run runtime-coreclr superpmi-diffs |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
PTAL @dotnet/jit-contrib |
AndyAyersMS
approved these changes
Feb 10, 2026
This was referenced Feb 10, 2026
Open
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 AsyncSuspend intrinsic is used we can end up with GT_RETURN_SUSPEND present in a block that is not
BBJ_RETURN. That would happen for instance because of return merging due to ELT profiler hooks.Expand the lowering for this node to convert the block containing
GT_RETURN_SUSPENDinto aBBJ_RETURNblock.Fix #124162