Closed
Description
Feature or enhancement
Prerequisites
- Overhaul Symbol API and add tests: gh-115816: Improve internal symbols API in optimizer #116028
- Re-enable optimizer by default: gh-115859: Re-enable T2 optimizer pass by default #116062
- (Auto-?) generate bottom checks in optimizer_cases.c.h #116088
Optimizations to be added to the tier 2 optimizer for 3.13
- Type/value propagation for
TO_BOOL
#115685- Normal _TO_BOOL specializations and friends.
- TO_BOOL_ALWAYS_TRUE (only if it's worth it?)
- Convert
LOAD_ATTR_MODULE
to a constant where the module is already a constant #115651 - Type/constant/value propagation for
BINARY_OP
#115480 - Eliminate constant inputs and output constants for simple operations #115506
- Eliminate boolean and
None
guards for constants #115819- _GUARD_IS_TRUE_POP
- _GUARD_IS_FALSE_POP
- _GUARD_IS_NONE_POP
- _GUARD_IS_NOT_NONE_POP
- All remaining type and value propagation.
- Extract type guards for
COMPARE_OP_INT/FLOAT/STR
- Type/value propagate through COMPARE_OP #115687
- Split up into uops
- Propagate bool value and constants too.
- Any remaining guard elimination not handled above
- gh-115419: Change default sym to not_null #116562
- Eliminate/combine redundant stack checks (
_CHECK_STACK_SPACE
)
- Type propagation does not account for the setting local variables via
frame.f_locals
in a debugger or similar. #115709 - Tier2 peephole optimization: remove extraneous _CHECK_STACK_SPACE ops #116168
- Tier 2 superuops #116202
- Tier 2: True function inlining without reconstruction #116291
If we have time:
- Specialize
CONTAINS_OP
#116381 - Replace
CALL_TUPLE_1
for list and generator arguments - Only specialize
CALL
in tier for type. Generate optimal argument handling code in tier 2.