mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Remove unnecessary LIST_TO_TUPLE conversions (GH-126558)
This commit is contained in:
parent
845d924efb
commit
004f9fd1f2
2 changed files with 58 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "Python.h"
|
||||
#include "pycore_flowgraph.h"
|
||||
#include "pycore_compile.h"
|
||||
#include "pycore_intrinsics.h"
|
||||
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
|
||||
|
||||
#include "pycore_opcode_utils.h"
|
||||
|
@ -1874,6 +1875,12 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
|
|||
continue;
|
||||
}
|
||||
break;
|
||||
case CALL_INTRINSIC_1:
|
||||
// for _ in (*foo, *bar) -> for _ in [*foo, *bar]
|
||||
if (oparg == INTRINSIC_LIST_TO_TUPLE && nextop == GET_ITER) {
|
||||
INSTR_SET_OP0(inst, NOP);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue