Skip to content

Fix Wasm SCC dispatcher predecessor rewrites - #133136

Merged
lewing merged 4 commits into
mainfrom
fix-133120-test-execution
Sep 4, 2026
Merged

Fix Wasm SCC dispatcher predecessor rewrites#133136
lewing merged 4 commits into
mainfrom
fix-133120-test-execution

Conversation

@lewing

@lewing lewing commented Sep 3, 2026

Copy link
Copy Markdown
Member

Fixes the remaining Wasm SCC dispatch failure exposed by #133120.

This is stacked on #133132 and should be retargeted to main after that PR merges.

When TransformViaSwitchDispatch processed SCC entry headers one at a time, redirects made transfer blocks for an earlier header become live predecessors of a later try header. The later iteration processed those blocks again and appended another control-variable store, overwriting the original dispatch case.

Snapshot the original predecessor set before any rewrites, and ignore original edges that an earlier header transformation has intentionally removed. This preserves each transfer block's selected SCC entry.

The regression test is process-isolated on browser-wasm so its AlwaysUseCrossGen2 setting is exercised rather than being lost through the merged regression runner.

Validation:

  • ./build.sh clr -c Checked -os browser -a wasm
  • browser-wasm Checked build of Runtime_133120
  • Runtime_133120.sh: expected 100, actual 100
  • focused MoveNext JIT dump confirms the SCC transfer blocks receive one control-variable assignment each

Note

This pull request description was generated with GitHub Copilot.

AndyAyersMS and others added 2 commits September 2, 2026 15:02
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Snapshot SCC header predecessors before redirecting entry edges so newly created transfer blocks are not processed again for a later header.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: db8401cb-c388-4481-a625-34811ab8a269
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@lewing
lewing requested a review from AndyAyersMS September 3, 2026 00:47
@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 Sep 3, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@lewing
lewing marked this pull request as ready for review September 3, 2026 01:30
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Sep 3, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@lewing
lewing changed the base branch from fix/133120-wasm-scc-profile to main September 3, 2026 16:55
@lewing

lewing commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

#133134 turns on the merged runner for the wasm r2r tests, I'll update one or the other depending on the merge sequence

Removed AlwaysUseCrossGen2 and RequiresProcessIsolation properties from the project file.
Copilot AI lite review requested due to automatic review settings September 3, 2026 18:37
@lewing

lewing commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@AndyAyersMS I've removed the process isolation now so it will need reapproval when you get a chance

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The regression test project change likely undermines exercising the intended browser-wasm crossgen2 path and can lead to a silent false-pass.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adjusts the CoreCLR Wasm SCC switch-dispatch transformation to avoid reprocessing predecessor edges that become newly live due to earlier header rewrites, helping preserve the intended per-entry dispatch selection. It also changes the Runtime_133120 regression test project configuration for browser-wasm.

Changes:

  • Snapshot SCC entry-header predecessor blocks before any edge rewrites, and skip predecessor entries that were removed by earlier header processing.
  • Remove AlwaysUseCrossGen2 from the Runtime_133120 test project.
File summaries
File Description
src/coreclr/jit/fgwasm.cpp Snapshots original predecessor sets for SCC entry headers and avoids re-transforming newly created predecessor edges during switch-dispatch rewriting.
src/tests/JIT/Regression/JitBlue/Runtime_133120/Runtime_133120.csproj Removes the browser-only AlwaysUseCrossGen2 setting from the regression test project.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

@lewing

lewing commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

/ba-g failures are prexisting and unrelated

@lewing
lewing merged commit 134de00 into main Sep 4, 2026
141 of 144 checks passed
@lewing
lewing deleted the fix-133120-test-execution branch September 4, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.

5 participants