JIT: Renable SSA-aware PHI jump threading#127103
Merged
AndyAyersMS merged 1 commit intodotnet:mainfrom Apr 20, 2026
Merged
Conversation
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.
Member
Author
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
Author
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
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_FLDso field loads get the correct derived field VN from the replacement SSA def.
EgorBo
approved these changes
Apr 20, 2026
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.
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.