Skip to content

[release/11.0] JIT: validate RBO relop rewrite operands - #134347

Merged
JulieLeeMSFT merged 1 commit into
release/11.0from
backport/pr-133621-to-release/11.0
Sep 21, 2026
Merged

JulieLeeMSFT merged 1 commit into
release/11.0from
backport/pr-133621-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #133621 to release/11.0

/cc @AndyAyersMS

Customer Impact

  • Customer reported
  • Found internally

The JIT can rewrite a materialized Boolean predicate using value-number operands that do not correspond to the actual tree operands, producing wrong code. The reported case returns 0 unconditionally when the correct result is 1. This reproduces on .NET 11 RC2; .NET 8, 9, and 10 are correct. See #133558.

Regression

  • Yes
  • No

Introduced during the .NET 11 cycle by the redundant-branch relop simplification added in #127181.

Testing

Added regression coverage for materialized predicates in both relational directions. All 35 JIT.opt RedundantBranchSimplify tests passed. Windows x64 Checked SuperPMI produced no assembly differences in 987,559 successful compilations, with 908 identical misses.

Risk

Low. The change adds a validation check before performing the existing rewrite. When the value-number operands do not match the concrete tree operands, the JIT conservatively skips the optimization. SuperPMI found no code-generation changes outside the new regression cases.

Ensure dominating RBO only rewrites the remaining predicate when the VN
relop operands match the concrete tree operands.

Add coverage for materialized predicates in both relational directions.

Fixes #133558.

Validation:
- `JIT.opt` `RedundantBranchSimplify`: 35 passed
- SuperPMI: no asm diffs in 987,559 Windows x64 Checked contexts; 908
identical misses

> [!NOTE]
> This PR description was generated with GitHub Copilot CLI.

Co-authored-by: Copilot <[email protected]>
@azure-pipelines

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

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

@AndyAyersMS
AndyAyersMS requested a review from a team September 21, 2026 18:54
@AndyAyersMS

Copy link
Copy Markdown
Member

@dotnet/jit-contrib ptal

@AndyAyersMS AndyAyersMS added the Servicing-consider Issue for next servicing release review label Sep 21, 2026
@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 21, 2026
@JulieLeeMSFT JulieLeeMSFT added this to the 11.0.0 milestone Sep 21, 2026
@AndyAyersMS

Copy link
Copy Markdown
Member

/ba-g failures is #117138

@JulieLeeMSFT
JulieLeeMSFT merged commit 0a5d69e into release/11.0 Sep 21, 2026
125 of 131 checks passed
@JulieLeeMSFT
JulieLeeMSFT deleted the backport/pr-133621-to-release/11.0 branch September 21, 2026 21:48
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants