mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-135379: Support limited scalar replacement for replicated uops in the JIT code generator. (GH-135563)
* Use it to support efficient specializations of COPY and SWAP in the JIT.
This commit is contained in:
parent
a9e66a7c50
commit
8dd8b5c2f0
9 changed files with 313 additions and 198 deletions
|
@ -4946,8 +4946,7 @@ dummy_func(
|
|||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
}
|
||||
|
||||
pure inst(COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
|
||||
assert(oparg > 0);
|
||||
pure replicate(1:4) inst(COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
|
||||
top = PyStackRef_DUP(bottom);
|
||||
}
|
||||
|
||||
|
@ -4980,12 +4979,11 @@ dummy_func(
|
|||
|
||||
macro(BINARY_OP) = _SPECIALIZE_BINARY_OP + unused/4 + _BINARY_OP;
|
||||
|
||||
pure inst(SWAP, (bottom, unused[oparg-2], top --
|
||||
pure replicate(2:4) inst(SWAP, (bottom, unused[oparg-2], top --
|
||||
bottom, unused[oparg-2], top)) {
|
||||
_PyStackRef temp = bottom;
|
||||
bottom = top;
|
||||
top = temp;
|
||||
assert(oparg >= 2);
|
||||
}
|
||||
|
||||
inst(INSTRUMENTED_LINE, ( -- )) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue