Skip to content

JIT: Reset last-use flag for live defs in liveness - #121553

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-121552
Nov 13, 2025
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-121552

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Nov 12, 2025 •

Copy link
Copy Markdown
Member

We would leave GTF_VAR_DEATH set if it had already been set on the node from a previous run of liveness.

In the issue that resulted in TreeLifeUpdater computing the wrong liveness set resulting in us not saving a live local around a suspension.

Fix #121552

We would leave `GTF_VAR_DEATH` set if it had already been set on the
node from a previous run of liveness.
Copilot AI review requested due to automatic review settings November 12, 2025 15:13
@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 Nov 12, 2025
@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.

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.

Pull Request Overview

This PR fixes issue #121552 by ensuring the GTF_VAR_DEATH flag is properly reset during liveness analysis when it may run multiple times. The fix addresses a case where the flag could remain set from a previous liveness analysis run, leading to incorrect behavior.

Key Changes:

  • Added code to clear GTF_VAR_DEATH flag in fgComputeLifeTrackedLocalDef when a variable is determined to be live
  • This mirrors the existing pattern already present in the companion function fgComputeLifeTrackedLocalUse

Comment thread src/coreclr/jit/liveness.cpp Resolved
@jakobbotsch

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib. We have this kind of flag clearing in other places in liveness, but looks like this place missed it.

@jakobbotsch
jakobbotsch requested a review from a team November 12, 2025 17:16
@jakobbotsch

Copy link
Copy Markdown
Member Author

/ba-g Timeouts

@jakobbotsch
jakobbotsch merged commit 2e20682 into dotnet:main Nov 13, 2025
@jakobbotsch
jakobbotsch deleted the fix-121552 branch November 13, 2025 12:49
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 14, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: Bad codegen with runtime async

3 participants