Skip to content

Commit b0fb074

Browse files
authored
GH-113657: Add back missing _SET_IP uops in tier two (GH-113662)
1 parent bab0758 commit b0fb074

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an issue that caused important instruction pointer updates to be
2+
optimized out of tier two traces.

Python/optimizer_analysis.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "pycore_opcode_metadata.h"
55
#include "pycore_opcode_utils.h"
66
#include "pycore_pystate.h" // _PyInterpreterState_GET()
7+
#include "pycore_uop_metadata.h"
78
#include "pycore_uops.h"
89
#include "pycore_long.h"
910
#include "cpython/optimizer.h"
@@ -35,13 +36,13 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
3536
break;
3637
}
3738
else {
38-
if (OPCODE_HAS_ESCAPES(opcode)) {
39+
if (_PyUop_Flags[opcode] & HAS_ESCAPES_FLAG) {
3940
maybe_invalid = true;
4041
if (last_set_ip >= 0) {
4142
buffer[last_set_ip].opcode = _SET_IP;
4243
}
4344
}
44-
if (OPCODE_HAS_ERROR(opcode) || opcode == _PUSH_FRAME) {
45+
if ((_PyUop_Flags[opcode] & HAS_ERROR_FLAG) || opcode == _PUSH_FRAME) {
4546
if (last_set_ip >= 0) {
4647
buffer[last_set_ip].opcode = _SET_IP;
4748
}

0 commit comments

Comments
 (0)