JIT: Further liveness cleanups#123999
Merged
jakobbotsch merged 5 commits intodotnet:mainfrom Feb 5, 2026
Merged
Conversation
jakobbotsch
commented
Feb 4, 2026
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
jakobbotsch
commented
Feb 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the JIT liveness analysis code to improve code organization and maintainability. The main goal is to separate different liveness phases into distinct functions and consolidate related functionality.
Changes:
- Replaced runtime check
fgIsDoingEarlyLivenesswith compile-time template parameterIsEarly - Moved
fgLocalVarLivenessChangedinto theLivenessclass asm_livenessChanged - Renamed private member fields in
Livenessclass fromfgCur*prefix tom_cur*prefix for consistency - Removed the
LiveVarAnalysisclass and merged its functionality into theLivenessclass - Removed unnecessary optimization level checks (
opts.MinOpts()) since liveness only runs when optimizations are enabled - Split the generic
fgLocalVarLiveness()into separate specialized functions:fgSsaLiveness(),fgAsyncLiveness(),fgPostLowerLiveness()
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/liveness.cpp | Main refactoring: field renames, template parameter addition, class consolidation, optimization check removal, new specialized liveness functions |
| src/coreclr/jit/compiler.h | Updated function declarations, removed obsolete fields fgLocalVarLivenessChanged and fgIsDoingEarlyLiveness |
| src/coreclr/jit/ssabuilder.cpp | Updated call from fgLocalVarLiveness() to fgSsaLiveness() |
| src/coreclr/jit/lower.cpp | Updated calls from fgLocalVarLiveness() to fgPostLowerLiveness() |
| src/coreclr/jit/compiler.cpp | Updated call from fgLocalVarLiveness() to fgSsaLiveness() |
| src/coreclr/jit/async.cpp | Updated call from fgLocalVarLiveness() to fgAsyncLiveness() |
Member
Author
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS No asm diffs, some throughput diffs (mostly improvements). |
AndyAyersMS
approved these changes
Feb 4, 2026
This was referenced Feb 4, 2026
Open
lewing
pushed a commit
to lewing/runtime
that referenced
this pull request
Feb 9, 2026
- Give each liveness phase its own separate function - Remove `Compiler::fgIsDoingEarlyLiveness` in favor of a new config option in `Liveness` - Move `fgLocalVarLivenessChanged` into `Liveness` - Rename some fields in `Liveness` - Remove optimization level checks in liveness since we only run liveness when optimizing and have done so for a while - Remove the `LiveVarAnalysis` class and merge it into the `Liveness` class No diffs expected. The last change here (removing `LiveVarAnalysis`) has some TP regressions on MSVC, once again related to inlining decisions.
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.
Compiler::fgIsDoingEarlyLivenessin favor of a new config option inLivenessfgLocalVarLivenessChangedintoLivenessLivenessLiveVarAnalysisclass and merge it into theLivenessclassNo diffs expected. The last change here (removing
LiveVarAnalysis) has some TP regressions on MSVC, once again related to inlining decisions.