Skip to content

Commit 2d5f428

Browse files
progress
1 parent cc4b9ce commit 2d5f428

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Tools/cases_generator/optimizer_generator.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,17 @@ def replace_opcode_if_evaluates_pure(
233233
else:
234234
emitter.emit(f"{outp.name} = sym_new_const(ctx, PyStackRef_AsPyObjectBorrow({outp.name}_stackref));\n")
235235

236-
if len(used_stack_inputs) == 1 and len(self.original_uop.stack.outputs) == 1:
237-
outp = self.original_uop.stack.outputs[0]
238-
if not outp.peek:
239-
emitter.emit(f"""
240-
if (sym_is_const(ctx, {used_stack_inputs[0].name})) {{
241-
PyObject *result = sym_get_const(ctx, {used_stack_inputs[0].name});
242-
if (_Py_IsImmortal(result)) {{
243-
// Replace with _POP_LOAD_CONST_INLINE_BORROW since we have one input and an immortal result
244-
REPLACE_OP(this_instr, _POP_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
245-
}}
246-
}}""")
236+
# if len(used_stack_inputs) == 1 and len(self.original_uop.stack.outputs) == 1:
237+
# outp = self.original_uop.stack.outputs[0]
238+
# if not outp.peek:
239+
# emitter.emit(f"""
240+
# if (sym_is_const(ctx, {used_stack_inputs[0].name})) {{
241+
# PyObject *result = sym_get_const(ctx, {used_stack_inputs[0].name});
242+
# if (_Py_IsImmortal(result)) {{
243+
# // Replace with _POP_LOAD_CONST_INLINE_BORROW since we have one input and an immortal result
244+
# REPLACE_OP(this_instr, _POP_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)result);
245+
# }}
246+
# }}""")
247247

248248
if len(used_stack_inputs) == 2 and len(self.original_uop.stack.outputs) == 1:
249249
outp = self.original_uop.stack.outputs[0]

0 commit comments

Comments
 (0)