summaryrefslogtreecommitdiffstats
path: root/Python/flowgraph.c
Commit message (Collapse)AuthorAgeFilesLines
* gh-130080: move _Py_EnsureArrayLargeEnough to a separate header so it can be ↵Irit Katriel2025-03-131-7/+11
| | | | used outside of the compiler (#130930)
* gh-126835: Avoid creating unnecessary tuple when looking for constant ↵Yan Yanchii2025-03-121-78/+125
| | | | sequence during constant folding (#131054)
* GH-123044: Give the `POP_TOP` after a case test a location in the body, not ↵Mark Shannon2025-03-101-5/+5
| | | | the pattern. (GH-130627)
* GH-128534: Fix behavior of branch monitoring for `async for` (GH-130847)Mark Shannon2025-03-071-1/+1
| | | * Both branches in a pair now have a common source and are included in co_branches
* gh-130740: Move some `stdbool.h` includes after `Python.h` (#130738)Hugo Beauzée-Luyssen2025-03-021-3/+2
| | | | | Move some `#include <stdbool.h>` after `#include "Python.h"` when `pyconfig.h` is not included first and when we are in a platform-agnostic context. This is to avoid having features defined by `stdbool.h` before those decided by `Python.h`.
* gh-126835: Move constant unaryop & binop folding to CFG (#129550)Yan Yanchii2025-02-211-38/+293
|
* gh-126835: Set location for noped out instructions after constant folding in ↵Yan Yanchii2025-02-141-54/+31
| | | | CFG. (#130109)
* gh-126835: Move const folding of lists & sets from ast_opt.c to flowgraph.c ↵Yan Yanchii2025-02-131-18/+34
| | | | (#130032)
* gh-126835: Make CFG optimizer skip over NOP's when looking for const ↵Yan Yanchii2025-02-091-71/+88
| | | | | sequence construction (#129703) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR ↵Irit Katriel2025-02-071-4/+9
| | | | (#129700)
* gh-126835: Fix reference leak in ↵Yan Yanchii2025-02-041-2/+8
| | | | `Python/flowgrapc.::optimize_if_const_subscr` (#129634)
* gh-126835: Move constant subscript folding to CFG (#129568)Yan Yanchii2025-02-041-0/+82
| | | | | Move folding of constant subscription from AST optimizer to CFG. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-126835: Move optimization of constant sequence creation from codegen to ↵Kirill Podoprigora2025-02-011-4/+71
| | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "GH-128914: Remove conditional stack effects from `bytecodes.c` and ↵Sam Gross2025-01-231-0/+6
| | | | | | | the code generators (GH-128918)" (GH-129202) The commit introduced a ~2.5-3% regression in the free threading build. This reverts commit ab61d3f4303d14a413bc9ae6557c730ffdf7579e.
* GH-128914: Remove conditional stack effects from `bytecodes.c` and the code ↵Mark Shannon2025-01-201-6/+0
| | | | generators (GH-128918)
* Remove unnecessary LIST_TO_TUPLE conversions (GH-126558)Brandt Bucher2025-01-081-0/+7
|
* GH-128533: Add `NOT_TAKEN` instruction after bytecode optimization. (GH-128554)Mark Shannon2025-01-061-6/+3
|
* GH-122548: Implement branch taken and not taken events for sys.monitoring ↵Mark Shannon2024-12-191-0/+6
| | | | (GH-122564)
* gh-126612: Include stack effects of uops when computing maximum stack depth ↵mpage2024-11-261-23/+43
| | | | (#126894)
* GH-125837: Split `LOAD_CONST` into three. (GH-125972)Mark Shannon2024-10-291-30/+20
| | | | | | | | * Add LOAD_CONST_IMMORTAL opcode * Add LOAD_SMALL_INT opcode * Remove RETURN_CONST opcode
* gh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)Irit Katriel2024-10-041-2/+3
|
* gh-124285: Fix bug where bool() is called multiple times for the same part ↵Irit Katriel2024-09-251-2/+71
| | | | of a boolean expression (#124394)
* gh-121404: split compile.c into compile.c and codegen.c (#123651)Irit Katriel2024-09-091-2/+0
|
* Fixes loop variables to be the same types as their limit (GH-120958)Steve Dower2024-06-241-1/+1
|
* gh-120367: fix bug where compiler detects redundant jump after pseudo op ↵Irit Katriel2024-06-181-1/+1
| | | | replacement (#120714)
* gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold ↵Irit Katriel2024-06-171-12/+18
| | | | blocks (#120425)
* gh-120225: fix crash in compiler on empty block at end of exception handler ↵Irit Katriel2024-06-071-6/+2
| | | | (#120235)
* Fix typos in documentation and comments (#119763)Xie Yanbo2024-06-041-1/+1
|
* gh-119744: move a few functions from compile.c to flowgraph.c (#119745)Irit Katriel2024-05-301-4/+141
|
* gh-117494: extract the Instruction Sequence data structure into a separate ↵Irit Katriel2024-04-041-8/+8
| | | | file (#117496)
* gh-117411: move PyFutureFeatures to pycore_symtable.h and make it private ↵Irit Katriel2024-04-021-3/+3
| | | | (#117412)
* gh-117288: Allocate fewer label IDs in _PyCfg_ToInstructionSequence (#117290)Irit Katriel2024-03-271-2/+3
|
* gh-115796: fix exception table construction in ↵Irit Katriel2024-02-221-6/+11
| | | | _testinternalcapi.assemble_code_object (#115797)
* gh-115420: Fix translation of exception hander targets by ↵Irit Katriel2024-02-151-1/+1
| | | | _testinternalcapi.optimize_cfg. (#115425)
* gh-107901: make compiler inline basic blocks with no line number and no ↵Irit Katriel2024-02-021-21/+54
| | | | fallthrough (#114750)
* gh-114569: Use PyMem_* APIs for non-PyObjects in compiler (#114587)Erlend E. Aasland2024-01-291-3/+3
|
* gh-107901: compiler replaces POP_BLOCK instruction by NOPs before ↵Irit Katriel2024-01-251-1/+2
| | | | optimisations (#114530)
* gh-114265: remove i_loc_propagated, jump threading does not consider line ↵Irit Katriel2024-01-251-41/+47
| | | | numbers anymore (#114535)
* gh-114083: apply optimization of LOAD_CONST instructions to the whole CFG ↵Irit Katriel2024-01-221-140/+179
| | | | before optimize_basic_block. (#114408)
* gh-114265: move line number propagation before cfg optimization, remove ↵Irit Katriel2024-01-191-53/+54
| | | | guarantee_lineno_for_exits (#114267)
* gh-107901: duplicate blocks with no lineno that have an eval break and ↵Irit Katriel2024-01-121-10/+22
| | | | multiple predecessors (#113950)
* gh-107901: jump leaving an exception handler doesn't need an eval break ↵Irit Katriel2024-01-111-1/+1
| | | | check (#113943)
* gh-107901: synthetic jumps which are not at end of loop no longer check the ↵Irit Katriel2024-01-061-3/+16
| | | | eval breaker (#113721)
* gh-113603: Compiler no longer tries to maintain the no-empty-block invariant ↵Irit Katriel2024-01-031-78/+38
| | | | (#113636)
* gh-113297: Fix segfault in compiler for with statement with 19 context ↵Irit Katriel2023-12-221-1/+2
| | | | managers (#113327)
* GH-111485: Generate instruction and uop metadata (GH-113287)Mark Shannon2023-12-201-2/+2
|
* gh-113054: Compiler no longer replaces a redundant jump with no line number ↵Irit Katriel2023-12-191-1/+16
| | | | by a NOP (#113139)
* gh-112519: Make it possible to specify instruction flags for pseudo ↵Irit Katriel2023-11-301-1/+1
| | | | instructions in bytecodes.c (#112520)
* gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 ↵Irit Katriel2023-11-021-3/+15
| | | | (#111459)
* gh-109889: fix compiler's redundant NOP detection to look past NOPs with no ↵Irit Katriel2023-09-281-1/+11
| | | | lineno when looking for the next instruction's lineno (#109987)