GH-115457: Support splitting and replication of micro ops. (GH-115558)

This commit is contained in:
Mark Shannon 2024-02-20 10:50:59 +00:00 committed by GitHub
parent 7b21403ccd
commit 626c414995
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 918 additions and 319 deletions

View file

@ -963,6 +963,21 @@ uop_optimize(
}
}
assert(err == 1);
/* Fix up */
for (int pc = 0; pc < UOP_MAX_TRACE_LENGTH; pc++) {
int opcode = buffer[pc].opcode;
int oparg = buffer[pc].oparg;
if (_PyUop_Flags[opcode] & HAS_OPARG_AND_1_FLAG) {
buffer[pc].opcode = opcode + 1 + (oparg & 1);
}
else if (oparg < _PyUop_Replication[opcode]) {
buffer[pc].opcode = opcode + oparg + 1;
}
else if (opcode == _JUMP_TO_TOP || opcode == _EXIT_TRACE) {
break;
}
assert(_PyOpcode_uop_name[buffer[pc].opcode]);
}
_PyExecutorObject *executor = make_executor_from_uops(buffer, &dependencies);
if (executor == NULL) {
return -1;