Skip to content

GH-105229: Remove remaining two-codeunit superinstructions #105326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Include/internal/pycore_opcode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Include/internal/pycore_opcode_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ extern "C" {
(opcode) == RAISE_VARARGS || \
(opcode) == RERAISE)

#define IS_SUPERINSTRUCTION_OPCODE(opcode) \
((opcode) == LOAD_FAST__LOAD_CONST || \
(opcode) == LOAD_CONST__LOAD_FAST)


#define LOG_BITS_PER_INT 5
#define MASK_LOW_LOG_BITS 31

Expand Down
24 changes: 11 additions & 13 deletions Include/opcode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Lib/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,6 @@ def pseudo_op(name, op, real_ops):
"LOAD_ATTR_METHOD_NO_DICT",
"LOAD_ATTR_METHOD_WITH_VALUES",
],
"LOAD_CONST": [
"LOAD_CONST__LOAD_FAST",
],
"LOAD_FAST": [
"LOAD_FAST__LOAD_CONST",
],
"LOAD_GLOBAL": [
"LOAD_GLOBAL_BUILTIN",
"LOAD_GLOBAL_MODULE",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Remove remaining two-codeunit superinstructions. All remaining
superinstructions only take a single codeunit, simplifying instrumentation
and quickening.
3 changes: 0 additions & 3 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ dummy_func(
SETLOCAL(oparg2, value2);
}

super(LOAD_FAST__LOAD_CONST) = LOAD_FAST + LOAD_CONST;
super(LOAD_CONST__LOAD_FAST) = LOAD_CONST + LOAD_FAST;

inst(POP_TOP, (value --)) {
DECREF_INPUTS();
}
Expand Down
2 changes: 0 additions & 2 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,6 @@ scan_block_for_locals(basicblock *b, basicblock ***sp)
for (int i = 0; i < b->b_iused; i++) {
cfg_instr *instr = &b->b_instr[i];
assert(instr->i_opcode != EXTENDED_ARG);
assert(!IS_SUPERINSTRUCTION_OPCODE(instr->i_opcode));
if (instr->i_except != NULL) {
maybe_push(instr->i_except, unsafe_mask, sp);
}
Expand Down Expand Up @@ -1722,7 +1721,6 @@ fast_scan_many_locals(basicblock *entryblock, int nlocals)
for (int i = 0; i < b->b_iused; i++) {
cfg_instr *instr = &b->b_instr[i];
assert(instr->i_opcode != EXTENDED_ARG);
assert(!IS_SUPERINSTRUCTION_OPCODE(instr->i_opcode));
int arg = instr->i_oparg;
if (arg < 64) {
continue;
Expand Down
Loading