gh-104909: Implement conditional stack effects for macros by gvanrossum · Pull Request #105748 · python/cpython
Conversation
Currently only conditional output effects in the last sub-instruction are supported.
This is needed so we can make progress with splitting opcodes into uops with at most one cache entry or oparg -- some of the opcodes that need splitting have a conditional output effect.
| src: StackEffect | None, | ||
| *, | ||
| # Don't initialize from dst.cond; used for conditional *outputs*. | ||
| unconditional: bool = False, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding it hard to track the directions of the different booleans here (unconditional is used for conditional outputs, and we don't initialise when it is True..).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I'm reverting the sense and renaming it to init_null, with a default of True (since that's what's needed in 5 out of 6 call sites).
I'll undraft this once gh-105788 is merged (which is one of the earlier commits in this PR, but should be separated out).