Skip to content

[release/11.0] JIT: Fix promoted liveness in forward substitution - #134349

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

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

Conversation

@github-actions

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

Copy link
Copy Markdown
Contributor

Backport of #133703 to release/11.0

/cc @AndyAyersMS

Customer Impact

  • Customer reported
  • Found internally

Forward substitution can leave stale last-use flags on promoted struct parents and remove a live struct copy. The reported case returns 6 instead of the correct value 8. This reproduces on .NET 11 RC2; .NET 8, 9, and 10 are correct. See #133641.

Regression

  • Yes
  • No

Introduced during the .NET 11 cycle by #129312.

Testing

Added a focused regression test that exercises multi-use forward substitution of a promoted struct and verifies that the defining copy remains live. The source PR was validated through JIT CI and SuperPMI analysis; only a small number of expected code-generation differences were observed.

Risk

Low. The fix makes last-use invalidation promotion-aware and reuses the same logic for single- and multi-use substitution. It preserves liveness conservatively rather than enabling a new optimization.

Multi-use forward substitution could leave stale last-use flags on
promoted struct parents, allowing a live struct copy to be removed.

Make last-use invalidation promotion-aware and reuse the same logic for
single- and multi-use substitution. Add a regression test.

Fixes #133641

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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:55
@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 are #117138 and #132147 (fixed in main, not backported)

@JulieLeeMSFT
JulieLeeMSFT merged commit 0095777 into release/11.0 Sep 21, 2026
125 of 131 checks passed
@JulieLeeMSFT
JulieLeeMSFT deleted the backport/pr-133703-to-release/11.0 branch September 21, 2026 21:48
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 Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants