GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — gh-131798: JIT: Split CALL_TUPLE_1 into several uops by tomasr8 · Pull Request #132851 · python/cpython Conversation
|
| if (sym_matches_type(arg, &PyTuple_Type)) { | ||
| // e.g. tuple((1, 2)) or tuple(foo) where foo is known to be a tuple | ||
| res = arg; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same optimization as in #132849 (comment)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| x = 0 | ||
| for _ in range(n): | ||
| y = tuple((1, 2)) # tuple argument | ||
| a, _ = y # _UNPACK_SEQUENCE_TWO_TUPLE |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I needed to use UNPACK_SEQUENCE(_TWO)_TUPLE here since it is currently the only uop that propagates the tuple items to the result.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nice observation. Seems like _BINARY_OP_SUBSCR_TUPLE_INT could be taught how to do this pretty easily for a constant RHS. Want to add that to your queue?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's already in the queue 😄
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.