-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Wasm RyuJit] Fixes for some issues in codegen bringup tests #122483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
|
@dotnet/jit-contrib PTAL |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this 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_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 |
|
@adamperlin can you take a look? |
JulieLeeMSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
adamperlin
left a comment
There was a problem hiding this 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!
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.