-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
Once an optimization pass is in place, it enables external contributors to make improvements.
It happened with the tier 1 specializer and is happening now with the tier 2 optimizer and JIT.
We should add the partial evaluation pass, so that external contributors can help with that.
The aim of the partial evaluation pass is to do computation, allocation and deallocation during optimization, so it doesn't need to be done at runtime.
We should add this pass, starting with a few very simple optimizations as placeholders for the full pass to be added later.
These optimizations should include:
- Float unboxing
- Temporary tuple elimination
We can start with the very simple optimization : BUILD_TUPLE 2; _RETURN_VALUE; UNPACK 2 -> _RETURN_PAIR
before adding more complex optimizations in the future.
Linked PRs
- GH-120619: Clean up
RETURN_VALUE
instruction #120624 - gh-120619: Tier 2 partial evaluation pass foundations #123652
- gh-120619: Optimize through
_Py_FRAME_GENERAL
#124518 - gh-120619: Strength reduce function guards, support 2-operand instruction forms #124846
- gh-120619: Tier 2 partial evaluator foundations #124910
- gh-126902: Strength reduce _CHECK_FUNCTION #126856