gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059)

This enables super-instruction formation,
removal of checks for uninitialized variables,
and frees up an instruction.
This commit is contained in:
hms 2023-06-29 10:34:00 -06:00 committed by GitHub
parent 3c70d467c1
commit 8bff940ad6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 733 additions and 702 deletions

View file

@ -2002,6 +2002,10 @@ _PyCfg_ConvertPseudoOps(basicblock *entryblock)
assert(SAME_OPCODE_METADATA(instr->i_opcode, NOP));
INSTR_SET_OP0(instr, NOP);
}
else if (instr->i_opcode == LOAD_CLOSURE) {
assert(SAME_OPCODE_METADATA(LOAD_CLOSURE, LOAD_FAST));
instr->i_opcode = LOAD_FAST;
}
else if (instr->i_opcode == STORE_FAST_MAYBE_NULL) {
assert(SAME_OPCODE_METADATA(STORE_FAST_MAYBE_NULL, STORE_FAST));
instr->i_opcode = STORE_FAST;