gh-130480: Move duplicate LOAD_SMALL_INT optimization from codegen to CFG (#130481)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user