-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add tier 2 partial evaluation pass. #120619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
@markshannon do you mind if I assign myself to this? |
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
This is a fairly large feature, so I'd like to do some reasonably detailed design work before we start implementing this. Fell free to add any thoughts you have about the design here, or in https://github.com/faster-cpython/ideas, but I'd advise against starting coding just yet. |
I propose this algorithm, starting with the simplest optimization: LOAD_FAST; POP_TOP -> _NOP, or constant propagation. |
* Optimize through _Py_FRAME_GENERAL * refactor
…ms (GH-124846) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
…op forms (pythonGH-124846) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
…op forms (pythonGH-124846) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
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:
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
RETURN_VALUE
instruction #120624_Py_FRAME_GENERAL
#124518The text was updated successfully, but these errors were encountered: