summaryrefslogtreecommitdiffstats
path: root/Python/codegen.c
diff options
context:
space:
mode:
authorYan Yanchii <yyanchiy@gmail.com>2025-03-14 21:23:27 (GMT)
committerGitHub <noreply@github.com>2025-03-14 21:23:27 (GMT)
commit55815a6474c59001f0230e44560341b643268e87 (patch)
treee345de8b575f68d0a06a5bca778f0adf80e415f3 /Python/codegen.c
parent26511993e63265ea5928aabe6af96d89e20f0553 (diff)
downloadcpython-55815a6474c59001f0230e44560341b643268e87.zip
cpython-55815a6474c59001f0230e44560341b643268e87.tar.gz
cpython-55815a6474c59001f0230e44560341b643268e87.tar.bz2
gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG (#130481)
Diffstat (limited to 'Python/codegen.c')
-rw-r--r--Python/codegen.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/Python/codegen.c b/Python/codegen.c
index a3eca2a..a049417 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -282,14 +282,6 @@ codegen_addop_noarg(instr_sequence *seq, int opcode, location loc)
static int
codegen_addop_load_const(compiler *c, location loc, PyObject *o)
{
- if (PyLong_CheckExact(o)) {
- int overflow;
- long val = PyLong_AsLongAndOverflow(o, &overflow);
- if (!overflow && _PY_IS_SMALL_INT(val)) {
- ADDOP_I(c, loc, LOAD_SMALL_INT, val);
- return SUCCESS;
- }
- }
Py_ssize_t arg = _PyCompile_AddConst(c, o);
if (arg < 0) {
return ERROR;