-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[mypyc] Optimize const int regs during pretty IR printing #9181
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
Conversation
the main changes lie in |
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.
Wow, I love to see some many negative lines of code. This makes the test cases much more readable.
Left a few minor comments. It's okay to do the register numbering change in a separate PR, since it will cause a lot of test case changes. (And it's fine to skip it if it turns out to be a lot of work.)
mypyc/test-data/analysis.test
Outdated
x :: int | ||
r1 :: bool | ||
r2, r3, r4 :: native_int | ||
r3 :: native_int |
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.
Unfortunately, this leaves gaps in the register numbering. A relatively easy way to fix this would be to give LoadInt
values different names with independent numbering, such as i0
, i1
, etc., instead of r0
, r1
, and so on. This way we'd just filter out all iX
names, and rX
would remain without gaps.
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.
Thanks for the updates! Looks good.
follow up of #9158, make IR less verbose