Skip to content

Comments

[Wasm RyuJit] Crossgen fixes#124763

Merged
AndyAyersMS merged 10 commits intodotnet:mainfrom
AndyAyersMS:WasmCrossgenFixes
Feb 24, 2026
Merged

[Wasm RyuJit] Crossgen fixes#124763
AndyAyersMS merged 10 commits intodotnet:mainfrom
AndyAyersMS:WasmCrossgenFixes

Conversation

@AndyAyersMS
Copy link
Member

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

Copilot AI review requested due to automatic review settings February 23, 2026 19:58
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 23, 2026
@AndyAyersMS
Copy link
Member Author

@kg PTAL
FYI @dotnet/jit-contrib

@SingleAccretion take a look at the changes in regalloc.. there may be more fallout from passing structs as their fields.

@AndyAyersMS AndyAyersMS requested a review from kg February 23, 2026 19:59
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 this pointer 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

Copilot AI review requested due to automatic review settings February 23, 2026 22:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@AndyAyersMS AndyAyersMS enabled auto-merge (squash) February 24, 2026 00:52
@AndyAyersMS AndyAyersMS merged commit 58f1455 into dotnet:main Feb 24, 2026
122 of 128 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants