8000 gh-131798: Small improvements to `remove_unneeded_uops` (GH-134554) · python/cpython@71dea74 · GitHub
[go: up one dir, main page]

Skip to content

Commit 71dea74

Browse files
authored
gh-131798: Small improvements to remove_unneeded_uops (GH-134554)
Improve remove_unneeded_uops
1 parent b8f5526 commit 71dea74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/optimizer_analysis.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = {
558558
const bool op_skip[MAX_UOP_ID + 1] = {
559559
[_NOP] = true,
560560
[_CHECK_VALIDITY] = true,
561+
[_CHECK_PERIODIC] = true,
561562
[_SET_IP] = true,
562563
};
563564

@@ -617,7 +618,7 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
617618
while (op_skip[last->opcode]) {
618619
last--;
619620
}
620-
if (op_without_push[last->opcode]) {
621+
if (op_without_push[last->opcode] && op_without_pop[opcode]) {
621622
last->opcode = op_without_push[last->opcode];
622623
opcode = buffer[pc].opcode = op_without_pop[opcode];
623624
if (op_without_pop[last->opcode]) {

0 commit comments

Comments
 (0)
0