diff options
author | Yan Yanchii <yyanchiy@gmail.com> | 2025-03-14 21:23:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-14 21:23:27 (GMT) |
commit | 55815a6474c59001f0230e44560341b643268e87 (patch) | |
tree | e345de8b575f68d0a06a5bca778f0adf80e415f3 /Python/codegen.c | |
parent | 26511993e63265ea5928aabe6af96d89e20f0553 (diff) | |
download | cpython-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.c | 8 |
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; |