You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code generator: support variable stack effects in macros #106812
We need at least to handle micro-ops that have the same variable-length input effect as output effect, and a final (action) op that has a variable-length stack input effect and a fixed output effect. This should handle all the CALL specializations. (For UNPACK_SEQUENCE we also need to support a fixed input effect and a variable output effect, in he action op.)
This is turning into a bit of a research project. I would like to refactor all the handling of stack effects in the generator.
I'm thinking of having an algorithm that takes a sequence of operations such as pop/push, peek/poke, shrink/grow, and copy, and which applies certain transformations (e.g. push+pop can be replaced by copy under certain conditions), trying to reach an optimal end state, which can then be turned into optimal C code.
But the right set of operations, transformations and conditions is still elusive.
Activity
gvanrossum commentedon Jul 19, 2023
This is turning into a bit of a research project. I would like to refactor all the handling of stack effects in the generator.
I'm thinking of having an algorithm that takes a sequence of operations such as
pop/push,peek/poke,shrink/grow, andcopy, and which applies certain transformations (e.g.push+popcan be replaced bycopyunder certain conditions), trying to reach an optimal end state, which can then be turned into optimal C code.But the right set of operations, transformations and conditions is still elusive.
gh-106812: Refactor cases_generator to allow uops with array stack ef…
gh-106812: Fix two tiny bugs in analysis.py (#107649)
gh-106812: Small stack effect fixes (#107759)