JIT: Disallow partial compilation of runtime async functions#125267
Open
jakobbotsch wants to merge 1 commit intodotnet:mainfrom
Open
JIT: Disallow partial compilation of runtime async functions#125267jakobbotsch wants to merge 1 commit intodotnet:mainfrom
jakobbotsch wants to merge 1 commit intodotnet:mainfrom
Conversation
Partial compilation removes the IR of the blocks being partially compiled. That makes the liveness computed by runtime async inaccurate, meaning that we will fail to capture variables needed after the OSR transition. We could make this work by keeping the uses inside `TransformPartialCompilation`, for example adding them as arguments to `CORINFO_HELP_PATCHPOINT_FORCED`. If we ever decide to enable partial compilation by default that seems like a better solution.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents Tier0 partial compilation from being applied to runtime async methods, because partial compilation can drop IR from deferred blocks and make runtime-async liveness analysis inaccurate across OSR transitions.
Changes:
- Split Tier0 OSR enablement vs partial compilation enablement into separate booleans (
enableOSR,enablePartialCompilation). - Disallow marking partial compilation patchpoints when
compIsAsync()is true.
Member
|
You could also go back to assuming everything is live? |
Member
Author
Yes, that would work too. I suppose it is a question of what is best for throughput overall. But it would require some more special casing in the async transformation than the change here. |
Member
Author
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS |
AndyAyersMS
approved these changes
Mar 6, 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 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.
Partial compilation removes the IR of the blocks being partially compiled. That makes the liveness computed by runtime async inaccurate, meaning that we will fail to capture variables needed after the OSR transition.
We could make this work by keeping the uses inside
TransformPartialCompilation, for example adding them as arguments toCORINFO_HELP_PATCHPOINT_FORCED. If we ever decide to enable partial compilation by default that seems like a better solution.Fix #125247