| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thanks! Personally, I'm not sure that requiring the names to be in sync gains us anything. What's really useful is making sure that the stack effects are the same; if not, it's a serious bug in the optimizer. Making the names match just sort of creates busywork for anyone adding new optimizer cases. And I think it's totally normal for something that's used in the bytecodes to be unused in the optimizer, and vice-versa. So I'd rather just have a special case for when one is unused (which the code generator can use to make the instruction more efficient), instead of forcing them to be loaded and the warnings to be manually silenced. I'll wait for others to chime in, though. It's not a huge deal. |
Sorry, something went wrong.
| (void)counter; | ||
| } | ||
|
|
||
| op(_UNPACK_SEQUENCE, (seq -- unused[oparg], top[0])) { |
There was a problem hiding this comment.
Would it be possible to tell the validator that unused matches anything (both ways)?
So unused in optimizer_bytecodes/bytecodes isn't name-validated.
Sorry, something went wrong.
I agree on the unused part (see the comment above), but I think having names matching is useful, if just for the sake of standardization. |
Sorry, something went wrong.
|
Thanks for the feedback! I updated the PR:
Thanks to special-casing unused, I didn't need to modify bytecodes.c at all. I also added skip news, since this is an internal change. (I'll wait for the CI to pass and then mark it as ready) |
Sorry, something went wrong.
| } | ||
|
|
||
| op(_CREATE_INIT_FRAME, (self, init, args[oparg] -- init_frame: _Py_UOpsAbstractFrame *)) { | ||
| op(_CREATE_INIT_FRAME, (init, self, args[oparg] -- init_frame: _Py_UOpsAbstractFrame *)) { |
There was a problem hiding this comment.
Looks like we found one case where checking the name is useful
Sorry, something went wrong.
There was a problem hiding this comment.
Awesome. This is exactly what we need this for!
Sorry, something went wrong.
|
I plan to merge this after 3.14 beta 1 |
Sorry, something went wrong.
|
(fixed a conflict) |
Sorry, something went wrong.
|
@brandtbucher merging this in the next 24 hours. Watch out for merge conflicts! |
Sorry, something went wrong.
…ptimizer_bytecodes.c` in sync (pythonGH-133320)
…ptimizer_bytecodes.c` in sync (pythonGH-133320)
| Back | FazBrowse Home | New Git URL |
This implements the currently empty validate_uop.
It requires that instructions in bytecodes.c and optimizer_bytecodes.c:
Should we also validate the type/size?
I needed rename a few variables in bytecodes.c from unused to an actual name, otherwise changes are
kept to optimizer_bytecodes.c. There are some things I'm not sure about, I'll add comments to the relevant lines.