Skip to content

Commit 7f90d0c

Browse files
Fix test, rename
1 parent ad03b1e commit 7f90d0c

File tree

7 files changed

+46
-46
lines changed

7 files changed

+46
-46
lines changed

Include/internal/pycore_uop_ids.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_capi/test_opt.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def testfunc(n):
678678
self.assertLessEqual(len(guard_nos_float_count), 1)
679679
# TODO gh-115506: this assertion may change after propagating constants.
680680
# We'll also need to verify that propagation actually occurs.
681-
self.assertIn("_BINARY_OP_ADD_FLOAT__NO_INPUT_DECREF", uops)
681+
self.assertIn("_BINARY_OP_ADD_FLOAT__NO_DECREF_INPUTS", uops)
682682

683683
def test_float_subtract_constant_propagation(self):
684684
def testfunc(n):
@@ -700,7 +700,7 @@ def testfunc(n):
700700
self.assertLessEqual(len(guard_nos_float_count), 1)
701701
# TODO gh-115506: this assertion may change after propagating constants.
702702
# We'll also need to verify that propagation actually occurs.
703-
self.assertIn("_BINARY_OP_SUBTRACT_FLOAT__NO_INPUT_DECREF", uops)
703+
self.assertIn("_BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS", uops)
704704

705705
def test_float_multiply_constant_propagation(self):
706706
def testfunc(n):
@@ -722,7 +722,7 @@ def testfunc(n):
722722
self.assertLessEqual(len(guard_nos_float_count), 1)
723723
# TODO gh-115506: this assertion may change after propagating constants.
724724
# We'll also need to verify that propagation actually occurs.
725-
self.assertIn("_BINARY_OP_MULTIPLY_FLOAT__NO_INPUT_DECREF", uops)
725+
self.assertIn("_BINARY_OP_MULTIPLY_FLOAT__NO_DECREF_INPUTS", uops)
726726

727727
def test_add_unicode_propagation(self):
728728
def testfunc(n):
@@ -1707,10 +1707,10 @@ def f(n):
17071707
self.assertIsNotNone(ex)
17081708
uops = get_opnames(ex)
17091709
self.assertEqual(uops.count("_GUARD_NOS_LIST"), 0)
1710-
self.assertEqual(uops.count("_STORE_SUBSCR_LIST_INT"), 1)
1710+
self.assertEqual(uops.count("_STORE_SUBSCR_LIST_INT__NO_DECREF_INPUTS"), 1)
17111711
self.assertEqual(uops.count("_GUARD_TOS_LIST"), 0)
17121712
self.assertEqual(uops.count("_UNPACK_SEQUENCE_LIST"), 1)
1713-
self.assertEqual(uops.count("_BINARY_OP_SUBSCR_LIST_INT"), 1)
1713+
self.assertEqual(uops.count("_BINARY_OP_SUBSCR_LIST_INT__NO_DECREF_INPUTS"), 1)
17141714
self.assertEqual(uops.count("_TO_BOOL_LIST"), 1)
17151715

17161716
def test_remove_guard_for_known_type_set(self):
@@ -2231,7 +2231,7 @@ def testfunc(args):
22312231
self.assertAlmostEqual(res, TIER2_THRESHOLD * (0.1 + 0.1))
22322232
self.assertIsNotNone(ex)
22332233
uops = get_opnames(ex)
2234-
self.assertIn("_BINARY_OP_ADD_FLOAT__NO_INPUT_DECREF", uops)
2234+
self.assertIn("_BINARY_OP_ADD_FLOAT__NO_DECREF_INPUTS", uops)
22352235

22362236

22372237
def global_identity(x):

Python/bytecodes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ dummy_func(
678678
}
679679

680680

681-
pure op(_BINARY_OP_MULTIPLY_FLOAT__NO_INPUT_DECREF, (left, right -- res)) {
681+
pure op(_BINARY_OP_MULTIPLY_FLOAT__NO_DECREF_INPUTS, (left, right -- res)) {
682682
PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
683683
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
684684
assert(PyFloat_CheckExact(left_o));
@@ -693,7 +693,7 @@ dummy_func(
693693
ERROR_IF(PyStackRef_IsNull(res));
694694
}
695695

696-
pure op(_BINARY_OP_ADD_FLOAT__NO_INPUT_DECREF, (left, right -- res)) {
696+
pure op(_BINARY_OP_ADD_FLOAT__NO_DECREF_INPUTS, (left, right -- res)) {
697697
PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
698698
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
699699
assert(PyFloat_CheckExact(left_o));
@@ -708,7 +708,7 @@ dummy_func(
708708
ERROR_IF(PyStackRef_IsNull(res));
709709
}
710710

711-
pure op(_BINARY_OP_SUBTRACT_FLOAT__NO_INPUT_DECREF, (left, right -- res)) {
711+
pure op(_BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS, (left, right -- res)) {
712712
PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
713713
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
714714
assert(PyFloat_CheckExact(left_o));
@@ -907,7 +907,7 @@ dummy_func(
907907
DECREF_INPUTS();
908908
}
909909

910-
op(_BINARY_OP_SUBSCR_LIST_INT__NO_INPUT_DECREF, (list_st, sub_st -- res)) {
910+
op(_BINARY_OP_SUBSCR_LIST_INT__NO_DECREF_INPUTS, (list_st, sub_st -- res)) {
911911
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
912912
PyObject *list = PyStackRef_AsPyObjectBorrow(list_st);
913913

@@ -1135,7 +1135,7 @@ dummy_func(
11351135
Py_DECREF(old_value);
11361136
}
11371137

1138-
op(_STORE_SUBSCR_LIST_INT__NO_INPUT_DECREF, (value, list_st, sub_st -- )) {
1138+
op(_STORE_SUBSCR_LIST_INT__NO_DECREF_INPUTS, (value, list_st, sub_st -- )) {
11391139
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
11401140
PyObject *list = PyStackRef_AsPyObjectBorrow(list_st);
11411141

Python/executor_cases.c.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_analysis.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,11 @@ get_code_with_logging(_PyUOpInstruction *op)
445445

446446
// TODO (gh-134584) generate most of this table automatically
447447
const uint16_t op_without_decref_inputs[MAX_UOP_ID + 1] = {
448-
[_BINARY_OP_MULTIPLY_FLOAT] = _BINARY_OP_MULTIPLY_FLOAT__NO_INPUT_DECREF,
449-
[_BINARY_OP_ADD_FLOAT] = _BINARY_OP_ADD_FLOAT__NO_INPUT_DECREF,
450-
[_BINARY_OP_SUBTRACT_FLOAT] = _BINARY_OP_SUBTRACT_FLOAT__NO_INPUT_DECREF,
451-
[_STORE_SUBSCR_LIST_INT] = _STORE_SUBSCR_LIST_INT__NO_INPUT_DECREF,
452-
[_BINARY_OP_SUBSCR_LIST_INT] = _BINARY_OP_SUBSCR_LIST_INT__NO_INPUT_DECREF,
448+
[_BINARY_OP_MULTIPLY_FLOAT] = _BINARY_OP_MULTIPLY_FLOAT__NO_DECREF_INPUTS,
449+
[_BINARY_OP_ADD_FLOAT] = _BINARY_OP_ADD_FLOAT__NO_DECREF_INPUTS,
450+
[_BINARY_OP_SUBTRACT_FLOAT] = _BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS,
451+
[_STORE_SUBSCR_LIST_INT] = _STORE_SUBSCR_LIST_INT__NO_DECREF_INPUTS,
452+
[_BINARY_OP_SUBSCR_LIST_INT] = _BINARY_OP_SUBSCR_LIST_INT__NO_DECREF_INPUTS,
453453
};
454454

455455
/* 1 for success, 0 for not ready, cannot error at the moment. */

Python/optimizer_cases.c.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)