Remove async method inlining restrictions in crossgen2#125472
Open
jtschuster wants to merge 2 commits intodotnet:mainfrom
Open
Remove async method inlining restrictions in crossgen2#125472jtschuster wants to merge 2 commits intodotnet:mainfrom
jtschuster wants to merge 2 commits intodotnet:mainfrom
Conversation
Remove four restrictions that prevented async methods from being inlined during ReadyToRun compilation: 1. CanInline() rejected IsAsyncThunk()/IsAsyncCall() callees 2. CrossModuleInlineableUncached() rejected async variants/thunks 3. reportInlining() threw when async methods were cross-module inlined 4. InliningInfoNode skipped recording inlining info for async thunks All 69 async tests pass with both crossgen2 and composite R2R modes. Fixes dotnet#124665 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run runtime-coreclr crossgen2 |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Removes restrictions that prevented async methods from being inlined during ReadyToRun (crossgen2) compilation, fixing #124665.
Changes:
- Removed four separate guards that blocked inlining of async methods (thunks, variants, calls) in R2R compilation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| CorInfoImpl.ReadyToRun.cs | Removed exception throw for async method inlining |
| ReadyToRunCompilationModuleGroupBase.cs | Removed cross-module inlining restriction for async methods |
| ReadyToRunCodegenCompilation.cs | Removed CanInline restriction for async thunks/calls |
| InliningInfoNode.cs | Removed skip of async thunks in inlining info emission |
This was referenced Mar 12, 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.
Remove restrictions that prevented async methods from being inlined during ReadyToRun compilation.
All 69 async tests pass with both crossgen2 and composite R2R.
Output of the src/tests/async/execution-context/execution-context.cs was validated manually to ensure inlining is happening for async calls to methods without awaits. In
Test(), these two calls were inlined as expected.runtime/src/tests/async/execution-context/execution-context.cs
Lines 110 to 121 in b797348
Fixes #124665