Skip to content

Commit 5e217c1

Browse files
committed
Revert "more optmization"
This reverts commit afd5bb0.
1 parent afd5bb0 commit 5e217c1

File tree

8 files changed

+11
-85
lines changed

8 files changed

+11
-85
lines changed

Include/internal/pycore_uop_ids.h

Lines changed: 9 additions & 10 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: 0 additions & 4 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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,6 @@ def testfunc(n):
19881988
self.assertNotIn("_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops)
19891989
self.assertNotIn("_POP_CALL_LOAD_CONST_INLINE_BORROW", uops)
19901990
self.assertNotIn("_POP_TOP_LOAD_CONST_INLINE_BORROW", uops)
1991-
self.assertIn("_SWAP_CALL_LOAD_CONST_INLINE_BORROW", uops)
19921991

19931992
def test_call_len_known_length(self):
19941993
def testfunc(n):

Python/bytecodes.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5244,16 +5244,6 @@ dummy_func(
52445244
#endif
52455245
}
52465246

5247-
tier2 op(_SWAP_CALL_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- res, a, c)) {
5248-
(void)null; // Silence compiler warnings about unused variables
5249-
DEAD(null);
5250-
PyStackRef_CLOSE(arg);
5251-
PyStackRef_CLOSE(callable);
5252-
res = PyStackRef_FromPyObjectBorrow(ptr);
5253-
a = arg;
5254-
c = callable;
5255-
}
5256-
52575247
tier2 op(_EXIT_TRACE, (exit_p/4 --)) {
52585248
_PyExitData *exit = (_PyExitData *)exit_p;
52595249
PyCodeObject *code = _PyFrame_GetCode(frame);

Python/executor_cases.c.h

Lines changed: 0 additions & 33 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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = {
574574
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP,
575575
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO,
576576
[_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO,
577-
[_SWAP_CALL_LOAD_CONST_INLINE_BORROW] = _SWAP_CALL_LOAD_CONST_INLINE_BORROW,
578577
};
579578

580579
const bool op_skip[MAX_UOP_ID + 1] = {

Python/optimizer_bytecodes.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,6 @@ dummy_func(void) {
516516
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
517517
}
518518

519-
op(_SWAP_CALL_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- res, a, c)) {
520-
res = PyJitRef_Borrow(sym_new_const(ctx, ptr));
521-
a = arg;
522-
c = callable;
523-
}
524-
525519
op(_POP_TOP, (value -- )) {
526520
PyTypeObject *typ = sym_get_type(value);
527521
if (PyJitRef_IsBorrowed(value) ||
@@ -1193,7 +1187,7 @@ dummy_func(void) {
11931187
goto error;
11941188
}
11951189
if (_Py_IsImmortal(temp)) {
1196-
REPLACE_OP(this_instr, _SWAP_CALL_LOAD_CONST_INLINE_BORROW,
1190+
REPLACE_OP(this_instr, _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
11971191
0, (uintptr_t)temp);
11981192
}
11991193
res = sym_new_const(ctx, temp);

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)