[Wasm RyuJit] Crossgen fixes#124763
Merged
AndyAyersMS merged 10 commits intodotnet:mainfrom Feb 24, 2026
Merged
Conversation
Member
Author
|
@kg PTAL @SingleAccretion take a look at the changes in regalloc.. there may be more fallout from passing structs as their fields. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
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 |
kg
reviewed
Feb 23, 2026
kg
reviewed
Feb 23, 2026
kg
approved these changes
Feb 23, 2026
kg
reviewed
Feb 23, 2026
SingleAccretion
approved these changes
Feb 23, 2026
adamperlin
approved these changes
Feb 24, 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.
Fix some issues that I noticed while trying to crossgen debug/release System.Private.Corelib
thisas address-exposed