-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-115816: Improve internal symbols API in optimizer #116028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9696b67
Reorganize flag bits
gvanrossum cd120a4
Fix top/bottom tests (bottom has all properties off)
gvanrossum ffdf029
Add _Py_uop_sym_set_non_null in various places
gvanrossum 7d44eed
Rename arg of _Py_uop_sym_set_type to typ
gvanrossum ac83bb6
Explain members of Symbol type
gvanrossum c6c7c66
sym_set_type() may result in bottom
gvanrossum 0cda7a8
Add more tests
gvanrossum 5b0c862
Add sym_set_const and its tests
gvanrossum 785bafb
Simplify sym_new signature
gvanrossum 17a8d67
Incorporate assertions into sym_is_bottom()
gvanrossum bc39039
Fix set_bottom name; add sym_set_const macro
gvanrossum c355bc6
Simplification and decrefs from code review
gvanrossum 5362360
Merge remote-tracking branch 'origin/main' into new-symbols
gvanrossum 761d2b1
Declare val_42/43 earlier.
gvanrossum b0509ce
Fix bug -- if sym->typ is NULL, don't cry bottom
gvanrossum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Fix bug -- if sym->typ is NULL, don't cry bottom
- Loading branch information
commit b0509ce79405748556b78946a4c81f235dd91c03
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be simplified to
as Py_TYPE(const_val) cannot be NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see this was a bug I introduced. Sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out this "fix" was wrong -- we're not checking whether
typis NULL, we're checking whethersym->typisn't NULL. If it's NULL, setting the constant should be allowed. Running the tests with PYTHONUOPSOPTIMIZE=1 revealed this. :-)