[Wasm RyuJit] Fixes for some issues in codegen bringup tests#122483
Merged
AndyAyersMS merged 1 commit intodotnet:mainfrom Dec 13, 2025
Merged
[Wasm RyuJit] Fixes for some issues in codegen bringup tests#122483AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS merged 1 commit intodotnet:mainfrom
Conversation
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.
Member
Author
|
@dotnet/jit-contrib PTAL |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
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_LONGSmacro instead ofTARGET_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 |
Member
Author
|
@adamperlin can you take a look? |
SingleAccretion
approved these changes
Dec 12, 2025
adamperlin
approved these changes
Dec 13, 2025
Contributor
adamperlin
left a comment
There was a problem hiding this comment.
This looks good to me!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.