Uh oh!
There was an error while loading. Please reload this page.
JIT: update impFixupStructReturnType to handle GT_RET_EXPR - #132986
Conversation
Fixesdotnet#130135 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c85aeea6-fddf-4696-b29d-c0cf7619fb37
AndyAyersMS
commented
Aug 31, 2026
@EgorBo PTAL |
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
🟢 Approval recommended
Pull request overview
This PR updates the CoreCLR JIT importer’s struct-return retyping logic to correctly handle return values that arrive as GT_RET_EXPR placeholders (not just direct GT_CALL nodes), preventing downstream inliner expectations (ret-buffer arg presence) from being violated. It also adds a JIT regression test covering the reported Unsafe.BitCast scenario.
Changes:
- Extend
Compiler::impFixupStructReturnTypeto recognizeGT_RET_EXPRand treat its inline-candidate call similarly to direct calls when a return buffer is required. - Add a new JitBlue regression test for #130135 and wire it into the Regression_ro_2 test project.
File summaries
| File | Description |
|---|---|
| src/coreclr/jit/importer.cpp | Teach impFixupStructReturnType to handle GT_RET_EXPR inline-candidate calls that require a ret-buffer arg. |
| src/tests/JIT/Regression/Regression_ro_2.csproj | Include the new JitBlue regression test file in the build. |
| src/tests/JIT/Regression/JitBlue/Runtime_130135/Runtime_130135.cs | Add regression coverage for the Unsafe.BitCast<Vector64<int>, struct> return/inlining/retbuf interaction. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c85aeea6-fddf-4696-b29d-c0cf7619fb37
There was a problem hiding this comment.
🔵 Needs a closer look
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/tests/JIT/Regression/JitBlue/Runtime_130135/Runtime_130135.cs:9
- In this JitBlue regression test folder, files consistently place
usingdirectives before the file-scopednamespace(so the usings are outside the namespace). Here theusingdirectives are insidenamespace Runtime_130135;, which is inconsistent and can subtly affect scope for future additions (e.g., file-level attributes or additional namespaces).
namespace Runtime_130135;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using Xunit;
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Uh oh!
There was an error while loading. Please reload this page.
AndyAyersMS
commented
Sep 1, 2026
/backport to release/11.0 |
Started backporting to |
Fixes#130135