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-148211: decompose `_POP_TOP_LOAD_CONST_INLINE(_BORROW)` in JIT by NekoAsakura · Pull Request #148230 · python/cpython Conversation
|
| const uint16_t op_without_push[MAX_UOP_ID + 1] = { | |
| [_COPY] = _NOP, | |
| [_LOAD_CONST_INLINE] = _NOP, | |
| [_LOAD_CONST_INLINE_BORROW] = _NOP, | |
| [_LOAD_CONST_UNDER_INLINE] = _POP_TOP_LOAD_CONST_INLINE, | |
| [_LOAD_CONST_UNDER_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW, | |
| [_LOAD_FAST] = _NOP, | |
| [_LOAD_FAST_BORROW] = _NOP, | |
| [_LOAD_SMALL_INT] = _NOP, | |
| [_POP_TOP_LOAD_CONST_INLINE] = _POP_TOP, | |
| [_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP, | |
| [_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO, | |
| [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE, | |
| [_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO, | |
| [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, | |
| }; | |
| const bool op_skip[MAX_UOP_ID + 1] = { | |
| [_NOP] = true, | |
| [_CHECK_VALIDITY] = true, | |
| [_CHECK_PERIODIC] = true, | |
| [_SET_IP] = true, | |
| }; | |
| const uint16_t op_without_pop[MAX_UOP_ID + 1] = { | |
| [_POP_TOP] = _NOP, | |
| [_POP_TOP_NOP] = _NOP, | |
| [_POP_TOP_INT] = _NOP, | |
| [_POP_TOP_FLOAT] = _NOP, | |
| [_POP_TOP_UNICODE] = _NOP, | |
| [_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE, | |
| [_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW, | |
| [_POP_TWO] = _POP_TOP, | |
| [_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW, | |
| [_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, | |
| [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_LOAD_CONST_INLINE_BORROW, | |
| [_POP_CALL_TWO] = _POP_CALL_ONE, | |
| [_POP_CALL_ONE] = _POP_CALL, | |
| }; | |
| const uint16_t op_without_pop_null[MAX_UOP_ID + 1] = { | |
| [_POP_CALL] = _POP_TOP, | |
| [_POP_CALL_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW, | |
| }; |
Specifically, these composites chain through _POP_TOP_LOAD_CONST_INLINE_BORROW in the op_without_push / op_without_pop / op_without_pop_null tables:
_POP_TWO_LOAD_CONST_INLINE_BORROW_POP_CALL_LOAD_CONST_INLINE_BORROW_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW_SHUFFLE_2_LOAD_CONST_INLINE_BORROWAdditionally, _LOAD_CONST_UNDER_INLINE(_BORROW) references _POP_TOP_LOAD_CONST_INLINE(_BORROW) as a target in op_without_push — those table entries would need updating too.
Once these dependents are decomposed, the definitions can be fully removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Feel free to remove the composite uops altogether, including removing them from |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah wait, it seems this is quite hard to remove from the unneeded ops pass without modifying it heavily. So let's skip that for now. Thanks! |
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.
LGTM. Thanks a lot!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Please fix the merge conflicts from the other PR. Thank you! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Done :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.