JIT/wasm: place SCC dispatcher inside Wasm try region when needed#129025
Open
AndyAyersMS wants to merge 1 commit into
Open
JIT/wasm: place SCC dispatcher inside Wasm try region when needed#129025AndyAyersMS wants to merge 1 commit into
AndyAyersMS wants to merge 1 commit into
Conversation
If an SCC header is a Wasm try entry, the SCC dispatcher must be placed inside that try region. Handle this case. If a different SCC header is in a sibling or deeper-nested try, we cannot yet handle the flow transformation needed; flag this with NYI_WASM for now. Fixes some cases in dotnet#128234. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@dotnet/wasm-contrib PTAL These came up doing some more extensive testing of R2R'd pri0 tests. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Wasm SCC (irreducible-loop) “switch dispatcher” transformation to respect EH/try-region entry rules by placing the dispatcher inside a Wasm try region when an SCC entry header is also the try entry block. It also adds an explicit NYI_WASM guard for cases where another SCC entry header lives in a sibling or deeper-nested try region that would require a more complex flow transformation.
Changes:
- When an SCC header is a Wasm try entry, create the dispatcher block in that try region (and place it near the try header) so the dispatcher’s outgoing edges don’t create “middle-entry” edges into the try.
- Route inbound flow through the Wasm try header when a dispatcher is placed inside the try, and add an
NYI_WASMcheck for unsupported SCC header try-nesting relationships. - Improve debug dumps to report the dispatcher’s chosen EH region (try vs handler vs method).
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If an SCC header is a Wasm try entry, the SCC dispatcher must be placed inside that try region. Handle this case. If a different SCC header is in a sibling or deeper-nested try, we cannot yet handle the flow transformation needed; flag this with NYI_WASM for now.
Fixes some cases in #128234.