Skip to content

Conversation

@AndyAyersMS
Copy link
Member

The strategy for marking blocks that need labels was wrong. We need to mark block ends when we encounter block starts. To do this efficiently we need to map from interval end index to block, so expose the map we built during interval building for use in codegen.

We likely don't need Just My Code debug support for Wasm, so ignore any request from the runtime to insert the checks.

Wasm structured control flow doesn't allow us to keep blocks in increasing IL offset order (in general). So disable some of the scope tracking mechanisms that expect to see this.

Fix another instance where we assumed a 32 bit target would decompose longs.

The strategy for marking blocks that need labels was wrong. We need to
mark block ends when we encounter block starts. To do this efficiently
we need to map from interval end index to block, so expose the map we
built during interval building for use in codegen.

We likely don't need Just My Code debug support for Wasm, so ignore any
request from the runtime to insert the checks.

Wasm structured control flow doesn't allow us to keep blocks in increasing
IL offset order (in general). So disable some of the scope tracking mechanisms
that expect to see this.

Fix another instance where we assumed a 32 bit target would decompose longs.
Copilot AI review requested due to automatic review settings December 12, 2025 06:00
@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 Dec 12, 2025
@AndyAyersMS AndyAyersMS added the arch-wasm WebAssembly architecture label Dec 12, 2025
@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 addresses several issues in the WebAssembly RyuJIT codegen bringup tests. The changes fix incorrect assumptions about block labeling strategy, disable unsupported Just My Code debug checks, work around scope tracking incompatibilities, and correct long decomposition detection for 32-bit WASM targets.

Key changes:

  • Fixed the block labeling strategy to mark interval end blocks instead of just loop headers, enabling proper Wasm structured control flow
  • Disabled Just My Code debug support for Wasm since it's not needed
  • Updated long decomposition check to use LOWER_DECOMPOSE_LONGS macro instead of TARGET_64BIT, correctly handling 32-bit Wasm

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/scopeinfo.cpp Early return for Wasm to disable scope tracking that expects blocks in IL offset order
src/coreclr/jit/lower.cpp Changed from TARGET_64BIT to LOWER_DECOMPOSE_LONGS to correctly determine when to decompose long comparisons for Wasm
src/coreclr/jit/flowgraph.cpp Disabled Just My Code handle retrieval for Wasm targets
src/coreclr/jit/fgwasm.cpp Published the index-to-block map for use during codegen
src/coreclr/jit/compiler.h Added fgIndexToBlockMap field to store the block mapping
src/coreclr/jit/codegenwasm.cpp Fixed block labeling to mark interval end blocks when starting intervals, not when ending them

@AndyAyersMS
Copy link
Member Author

@adamperlin can you take a look?

Copy link
Member

@JulieLeeMSFT JulieLeeMSFT left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

This looks good to me!

@AndyAyersMS AndyAyersMS merged commit 9c03d9c into dotnet:main Dec 13, 2025
131 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants