gh-120619: Tier 2 partial evaluator foundations#124910
Closed
Fidget-Spinner wants to merge 54 commits intopython:mainfrom
Closed
gh-120619: Tier 2 partial evaluator foundations#124910Fidget-Spinner wants to merge 54 commits intopython:mainfrom
Fidget-Spinner wants to merge 54 commits intopython:mainfrom
Conversation
This reverts commit 4361821.
Member
Author
|
@markshannon I split it out into its own files, and own symbols, so it doesn't share the type information too. This simplifies the lattice quite a bit. |
Eclips4
reviewed
Jan 15, 2025
Eclips4
reviewed
Jan 15, 2025
Comment on lines
+306
to
+308
| if (length <= 0) { | ||
| return length; | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| if (length <= 0) { | |
| return length; | |
| } |
We'll anyway return length in line 310
Eclips4
reviewed
Jan 15, 2025
| @@ -0,0 +1,303 @@ | |||
| """Generate the cases for the tier 2 partial evaluator. | |||
| Reads the instruction definitions from bytecodes.c, optimizer_bytecodes.c and partial_evaluator_bytecodes.c | |||
| Writes the cases to partial_evaluator_cases.c.h, which is #included in Python/optimizer_analysis.c. | |||
Member
There was a problem hiding this comment.
Suggested change
| Writes the cases to partial_evaluator_cases.c.h, which is #included in Python/optimizer_analysis.c. | |
| Writes the cases to partial_evaluator_cases.c.h, which is #included in Python/partial_evaluator.c. |
Member
Author
|
I have a different approach in mind. |
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.
This PR sets up a tier 2 partial evaluation pass' foundations. It does the following:
As a litmus test, it does simple dead store elimination by tracking locals. For example, the code
x = xis now optimized to a nop.This is different than the previous PR at #123652. The main difference is that we create the residual in-place. By "looking backwards" at the originating instruction and marking that as virtual/non-virtual. If you want a visualization of how this will work. See Mark's talk at EuroPython 2023 here https://youtu.be/dgrtgtT-UXM?t=1198.
Also up for discussion: the generator for the partial evaluator is exactly the same as the specializer. Should I just remove it?