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
GH-118095: Add tier 2 support for YIELD_VALUE #118380
Conversation
The stats show that this is working as intended. |
assert(frame != &entry_frame); | ||
frame->instr_ptr = next_instr; | ||
#endif | ||
frame->instr_ptr++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good if the DSL had a symbol for "this instruction's size".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the implications for tier2, but for tier1 this looks fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the tier 1 changes that well, but the tier 2 changes LGTM.
@@ -763,7 +763,7 @@ translate_bytecode_to_trace( | |||
Py_FatalError("garbled expansion"); | |||
} | |||
|
|||
if (uop == _POP_FRAME || uop == _RETURN_GENERATOR) { | |||
if (uop == _POP_FRAME || uop == _RETURN_GENERATOR || uop == _YIELD_VALUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markshannon Shouldn't this same change be made to optimizer_analysis.c (in get_code())?
For your information, from gcc-14, since it enabled |
This PR:
YIELD_VALUE
suitable for tier 2_YIELD_VALUE
micro-op._FOR_ITER_GEN_FRAME
to the tier 2 optimizer to get rid of a compiler warning. This isn't strictly necessary for this PR, but is just good housekeeping.