Repository navigation
Convert more uops to leave their inputs on the stack to be cleaned up by _POP_TOP #145866
Copy link
Copy link
Open
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JITtype-featureA feature request or enhancementA feature request or enhancement
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancementperformancePerformance or resource usagePerformance or resource usageinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)3.15bugs and security fixesbugs and security fixes
on Mar 12, 2026 A few more:
- UNPACK_SEQUENCE
- UNPACK_SEQUENCE_LIST
- UNPACK_SEQUENCE_TUPLE
UNPACK_SEQUENCE
I thought we were putting those off as you mentioned in #142949 ?
Could I work on
CALL_INTRINSIC_1?Could I work on
CALL_INTRINSIC_1?Sure. I'll assign you on the issue.
Reacted by SaculIn the meantime, would it be ok if I worked on
DICT_UPDATEandSET_UPDATE?Reacted by Ken Jin- added a commit that references this issue
on Mar 16, 2026 I'm interested in working on
CALL_INTRINSIC_2.- added a commit that references this issue
on Mar 19, 2026 38 remaining items
- added 4 commits that reference this issue
on Apr 16, 2026 - added 8 commits that reference this issue
on Apr 25, 2026
Metadata
Metadata
Assignees
Labels
3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JITtype-featureA feature request or enhancementA feature request or enhancement
Feature or enhancement
Proposal:
This is a follow up to #134584
We have, in the JIT, optimizations to eliminate many
_POP_TOPoperations. To take advantage of that we have converted many uops to leave their operands on the stack and added subsequent_POP_TOPs to remove them.See #134584 for many examples of how to do this and why it works.
However, there are still a few uops yet to do. These are:
In addition,
POP_ITER,END_FORandEND_SENDcan be implemented as macro ops, usingPOP_TOPto gain the benefit of the thePOP_TOPoptimization.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Linked PRs
CALL_INTRINSIC_1to leave its inputs on the stack to be cleaned up by_POP_TOP. #145964SET_UPDATEto leave its inputs on the stack to be cleaned up by_POP_TOP#145979POP_ITERas macro op usingPOP_TOP#146185DICT_UPDATEto leave its inputs on the stack to be cleaned up by_POP_TOP#146190_CALL_INTRINSIC_2to leave its inputs on the stack to be cleaned up by_POP_TOP#146262DICT_MERGEto leave its inputs on the stack to be cleaned up by_POP_TOP#146329LIST_EXTENDto leave its inputs on the stack to be cleaned up by_POP_TOPbe cleaned up by_POP_TOP#146383_CALL_METHOD_DESCRIPTOR_NOARGSto leave its inputs on the stack to be cleaned up by _POP_TOP #148227END_[FOR/SEND]to leave its inputs on the stack to be cleaned up by_POP_TOP#148477