JIT/wasm: keep unreachable in-try blocks attached to their try entry#129716
JIT/wasm: keep unreachable in-try blocks attached to their try entry#129716AndyAyersMS wants to merge 2 commits into
Conversation
Inject unreachable in-try blocks as successors of the try entry in VisitWasmSuccs so the wasm DFS visits them and the layout pass keeps them inside the try region; otherwise they end up past fgFirstFuncletBB and break EH-contiguity (b27824). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
Yet another wasm control flow fix (hopefully the last of these, barring async). We may have unreachable blocks in a try (say inner trys). We need to place these properly for wasm. Pretend they are reachable from the enclosing try entry (like we do for throw helpers). @adamperlin PTAL With this all the Pri-1 tests under JIT pass for me (or are properly skipped) when the test assemblies are built R2R. |
There was a problem hiding this comment.
Pull request overview
This PR updates the WASM-specific successor enumeration used by the JIT’s DFS/layout machinery so that certain “unreachable” blocks inside a try region (notably, blocks with no recorded predecessors) are still discovered during WASM DFS. This helps keep those blocks laid out within their try region to preserve EH contiguity.
Changes:
- Extend
FgWasm::VisitWasmSuccsto additionally visit unreachable in-try blocks as successors of the try entry. - Filter injected blocks to avoid throw helpers and blocks not in the same EH region as the try entry.
Move the per-try-entry scan from FgWasm::VisitWasmSuccs to FlowGraphTryRegions::Build, which now populates a vector of in-try blocks that won't be reached by the DFS. The wasm successor enumerator just walks that vector. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
I have another EH fix I'm working on that I'll add here shortly. |
Inject unreachable in-try blocks as successors of the try entry in VisitWasmSuccs so the wasm DFS visits them and the layout pass keeps them inside the try region; otherwise they end up past fgFirstFuncletBB and break EH-contiguity (b27824).