Skip to content

Commit b8519e0

Browse files
fix tests and generation
1 parent 377d455 commit b8519e0

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Python/optimizer_analysis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ add_op(JitOptContext *ctx, _PyUOpInstruction *this_instr,
237237
ctx->out_buffer.next++;
238238
}
239239

240-
#define PROMOTE_TO_CONSTANT_POOL _Py_uop_promote_to_constant_pool
240+
#define sym_promote_to_constant_pool _Py_uop_promote_to_constant_pool
241241

242242
/* Shortened forms for convenience, used in optimizer_bytecodes.c */
243243
#define sym_is_not_null _Py_uop_sym_is_not_null

Python/optimizer_cases.c.h

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

Tools/cases_generator/optimizer_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def replace_opcode_if_evaluates_pure(
279279

280280
emitter.emit(f"if (sym_is_const(ctx, {output_identifier.text})) {{\n")
281281
emitter.emit(f"PyObject *result = sym_get_const(ctx, {output_identifier.text});\n")
282-
emitter.emit(f"if (_Py_IsImmortal(result)) {{\n")
282+
emitter.emit(f"if (_Py_uop_promote_to_constant_pool(ctx, result) == 0) {{\n")
283283
emitter.emit(f"// Replace with {ops_desc} since we have {input_desc} and an immortal result\n")
284284
for op, args in ops:
285285
emitter.emit(f"ADD_OP({op}, {args});\n")

0 commit comments

Comments
 (0)