]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115859: Re-enable T2 optimizer pass by default (#116062)
authorGuido van Rossum <guido@python.org>
Wed, 28 Feb 2024 22:38:01 +0000 (14:38 -0800)
committerGitHub <noreply@github.com>
Wed, 28 Feb 2024 22:38:01 +0000 (22:38 +0000)
commit3409bc29c9f06051c28ae0791155e3aebd76ff2d
tree4b627c970a2d5a4b92fc48e320dbe24e579d4eab
parent75c6c05fea212330f4b0259602ffae1b2cb91be3
gh-115859: Re-enable T2 optimizer pass by default (#116062)

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
Include/internal/pycore_optimizer.h
Lib/test/test_capi/test_opt.py
Python/optimizer.c
Python/optimizer_analysis.c
Python/optimizer_bytecodes.c
Python/optimizer_cases.c.h
Python/optimizer_symbols.c