-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[mypyc] Generates inline compare statement on short ints and fix sieve performance regression #9127
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
IR test changes are a bit of messy because the integer < got expanded. To see the change in list for, check This should also fix the |
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 fixing the regression! We'll see whether it's all gone after the nightly benchmark runs. Looks good, just a few minor comments.
mypyc/primitives/int_ops.py
Outdated
int_less_than_ = c_custom_op( | ||
arg_types=[int_rprimitive, int_rprimitive], | ||
return_type=bool_rprimitive, | ||
c_function_name='CPyTagged_IsLt', |
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.
Should this have a _
suffix?
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.
yeah, it definitely should! Thanks for catching this potentially costly bug!
#9187) Follow-up of #9108 and #9127, generates the new inlined style ops when there is at least one tagged integer present (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` and `CPyTagged_IsGe`.
relates mypyc/mypyc#750
Generate almost identical code as before be01236
before:
now with this PR: