-
Notifications
You must be signed in to change notification settings - Fork 50
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
Conditional macro-op expansion? #595
Comments
Tentative decision reached offline: expand uops with conditional stack effects in the generator. Currently the generator disallows conditional stack effects in uops (it fails an But for the superblock generator we need to generate two separate uops, let's give them The failing |
This is done. Conditional output stack effects in the last op composing a macro are now supported. |
In #592 (and python/cpython#104909) we're trying to split bytecode ops into micro ops (uops) with the constraint of one "data item" per uop, where a data item is either
oparg
or a cache item.This runs into some issues with conditional stack effects. For example, take the specializations for
LOAD_GLOBAL
(LOAD_GLOBAL_MODULE
andLOAD_GLOBAL_BUILTIN
) and forLOAD_ATTR
(e.g.LOAD_ATTR_INSTANCE_VALUE
). These opcodes must end in something that pushes either aNULL
and a result, or just a result, depending on the low bit ofoparg
. But the result being pushed also depends on a cached value. We also can't push theNULL
before the lastDEOPT_IF
orERROR_IF
call.Maybe we can add the conditionality to the macro itself, e.g.
Here
B
would be the uop that pushesNULL
.Or maybe the
null if (oparg & 1)
phrasing of the output stack effect in the uop definition is enough?For reference:
LOAD_GLOBAL
: https://github.com/python/cpython/compare/main...faster-cpython:cpython:split-load-global?expand=1LOAD_ATTR
: https://github.com/python/cpython/compare/main...faster-cpython:cpython:split-load-attr?expand=1#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342R1787The text was updated successfully, but these errors were encountered: