Skip to content

Commit 6934f63

Browse files
committed
Update remove_unneeded_uops with new uops
1 parent 81f9b44 commit 6934f63

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,9 +1819,10 @@ def testfunc(n):
18191819
self.assertIsNotNone(ex)
18201820
uops = get_opnames(ex)
18211821
# When the result of type(...) is known, _CALL_TYPE_1 is replaced with
1822-
# _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW which is optimized away in
1822+
# _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW which is optimized away in
18231823
# remove_unneeded_uops.
18241824
self.assertNotIn("_CALL_TYPE_1", uops)
1825+
self.assertNotIn("_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops)
18251826
self.assertNotIn("_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops)
18261827
self.assertNotIn("_POP_CALL_LOAD_CONST_INLINE_BORROW", uops)
18271828
self.assertNotIn("_POP_TOP_LOAD_CONST_INLINE_BORROW", uops)

Python/optimizer_analysis.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,9 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = {
566566
[_POP_TOP_LOAD_CONST_INLINE] = _POP_TOP,
567567
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP,
568568
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO,
569+
[_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE,
569570
[_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO,
571+
[_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
570572
};
571573

572574
const bool op_skip[MAX_UOP_ID + 1] = {
@@ -578,6 +580,10 @@ const bool op_skip[MAX_UOP_ID + 1] = {
578580

579581
const uint16_t op_without_pop[MAX_UOP_ID + 1] = {
580582
[_POP_TOP] = _NOP,
583+
[_POP_TOP_NOP] = _NOP,
584+
[_POP_TOP_INT] = _NOP,
585+
[_POP_TOP_FLOAT] = _NOP,
586+
[_POP_TOP_UNICODE] = _NOP,
581587
[_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE,
582588
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW,
583589
[_POP_TWO] = _POP_TOP,

0 commit comments

Comments
 (0)