summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_optimizer.h
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-120642: Move private PyCode APIs to the internal C API (#120643) ↵Victor Stinner2024-06-261-2/+152
| | | | | | | | | | | | | | | | | | | | | (#121043) gh-120642: Move private PyCode APIs to the internal C API (#120643) * Move _Py_CODEUNIT and related functions to pycore_code.h. * Move _Py_BackoffCounter to pycore_backoff.h. * Move Include/cpython/optimizer.h content to pycore_optimizer.h. * Remove Include/cpython/optimizer.h. * Remove PyUnstable_Replace_Executor(). Rename functions: * PyUnstable_GetExecutor() => _Py_GetExecutor() * PyUnstable_GetOptimizer() => _Py_GetOptimizer() * PyUnstable_SetOptimizer() => _Py_SetTier2Optimizer() * PyUnstable_Optimizer_NewCounter() => _PyOptimizer_NewCounter() * PyUnstable_Optimizer_NewUOpOptimizer() => _PyOptimizer_NewUOpOptimizer() (cherry picked from commit 9e4a81f00fef689c6e18a64245aa064eaadc7ac7)
* [3.13] gh-119258: Backport optimizer frame fixes in GH-119365 (GH-120699)Ken Jin2024-06-201-3/+3
| | | (cherry picked from commit 55402d3)
* GH-115480: Reduce guard strength for binary ops when type of one operand is ↵Mark Shannon2024-04-221-0/+1
| | | | known already (GH-118050)
* GH-116422: Tier2 hot/cold splitting (GH-116813)Mark Shannon2024-03-261-1/+1
| | | | | Splits the "cold" path, deopts and exits, from the "hot" path, reducing the size of most jitted instructions, at the cost of slower exits.
* GH-115819: Eliminate Boolean guards when value is known (GH-116355)Mark Shannon2024-03-051-0/+1
|
* GH-115685: Optimize `TO_BOOL` and variants based on truthiness of input. ↵Mark Shannon2024-03-051-0/+1
| | | | (GH-116311)
* gh-116088: Insert bottom checks after all sym_set_...() calls (#116089)Guido van Rossum2024-02-291-4/+4
| | | | | | | | | This changes the `sym_set_...()` functions to return a `bool` which is `false` when the symbol is `bottom` after the operation. All calls to such functions now check this result and go to `hit_bottom`, a special error label that prints a different message and then reports that it wasn't able to optimize the trace. No executor will be produced in this case.
* GH-115802: JIT "small" code for Windows (GH-115964)Brandt Bucher2024-02-291-0/+2
|
* gh-115859: Re-enable T2 optimizer pass by default (#116062)Guido van Rossum2024-02-281-0/+2
| | | | | | | | | | | | | This undoes the *temporary* default disabling of the T2 optimizer pass in gh-115860. - Add a new test that reproduces Brandt's example from gh-115859; it indeed crashes before gh-116028 with PYTHONUOPSOPTIMIZE=1 - Re-enable the optimizer pass in T2, stop checking PYTHONUOPSOPTIMIZE - Rename the env var to disable T2 entirely to PYTHON_UOPS_OPTIMIZE (must be explicitly set to 0 to disable) - Fix skipIf conditions on tests in test_opt.py accordingly - Export sym_is_bottom() (for debugging) - Fix various things in the `_BINARY_OP_` specializations in the abstract interpreter: - DECREF(temp) - out-of-space check after sym_new_const() - add sym_matches_type() checks, so even if we somehow reach a binary op with symbolic constants of the wrong type on the stack we won't trigger the type assert
* gh-115816: Improve internal symbols API in optimizer (#116028)Guido van Rossum2024-02-281-5/+7
| | | | | | | - Any `sym_set_...` call that attempts to set conflicting information cause the symbol to become `bottom` (contradiction). - All `sym_is...` and similar calls return false or NULL for `bottom`. - Everything's tested. - The tests still pass with `PYTHONUOPSOPTIMIZE=1`.
* GH-115816: Assorted naming and formatting changes to improve ↵Mark Shannon2024-02-271-38/+35
| | | | | | | maintainability. (GH-115987) * Rename _Py_UOpsAbstractInterpContext to _Py_UOpsContext and _Py_UOpsSymType to _Py_UopsSymbol. * #define shortened form of _Py_uop_... names for improved readability.
* GH-115816: Make tier2 optimizer symbols testable, and add a few tests. ↵Mark Shannon2024-02-271-0/+85
| | | | (GH-115953)
* gh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)Ken Jin2024-02-131-0/+7
| | | | | | | --------- Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com> Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
* GH-113710: Add a "globals to constants" pass (GH-114592)Mark Shannon2024-02-021-2/+3
| | | Converts specializations of `LOAD_GLOBAL` into constants during tier 2 optimization.
* GH-113860: Get rid of `_PyUOpExecutorObject` (GH-113954)Brandt Bucher2024-01-121-2/+0
|
* GH-111339: Fix initialization and finalization of static optimizer types ↵Savannah Ostrowski2023-10-291-0/+5
| | | | (GH-111430)
* gh-108216: Cleanup #include in internal header files (#108228)Victor Stinner2023-08-211-1/+1
| | | | | | | | | | | * Add missing includes. * Remove unused includes. * Update old include/symbol names to newer names. * Mention at least one included symbol. * Sort includes. * Update Tools/cases_generator/generate_cases.py used to generated pycore_opcode_metadata.h. * Update Parser/asdl_c.py used to generate pycore_ast.h. * Cleanup also includes in _testcapimodule.c and _testinternalcapi.c.
* gh-107557: Setup abstract interpretation (#107847)Ken Jin2023-08-151-0/+20
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>