-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
GH-138378: Move globals-to-consts pass into main optimizer pass #138379
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
GH-138378: Move globals-to-consts pass into main optimizer pass #138379
Conversation
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.
Very nice improvement!
Include/internal/pycore_optimizer.h
Outdated
// Max stacklen | ||
int stack_len; | ||
int locals_len; | ||
uint32_t globals_checked_version; |
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.
For consistency, this should be placed after the last few fields in the current struct and they should be commented. E.g. // globals to constant promotion
.
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.
Fields should be in either ascending or descending order, for best packing, so I can't just add the fields at the end.
I'll add the comment.
This also fixes #136154.