-
Notifications
You must be signed in to change notification settings - Fork 49
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
Low effort, precise specialization in tier 2 using lookup tables, replace
and replicate
.
#660
Comments
This will slow down tier 1 though. The last time we tried this on |
If we eliminate the existing specializations of |
I don't expect this to help in tier 1. We should expect a speedup in tier 2. |
Make sense to me. |
This expresses a lot of confidence in the compiler (taking a What would Suppose we'd want to do this for |
The primary motivation for this is
BINARY_OP
, but it can apply toBINARY_SUBSCR
,COMPARE_OP
, andCONTAINS_OP
.The idea is that we add a single tier1 specialization that contains a table lookup. The table is
const
table of function pointers.That is:
We replace
_BINARY_OP_TABLE_LOOKUP
in tier 2 withNote how
_BINARY_OP_INLINE
replacesindex
withoparg
.As
oparg
is a const, the C compiler will (at least it should) eliminate the table lookup.If we declare the relevant function as
inline
, it will be inlined and we end up with an optimal tier 2 uop.The text was updated successfully, but these errors were encountered: