8000 gh-126835: Move optimization of constant sequence creation from codegen to CFG by Eclips4 · Pull Request #129426 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-126835: Move optimization of constant sequence creation from codegen to CFG #129426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
optimize_build_list_or_set_with_constants -> optimize_if_const_list_o…
…r_set
  • Loading branch information
Eclips4 committed Feb 1, 2025
commit 22c8eb9c4bca2e4a44f71e5991bddca0015e3e6d
4 changes: 2 additions & 2 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ fold_tuple_on_constants(PyObject *const_cache,
or BUILD_SET & SET_UPDATE respectively.
*/
static int
optimize_build_list_or_set_with_constants(PyObject *const_cache, cfg_instr* inst, int n, PyObject *consts)
optimize_if_const_list_or_set(PyObject *const_cache, cfg_instr* inst, int n, PyObject *consts)
{
assert(PyDict_CheckExact(const_cache));
assert(PyList_CheckExact(consts));
Expand Down Expand Up @@ -1813,7 +1813,7 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
case BUILD_LIST:
case BUILD_SET:
if (i >= oparg) {
if (optimize_build_list_or_set_with_constants(const_cache, inst-oparg, oparg, consts) < 0) {
if (optimize_if_const_list_or_set(const_cache, inst-oparg, oparg, consts) < 0) {
goto error;
}
}
Expand Down
Loading
0