Skip to content

Conversation

@AndyAyersMS
Copy link
Member

We were dropping the type field.

Copilot AI review requested due to automatic review settings January 23, 2026 02:22
@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib PTAL

@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 Jan 23, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
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 WebAssembly RyuJIT emission for structured control-flow instructions so that the required block type byte is emitted for block/loop.

Changes:

  • Add a dedicated emitter::emitIns_B helper that records the IF_BLOCK instruction format for wasm block-like instructions.
  • Route wasm INS_block and INS_loop emission in genEmitStartBlock through emitIns_B instead of the generic instGen, ensuring the block type byte is written.
  • Keep label emission via emitIns_J and IF_RAW_ULEB128 unchanged, maintaining correct encoding for br_table labels.

Reviewed changes

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

File Description
src/coreclr/jit/emitwasm.h Declares the new emitIns_B entry point on the emitter for wasm block-style instructions.
src/coreclr/jit/emitwasm.cpp Implements emitIns_B to use IF_BLOCK, which in turn causes the encoder to output the extra block-type byte (currently fixed as void).
src/coreclr/jit/codegenwasm.cpp Updates genEmitStartBlock to emit INS_block/INS_loop via emitIns_B, fixing the previously missing type field on these wasm control-flow instructions.

Copy link
Contributor

@adamperlin adamperlin left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@AndyAyersMS AndyAyersMS merged commit e2298d5 into dotnet:main Jan 23, 2026
123 of 125 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