[Wasm RyuJit] more fixes from crossgen2 of spc#124837
[Wasm RyuJit] more fixes from crossgen2 of spc#124837AndyAyersMS merged 1 commit intodotnet:mainfrom
Conversation
AndyAyersMS
commented
Feb 25, 2026
- Wasm codegen does not use jump tables
- Bail with NYI for now if there are blocks only reachable via EH
- 8 byte structs can be returned as primitives
- another vn case where we need to tolerate the final pep arg
- handle structs passed/returned by-ref in signature gen code
- Wasm codegen does not use jump tables - Bail with NYI for now if there are blocks only reachable via EH - 8 byte structs can be returned as primitives - another vn case where we need to tolerate the final pep arg - handle structs passed/returned by-ref in signature gen code
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
@adamperlin PTAL This fixes some more issues that came up trying to crossgen a release System.Private.CoreLib for Wasm. The "successful" processing of SPC was done via #define NYI_WASM(x) implReadyToRunUnsupported()so that methods with features we cannot yet handle were cleanly skipped. Plus some workarounds for small struct issues in lowering and codegen. I will open issues for those. |
There was a problem hiding this comment.
Pull request overview
This PR contains several fixes for the WASM RyuJit compiler discovered while performing crossgen2 of System.Private.CoreLib (spc). The changes address various issues related to struct handling, value numbering, control flow, and switch optimization for the WASM target.
Changes:
- Handle structs passed/returned by-ref in WASM signature generation by adding null check for
LowerToAbiType - Allow
WasmPortableEntryPointargument in value numbering for helper calls with 3+ arguments - Enable 8-byte structs to be returned as primitives (TYP_LONG) on WASM, similar to 64-bit platforms
- Add proper NYI exception for methods with blocks only reachable via EH on WASM
- Skip jump table removal optimization on WASM since it doesn't use GT_JMPTABLE nodes
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/tools/Common/JitInterface/WasmLowering.cs | Adds null check for abiType to handle structs that must be passed by-ref, returning pointer type as fallback |
| src/coreclr/jit/valuenum.cpp | Relaxes assertion to allow WasmPortableEntryPoint as 4th argument in helper calls with 3 value-numbered arguments |
| src/coreclr/jit/layout.h | Extends TYP_LONG return type for 8-byte structs to include TARGET_WASM (previously only TARGET_64BIT) |
| src/coreclr/jit/fgwasm.cpp | Adds NYI_WASM macro to properly report unsupported EH-only reachable blocks instead of silently returning |
| src/coreclr/jit/fgopt.cpp | Guards GT_JMPTABLE removal code with !defined(TARGET_WASM) since WASM doesn't use jump tables |
- Wasm codegen does not use jump tables - Bail with NYI for now if there are blocks only reachable via EH - 8 byte structs can be returned as primitives - another vn case where we need to tolerate the final pep arg - handle structs passed/returned by-ref in signature gen code