Skip to content

JIT: Renable SSA-aware PHI jump threading#127103

Merged
AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS:Fix126976
Apr 20, 2026
Merged

JIT: Renable SSA-aware PHI jump threading#127103
AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS:Fix126976

Conversation

@AndyAyersMS
Copy link
Copy Markdown
Member

Teach redundant branch elimination to keep jump threading through PHI-based blocks when the PHI uses can be fully accounted for in the block and its immediate successors. Rewrite the affected successor SSA/VN uses, keep dominating-block threading conservative, and add focused regression coverage for the new PHI-based cases.

Fix included here that was not in #126812: ensure that field uses of locals get the proper VN updates.

Fixes #126976.

Teach redundant branch elimination to keep jump threading through PHI-based blocks
when the PHI uses can be fully accounted for in the block and its immediate successors.
Rewrite the affected successor SSA/VN uses, keep dominating-block threading conservative,
and add focused regression coverage for the new PHI-based cases.

Fix included here that was not in dotnet#126812: ensure that field uses of locals get
the proper VN updates.

Fixes dotnet#126976.
@AndyAyersMS AndyAyersMS requested review from EgorBo and Copilot April 18, 2026 02:11
@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 Apr 18, 2026
@AndyAyersMS
Copy link
Copy Markdown
Member Author

AndyAyersMS commented Apr 18, 2026

@EgorBo PTAL
fyi @dotnet/jit-contrib

diffs

More or less the same as the initial PR.

@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.

@AndyAyersMS
Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 updates CoreCLR JIT redundant branch elimination (jump threading) to better handle SSA-aware PHI cases by allowing threading when PHI uses can be safely resolved and by keeping SSA/VN state consistent when rewriting those uses.

Changes:

  • Adjust jump-thread viability checks to treat “global PHI uses” as potentially resolvable (rather than an immediate bail-out), enabling PHI-based threading in more cases.
  • Update successor SSA uses during threading and fix VN rewriting for GT_LCL_FLD so field loads get the correct derived field VN from the replacement SSA def.

Comment thread src/coreclr/jit/redundantbranchopts.cpp
Comment thread src/coreclr/jit/redundantbranchopts.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

JIT: fix issue in ssa-aware jump threading

3 participants