-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[mypyc] Expand int ops when operation contains at least one tagged int #9187
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
I'll do the IR test updates once const_int has been applied to pretty IR printing, to reduce conflicts. |
should we remove |
Yeah, we should remove them from CPy.h, since they are no longer used. However, we should consider updating the tests to use the alternative functions with an underscore suffix. |
then it would make more sense we remove them and update the C++ tests after all merges in the python end have completed. |
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.
Looks good! Left one comment about how to make the generated code smaller (in a separate PR).
r3 = 10 & 1 | ||
r4 = r3 == 0 | ||
r5 = r2 & r4 | ||
if r5 goto L2 else goto L3 :: bool |
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.
Not directly related to this diff: we could simplify this sequence of ops like this:
r1 = n | 10
r2 = r1 & 1
r3 = r2 == 0
if r3 goto ...
Follow-up of #9108 and #9127, generates the new inlined style ops when there is at least one tagged integer presented(The previous two PRs actually specialized two ints and two short_ints cases). After this and the remaining merge, we will get rid of
CPyTagged_IsEq
,CPyTagged_IsNe
,CPyTagged_IsLt
,CPyTagged_IsLe
,CPyTagged_IsGt
andCPyTagged_IsGe