mirror of
https://github.com/python/cpython.git
synced 2025-09-04 16:01:10 +00:00
gh-131798: Small improvements to remove_unneeded_uops
(GH-134554)
Improve remove_unneeded_uops
This commit is contained in:
parent
b8f55266bf
commit
71dea74865
1 changed files with 2 additions and 1 deletions
|
@ -558,6 +558,7 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = {
|
|||
const bool op_skip[MAX_UOP_ID + 1] = {
|
||||
[_NOP] = true,
|
||||
[_CHECK_VALIDITY] = true,
|
||||
[_CHECK_PERIODIC] = true,
|
||||
[_SET_IP] = true,
|
||||
};
|
||||
|
||||
|
@ -617,7 +618,7 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
|
|||
while (op_skip[last->opcode]) {
|
||||
last--;
|
||||
}
|
||||
if (op_without_push[last->opcode]) {
|
||||
if (op_without_push[last->opcode] && op_without_pop[opcode]) {
|
||||
last->opcode = op_without_push[last->opcode];
|
||||
opcode = buffer[pc].opcode = op_without_pop[opcode];
|
||||
if (op_without_pop[last->opcode]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue