@@ -843,6 +843,7 @@ def testfunc(n):
843843 self .assertLessEqual (len (guard_tos_unicode_count ), 1 )
844844 self .assertLessEqual (len (guard_nos_unicode_count ), 1 )
845845 self .assertIn ("_COMPARE_OP_STR" , uops )
846+ self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
846847
847848 def test_type_inconsistency (self ):
848849 ns = {}
@@ -1612,7 +1613,7 @@ def f(n):
16121613 # But all of the appends we care about are still there:
16131614 self .assertEqual (uops .count ("_CALL_LIST_APPEND" ), len ("ABCDEFG" ))
16141615
1615- def test_compare_pop_two_load_const_inline_borrow (self ):
1616+ def test_compare_pop_two_load_const_inline_borrow_int (self ):
16161617 def testfunc (n ):
16171618 x = 0
16181619 for _ in range (n ):
@@ -1629,6 +1630,23 @@ def testfunc(n):
16291630 self .assertNotIn ("_COMPARE_OP_INT" , uops )
16301631 self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
16311632
1633+ def test_compare_pop_two_load_const_inline_borrow_float (self ):
1634+ def testfunc (n ):
1635+ x = 0
1636+ for _ in range (n ):
1637+ a = 10.0
1638+ b = 10.0
1639+ if a == b :
1640+ x += 1
1641+ return x
1642+
1643+ res , ex = self ._run_with_optimizer (testfunc , TIER2_THRESHOLD )
1644+ self .assertEqual (res , TIER2_THRESHOLD )
1645+ self .assertIsNotNone (ex )
1646+ uops = get_opnames (ex )
1647+ self .assertNotIn ("_COMPARE_OP_FLOAT" , uops )
1648+ self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
1649+
16321650 def test_to_bool_bool_contains_op_set (self ):
16331651 """
16341652 Test that _TO_BOOL_BOOL is removed from code like:
@@ -1953,6 +1971,7 @@ def testfunc(n):
19531971 self .assertIn ("_UNPACK_SEQUENCE_TWO_TUPLE" , uops )
19541972 self .assertNotIn ("_COMPARE_OP_INT" , uops )
19551973 self .assertNotIn ("_GUARD_IS_TRUE_POP" , uops )
1974+ self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
19561975
19571976 def test_call_len (self ):
19581977 def testfunc (n ):
@@ -2071,6 +2090,7 @@ def testfunc(n):
20712090 self .assertIn ("_BINARY_OP_SUBSCR_TUPLE_INT" , uops )
20722091 self .assertNotIn ("_COMPARE_OP_INT" , uops )
20732092 self .assertNotIn ("_GUARD_IS_TRUE_POP" , uops )
2093+ self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
20742094
20752095 def test_call_isinstance_guards_removed (self ):
20762096 def testfunc (n ):
0 commit comments