aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/flowgraph.c
diff options
context:
space:
mode:
authorhms <18321626+polynomialherder@users.noreply.github.com>2023-06-29 10:34:00 -0600
committerGitHub <noreply@github.com>2023-06-29 09:34:00 -0700
commit8bff940ad69ce176dcd2b8e91d0b30ddd09945f1 (patch)
tree1ecf331f5376e764b28a82fdddb33f99a3dee6df /Python/flowgraph.c
parent3c70d467c148875f2ce17bacab8909ecc3e9fc1d (diff)
downloadcpython-8bff940ad69ce176dcd2b8e91d0b30ddd09945f1.tar.gz
cpython-8bff940ad69ce176dcd2b8e91d0b30ddd09945f1.zip
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.
Diffstat (limited to 'Python/flowgraph.c')
-rw-r--r--Python/flowgraph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index a6b2a9f275a..d78fb92e0d6 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -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;