GH-131729: Code-gen better liveness analysis#131732
Merged
markshannon merged 12 commits intopython:mainfrom Mar 26, 2025
Merged
GH-131729: Code-gen better liveness analysis#131732markshannon merged 12 commits intopython:mainfrom
markshannon merged 12 commits intopython:mainfrom
Conversation
iritkatriel
approved these changes
Mar 26, 2025
| stack_pointer = _PyFrame_GetStackPointer(frame); | ||
| stack_pointer[-1] = b; | ||
| } | ||
| stack_pointer[-1] = b; |
Member
There was a problem hiding this comment.
@markshannon, this change seems incorrect. b is never written to the stack if we take the first conditional (where value is None and b is True). I suspect there might be other places where reasoning about both arms of a conditional is broken in a similar way.
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this pull request
Apr 1, 2025
* Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used * Make death of variables explicit even for array variables. * Convert in_memory from boolean to stack offset * Don't apply liveness analysis to optimizer generated code * Fix RETURN_VALUE in optimizer
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.
Also fixes #131695
This PR improves the liveness analysis of the code generator, reducing the number of redundant stores and giving more precise errors.