mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
|
@ -1292,8 +1292,8 @@ uop_optimize(
|
|||
for (int pc = 0; pc < length; pc++) {
|
||||
int opcode = buffer[pc].opcode;
|
||||
int oparg = buffer[pc].oparg;
|
||||
if (oparg < _PyUop_Replication[opcode]) {
|
||||
buffer[pc].opcode = opcode + oparg + 1;
|
||||
if (oparg < _PyUop_Replication[opcode].stop && oparg >= _PyUop_Replication[opcode].start) {
|
||||
buffer[pc].opcode = opcode + oparg + 1 - _PyUop_Replication[opcode].start;
|
||||
assert(strncmp(_PyOpcode_uop_name[buffer[pc].opcode], _PyOpcode_uop_name[opcode], strlen(_PyOpcode_uop_name[opcode])) == 0);
|
||||
}
|
||||
else if (is_terminator(&buffer[pc])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue