summaryrefslogtreecommitdiffstats
path: root/Python/flowgraph.c
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2025-01-23 09:26:25 (GMT)
committerGitHub <noreply@github.com>2025-01-23 09:26:25 (GMT)
commita10f99375e7912df863cf101a38e9703cfcd72f1 (patch)
tree7909c7896fe256427c1149d2416fb7912ad3ba48 /Python/flowgraph.c
parentd7d066c3ab6842117f9e0fb1c9dde4bce00fa1e3 (diff)
downloadcpython-a10f99375e7912df863cf101a38e9703cfcd72f1.zip
cpython-a10f99375e7912df863cf101a38e9703cfcd72f1.tar.gz
cpython-a10f99375e7912df863cf101a38e9703cfcd72f1.tar.bz2
Revert "GH-128914: Remove conditional stack effects from `bytecodes.c` and the code generators (GH-128918)" (GH-129202)
The commit introduced a ~2.5-3% regression in the free threading build. This reverts commit ab61d3f4303d14a413bc9ae6557c730ffdf7579e.
Diffstat (limited to 'Python/flowgraph.c')
-rw-r--r--Python/flowgraph.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index 3f8d9db..24561c1 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -1836,6 +1836,12 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
INSTR_SET_OP0(inst, NOP);
}
break;
+ case LOAD_GLOBAL:
+ if (nextop == PUSH_NULL && (oparg & 1) == 0) {
+ INSTR_SET_OP1(inst, LOAD_GLOBAL, oparg | 1);
+ INSTR_SET_OP0(&bb->b_instr[i + 1], NOP);
+ }
+ break;
case COMPARE_OP:
if (nextop == TO_BOOL) {
INSTR_SET_OP0(inst, NOP);