]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-126835: Move optimization of constant sequence creation from codegen to CFG (...
authorKirill Podoprigora <kirill.bast9@mail.ru>
Sat, 1 Feb 2025 11:39:44 +0000 (11:39 +0000)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2025 11:39:44 +0000 (11:39 +0000)
commit7d0521d5fc32f4837257e89e6ead652223ecfada
tree881e4082b7cc1d347ecd8408c464d4a4379b54b1
parentd89a5f6a6e65511a5f6e0618c4c30a7aa5aba56a
gh-126835: Move optimization of constant sequence creation from codegen to CFG (#129426)

Codegen phase has an optimization that transforms
```
LOAD_CONST x
LOAD_CONST y
LOAD_CONXT z
BUILD_LIST/BUILD_SET (3)
```
->
```
BUILD_LIST/BUILD_SET (0)
LOAD_CONST (x, y, z)
LIST_EXTEND/SET_UPDATE 1
```
This optimization has now been moved to CFG phase to make #128802 work.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
Lib/test/test_dis.py
Python/codegen.c
Python/flowgraph.c