@@ -239,16 +239,28 @@ dummy_func(void) {
239239 op (_BINARY_OP_ADD_FLOAT , (left , right -- res )) {
240240 REPLACE_OPCODE_IF_EVALUATES_PURE (left , right );
241241 res = sym_new_type (ctx , & PyFloat_Type );
242+ // TODO (gh-134584): Refactor this to use another uop
243+ if (PyJitRef_IsBorrowed (left ) && PyJitRef_IsBorrowed (right )) {
244+ REPLACE_OP (this_instr , op_without_decref_inputs [opcode ], oparg , 0 );
245+ }
242246 }
243247
244248 op (_BINARY_OP_SUBTRACT_FLOAT , (left , right -- res )) {
245249 REPLACE_OPCODE_IF_EVALUATES_PURE (left , right );
246250 res = sym_new_type (ctx , & PyFloat_Type );
251+ // TODO (gh-134584): Refactor this to use another uop
252+ if (PyJitRef_IsBorrowed (left ) && PyJitRef_IsBorrowed (right )) {
253+ REPLACE_OP (this_instr , op_without_decref_inputs [opcode ], oparg , 0 );
254+ }
247255 }
248256
249257 op (_BINARY_OP_MULTIPLY_FLOAT , (left , right -- res )) {
250258 REPLACE_OPCODE_IF_EVALUATES_PURE (left , right );
251259 res = sym_new_type (ctx , & PyFloat_Type );
260+ // TODO (gh-134584): Refactor this to use another uop
261+ if (PyJitRef_IsBorrowed (left ) && PyJitRef_IsBorrowed (right )) {
262+ REPLACE_OP (this_instr , op_without_decref_inputs [opcode ], oparg , 0 );
263+ }
252264 }
253265
254266 op (_BINARY_OP_ADD_UNICODE , (left , right -- res )) {
0 commit comments