Skip to content

[Wasm RyuJit] Match how other targets consume initblk fill values#129062

Open
AndyAyersMS wants to merge 1 commit into
dotnet:mainfrom
AndyAyersMS:fix-wasm-initval-leaf-assert-solo
Open

[Wasm RyuJit] Match how other targets consume initblk fill values#129062
AndyAyersMS wants to merge 1 commit into
dotnet:mainfrom
AndyAyersMS:fix-wasm-initval-leaf-assert-solo

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

genConsumeOperands(blkOp) routed the contained GT_INIT_VAL through genConsumeRegs and tripped its OperIsLeaf assert. Replace the call with explicit consume of dest and the unwrapped src, as other targets do.

genConsumeOperands(blkOp) routed the contained GT_INIT_VAL through
genConsumeRegs and tripped its OperIsLeaf assert. Replace the call with
explicit consume of dest and the unwrapped src, as other targets do.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 6, 2026 01:04
@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 Jun 6, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@dotnet/wasm-contrib PTAL
fyi @dotnet/jit-contrib

Fixes some pri0 asserts (case 2 here: #128234 (comment))

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates WASM RyuJIT codegen for GT_STORE_BLK so that when the initblk fill value is wrapped in a contained GT_INIT_VAL, codegen consumes the wrapped value (gtGetOp1()) instead of routing the GT_INIT_VAL wrapper through genConsumeRegs (which asserts on non-leaf contained nodes in codegenlinear.cpp).

Changes:

  • Replace genConsumeOperands(blkOp) with explicit consumption of dest and an unwrapped src when src is a contained GT_INIT_VAL.
  • Add an assertion documenting the invariant that GT_INIT_VAL should be contained in this path.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@kg can you review?

@AndyAyersMS AndyAyersMS requested a review from kg June 8, 2026 23:56

@EgorBo EgorBo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume whatever (memory.fill ?) we actually generate code for is aware that it needs to only use the 0xFF bits of the init value and the rest can be undefined

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