Uh oh!
There was an error while loading. Please reload this page.
[Wasm RyuJit] Crossgen fixes - #124763
Conversation
AndyAyersMS
commented
Feb 23, 2026
@kg PTAL @SingleAccretion take a look at the changes in regalloc.. there may be more fallout from passing structs as their fields. |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR fixes several issues discovered while attempting to crossgen System.Private.CoreLib for the WASM RyuJit backend. These are targeted bug fixes that address correctness issues in WASM-specific code paths and improve code robustness.
Changes:
- Fixed value numbering assert to account for the WasmPortableEntryPoint argument that is not included in VNFuncArity
- Corrected struct field parent lookup during register allocation for ABI information
- Added proper handling for degenerate conditional branches during flow graph reordering
- Fixed
thispointer address-exposed detection to use compThisArg instead of hardcoded varNum==0 - Added Wasm special argument names for debugging output
- Added GT_PINVOKE_PROLOG case handling for WASM codegen (currently empty but prevents NYI assertion)
- Fixed layout fetching logic to only call GetLayout for TYP_STRUCT types
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/valuenum.cpp | Fixed assertion to allow WasmPortableEntryPoint arg at end of arglist; removed incorrect comment about VNFuncArity |
| src/coreclr/jit/regallocwasm.cpp | Fixed layout fetch to check for TYP_STRUCT first; fixed struct field parent lookup for ABI info |
| src/coreclr/jit/gentree.cpp | Added debug names for WasmShadowStackPointer and WasmPortableEntryPoint arguments |
| src/coreclr/jit/fgwasm.cpp | Added handling for degenerate BBJ_COND blocks (where true and false targets are identical) |
| src/coreclr/jit/fgbasic.cpp | Fixed this pointer detection to use info.compThisArg instead of hardcoded 0 |
| src/coreclr/jit/codegenwasm.cpp | Added GT_PINVOKE_PROLOG case with TODO comment for potential future work |
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fix some issues that I noticed while trying to crossgen debug/release System.Private.Corelib * need to be more careful fetching layout when rewriting local stores * handle degenerate BBJ_COND during wasm flow graph reordering * pinvoke prolog can likely be empty * fix VN assert for the extra PE arg we pass at end of arglist * make sure Wasm special call args have names in dumps * handle struct arg passed as field during reg alloc * fix logic for marking `this` as address-exposed
Fix some issues that I noticed while trying to crossgen debug/release System.Private.Corelib
thisas address-exposed