@@ -191,6 +191,7 @@ def replace_opcode_if_evaluates_pure(
191
191
input_identifiers_as_str = {tkn .text for tkn in input_identifiers }
192
192
used_stack_inputs = [inp for inp in uop .stack .inputs if inp .name in input_identifiers_as_str ]
193
193
assert len (used_stack_inputs ) > 0
194
+ self .out .start_line ()
194
195
emitter = OptimizerConstantEmitter (self .out , {}, self .original_uop , self .stack .copy ())
195
196
emitter .emit ("if (\n " )
196
197
for inp in used_stack_inputs [:- 1 ]:
@@ -247,14 +248,14 @@ def replace_opcode_if_evaluates_pure(
247
248
if input_count in input_count_to_uop :
248
249
replacement_uop = input_count_to_uop [input_count ]
249
250
input_desc = "one input" if input_count == 1 else "two inputs"
250
- emitter . emit (
251
- f""" if (sym_is_const(ctx, { outp .name } )) {{
252
- PyObject *result = sym_get_const(ctx, { outp .name } );
253
- if (_Py_IsImmortal(result)) {{
254
- // Replace with { replacement_uop } since we have { input_desc } and an immortal result
255
- REPLACE_OP(this_instr, { replacement_uop } , 0, (uintptr_t)result);
256
- }}
257
- }}"" " )
251
+
252
+ emitter . emit ( f" if (sym_is_const(ctx, { outp .name } )) {{\n " )
253
+ emitter . emit ( f" PyObject *result = sym_get_const(ctx, { outp .name } );\n " )
254
+ emitter . emit ( f" if (_Py_IsImmortal(result)) {{\n " )
255
+ emitter . emit ( f" // Replace with { replacement_uop } since we have { input_desc } and an immortal result\n " )
256
+ emitter . emit ( f" REPLACE_OP(this_instr, { replacement_uop } , 0, (uintptr_t)result);\n " )
257
+ emitter . emit ( "} \n " )
258
+ emitter . emit ( "} \n " )
258
259
259
260
storage .flush (self .out )
260
261
emitter .emit ("break;\n " )
0 commit comments