Skip to content

[Wasm RyuJit] codegen for loading a register-sized struct local#126059

Open
AndyAyersMS wants to merge 2 commits intodotnet:mainfrom
AndyAyersMS:WasmCodegen7
Open

[Wasm RyuJit] codegen for loading a register-sized struct local#126059
AndyAyersMS wants to merge 2 commits intodotnet:mainfrom
AndyAyersMS:WasmCodegen7

Conversation

@AndyAyersMS
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 24, 2026 22:32
@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 Mar 24, 2026
@AndyAyersMS
Copy link
Member Author

fyi @dotnet/jit-contrib

Fixes SPC debug assert (2) in #125756 (comment)

We have a struct-typed use feeding an int-typed store:

Compiling [S.P.CoreLib]System.Array.Initialize()
Single method repro args:--singlemethodtypename "System.Array" --singlemethodname "Initialize" --singlemethodindex 1
****** START compiling System.Array:Initialize():this (MethodHash=5b13e318

... (codegen) ...

N002 (???,???) [000010] DA--G+-----                   t10 =    LCL_ADDR  int    V04 loc2         [+0]
N001 (???,???) [000009] -----+-----                    t9 =    LCL_VAR   struct<System.Runtime.CompilerServices.TypeHandle, 4> V17 tmp1         
                                                            /--*  t10    int    
                                                            +--*  t9     struct 
               [000210] sA--G------                         *  STOREIND  int 

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

Updates Wasm RyuJit local variable codegen to correctly load “register-sized” struct locals by using an appropriate memory attribute (emitAttr) when emitting the load.

Changes:

  • Adjusted load emission to derive emitAttr from the register type when the node is TYP_STRUCT
  • Added an assert to catch EA_UNKNOWN attributes before emitting the load

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 25, 2026 00:17
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 1 out of 1 changed files in this pull request and generated no new comments.

@am11 am11 added the arch-wasm WebAssembly architecture label Mar 25, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture 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.

5 participants