Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

jit/metainterp/test/test_warmspot.py::TestLLWarmspot::()::test_loop_automatic_reds_with_floats_and_refs

self = <rpython.jit.metainterp.test.test_warmspot.TestLLWarmspot instance at 0xf51a8a2c>

    def test_loop_automatic_reds_with_floats_and_refs(self):
        myjitdriver = JitDriver(greens = ['m'], reds = 'auto')
        class MyObj(object):
            def __init__(self, val):
                self.val = val
        def f(n, m):
            res = 0
            # try to have lots of red vars, so that if there is an error in
            # the ordering of reds, there are low chances that the test passes
            # by chance
            i1 = i2 = i3 = i4 = n
            f1 = f2 = f3 = f4 = float(n)
            r1 = r2 = r3 = r4 = MyObj(n)
            while n > 0:
                myjitdriver.jit_merge_point(m=m)
                n -= 1
                i1 += 1 # dummy unused red
                i2 += 2 # dummy unused red
                i3 += 3 # dummy unused red
                i4 += 4 # dummy unused red
                f1 += 1 # dummy unused red
                f2 += 2 # dummy unused red
                f3 += 3 # dummy unused red
                f4 += 4 # dummy unused red
                r1.val += 1 # dummy unused red
                r2.val += 2 # dummy unused red
                r3.val += 3 # dummy unused red
                r4.val += 4 # dummy unused red
                res += m*2
            return res
        expected = f(21, 5)
        res = self.meta_interp(f, [21, 5])
        assert res == expected
>       self.check_resops(int_sub=2, int_mul=0, int_add=18, float_add=8)

jit/metainterp/test/test_warmspot.py:372: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jit/metainterp/test/support.py:199: in check_resops
    get_stats().check_resops(expected=expected, **check)
jit/metainterp/history.py:969: in check_resops
    return self._check_insns(insns, expected, check)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <rpython.jit.metainterp.history.Stats object at 0xf52fc52c>
insns = {'debug_merge_point': 4, 'float_add': 8, 'getfield_gc_i': 1, 'guard_true': 2, ...}
expected = None
check = {'float_add': 8, 'int_add': 18, 'int_mul': 0, 'int_sub': 2}

    def _check_insns(self, insns, expected, check):
        if expected is not None:
            insns.pop('debug_merge_point', None)
            insns.pop('enter_portal_frame', None)
            insns.pop('leave_portal_frame', None)
            insns.pop('label', None)
            assert insns == expected
        for insn, expected_count in check.items():
            getattr(rop, insn.upper())  # fails if 'rop.INSN' does not exist
            found = insns.get(insn, 0)
            assert found == expected_count, (
>               "found %d %r, expected %d" % (found, insn, expected_count))
E           AssertionError: found 20 'int_add', expected 18

jit/metainterp/history.py:982: AssertionError
---------- Captured stdout call ----------
	bh: goto_if_not_int_gt [0, 0, 142, 139] -> 142
	bh: int_return [<BHInterp <JitCode 'f'>>, 210] -> LeaveFrame!
~~~ return value: 210
---------- Captured stderr call ----------
[rtyper] -=- specialized 8 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 7 more blocks -=-
[rtyper] -=- specialized 6 more blocks -=-
[rtyper] -=- specialized 17 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 3 more blocks -=-
[jitcodewriter:info] making JitCodes...
[jitcodewriter:info] There are 1 JitCode instances.
[jitcodewriter:info] There are 4 -live- ops. Size of liveness is 6 bytes
[jitcodewriter] compute_bitstrings:
[jitcodewriter]   0 effectinfos:
[jitcodewriter]     0 descrs for arrays
[jitcodewriter]     0 descrs for fields
[jitcodewriter]     0 descrs for interiorfields
[c5fd604e2487480] {jit-tracing
JIT starting (llgraph) 
(jitdriver: no get_printable_location) 
(jitdriver: no get_printable_location) 
[c5fd604e29bc080] {jit-trace-done
trace length: 149 
 number operations: 35 
 total snapshots: 2 
 snapshot data: 24 
 snapshot array data: 54 
 bigint consts:  0 0 
 float consts:  4 4 
 ref consts:  0 0 1 
 descrs: 1 
[c5fd604e29eb080] jit-trace-done}
[c5fd604e2a7d280] {jit-log-noopt
# Traced loop or bridge with 25 ops 
[i0, i1, i2, i3, i4, i5, p6, f7, f8, f9, f10] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
i12 = int_sub(i0, 1) 
i14 = int_add(i1, 1) 
i16 = int_add(i2, 2) 
i18 = int_add(i3, 3) 
i20 = int_add(i4, 4) 
f22 = float_add(f8, 1.0) 
f24 = float_add(f9, 2.0) 
f26 = float_add(f7, 3.0) 
f28 = float_add(f10, 4.0) 
i29 = getfield_gc_i(p6, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i31 = int_add(i29, 1) 
setfield_gc(p6, i31, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i33 = int_add(i31, 2) 
setfield_gc(p6, i33, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i35 = int_add(i33, 3) 
setfield_gc(p6, i35, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i37 = int_add(i35, 4) 
setfield_gc(p6, i37, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i39 = int_add(i5, 10) 
i41 = int_gt(i12, 0) 
guard_true(i41) 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
guard_future_condition() 
jump(i12, i14, i16, i18, i20, i39, p6, f26, f22, f24, f28, descr=<Loop-1>) 
[c5fd604e2bfa400] jit-log-noopt}
[c5fd604e2c0b600] {jit-optimize
[c5fd604e2c6f700] {jit-log-intbounds
[i0, i1, i2, i3, i4, i5, p6, f7, f8, f9, f10] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
i12 = int_add(i0, -1) 
i14 = int_add(i1, 1) 
# i14 -> (?)   IntBound.unbounded() 
i16 = int_add(i2, 2) 
# i16 -> (?)   IntBound.unbounded() 
i18 = int_add(i3, 3) 
# i18 -> (?)   IntBound.unbounded() 
i20 = int_add(i4, 4) 
# i20 -> (?)   IntBound.unbounded() 
f22 = float_add(f8, 1.0) 
f24 = float_add(f9, 2.0) 
f26 = float_add(f7, 3.0) 
f28 = float_add(f10, 4.0) 
i29 = getfield_gc_i(p6, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i31 = int_add(i29, 1) 
# i31 -> (?)   IntBound.unbounded() 
i33 = int_add(i29, 3) 
i35 = int_add(i29, 6) 
i37 = int_add(i29, 10) 
i39 = int_add(i5, 10) 
# i39 -> (?)   IntBound.unbounded() 
setfield_gc(p6, i37, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i41 = int_gt(i12, 0) 
guard_true(i41, descr=<rpython.jit.metainterp.compile.ResumeGuardDescr object at 0xf536f8ac>) [i12, i14, i16, i18, i20, i39, p6, f26, f22, f24, f28] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
[c5fd604e39d0a00] jit-log-intbounds}
[c5fd604e3b87f00] {jit-log-exported-state
[i42, i43, i44, i45, i46, i47, r48, f49, f50, f51, f52] 
  INP(i44 = int_add(i53, 2/ci)) 
  INP(f52 = float_add(f54, -1074790400/cf)) 
  INP(i47 = int_add(i55, 10/ci)) 
  INP(i43 = int_add(i56, 1/ci)) 
  INP(i42 = int_add(i57, -1/ci)) 
  INP(r48) 
  INP(f49 = float_add(f58, -1074266112/cf)) 
  INP(i46 = int_add(i59, 4/ci)) 
  INP(i45 = int_add(i60, 3/ci)) 
  PureOp(i61 = int_gt(i42, 0/ci)) 
  INP(f51 = float_add(f62, -1073741824/cf)) 
  HeapOp(i63 = int_add(i64, 10/ci), i65 = getfield_gc_i(r48, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val'))) 
  INP(f50 = float_add(f66, -1072693248/cf)) 
[c5fd604e3be9580] jit-log-exported-state}
[c5fd604e3bf7280] jit-optimize}
[c5fd604e3c0fd00] {jit-optimize
[c5fd604e3f88000] {jit-log-intbounds
[i0, i1, i2, i3, i4, i5, p6, f7, f8, f9, f10] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
# i11: (1 <= 0b0?...?)   IntBound(1, MAXINT) 
i13 = int_add(i11, -1) 
i16 = int_add(i14, 1) 
# i16 -> (?)   IntBound.unbounded() 
i19 = int_add(i17, 2) 
# i19 -> (?)   IntBound.unbounded() 
i22 = int_add(i20, 3) 
# i22 -> (?)   IntBound.unbounded() 
i25 = int_add(i23, 4) 
# i25 -> (?)   IntBound.unbounded() 
f28 = float_add(f26, 1.0) 
f31 = float_add(f29, 2.0) 
f34 = float_add(f32, 3.0) 
f37 = float_add(f35, 4.0) 
i40 = int_add(i38, 1) 
# i40 -> (?)   IntBound.unbounded() 
i42 = int_add(i38, 3) 
i44 = int_add(i38, 6) 
i46 = int_add(i38, 10) 
i49 = int_add(i47, 10) 
# i49 -> (?)   IntBound.unbounded() 
setfield_gc(p50, i46, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
# i13: (0 <= 0b0?...? <= MAXINT - 1)   IntBound(0, MAXINT - 1) 
i52 = int_gt(i13, 0) 
guard_true(i52, descr=<rpython.jit.metainterp.compile.ResumeGuardDescr object at 0xf505008c>) [i13, i16, i19, i22, i25, i49, p50, f34, f28, f31, f37] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
[c5fd604e4ec6180] jit-log-intbounds}
# i13: (1 <= 0b0?...?)   IntBound(1, MAXINT) 
jump(i13, i16, i19, i22, i25, i49, p50, f34, f28, f31, f37, i46, descr=TargetToken(-184217652)) 
[c5fd604e527a580] jit-optimize}
[c5fd604e5287c00] {jit-log-short-preamble
[] 
label(i67, i68, i69, i70, i71, i72, p73, f74, f75, f76, f77) 
guard_nonnull(p73) 
guard_is_object(p73) 
guard_subclass(p73, <AddressAsInt * struct rpython.jit.metainterp.test.test_warmspot.MyObj_vtable { super=... }>) 
i79 = getfield_gc_i(p73, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
jump(i79) 
[c5fd604e52bf300] jit-log-short-preamble}
[c5fd604e5349400] {jit-backend
[c5fd604e5363b80] {jit-log-compiling-loop
[i57, i56, i53, i60, i59, i55, p48, f58, f66, f62, f54] 
label(i57, i56, i53, i60, i59, i55, p48, f58, f66, f62, f54, descr=TargetToken(-176243636)) 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
i42 = int_add(i57, -1) 
i43 = int_add(i56, 1) 
i44 = int_add(i53, 2) 
i45 = int_add(i60, 3) 
i46 = int_add(i59, 4) 
f50 = float_add(f66, 1.0) 
f51 = float_add(f62, 2.0) 
f49 = float_add(f58, 3.0) 
f52 = float_add(f54, 4.0) 
i64 = getfield_gc_i(p48, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i90 = int_add(i64, 1) 
i92 = int_add(i64, 3) 
i94 = int_add(i64, 6) 
i63 = int_add(i64, 10) 
i47 = int_add(i55, 10) 
setfield_gc(p48, i63, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i61 = int_gt(i42, 0) 
guard_true(i61, descr=<Guard0xf536f8ac>) [i42, i43, i44, i45, i46, i47, p48, f49, f50, f51, f52] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
label(i42, i43, i44, i45, i46, i47, p48, f49, f50, f51, f52, i63, descr=TargetToken(-184217652)) 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
i99 = int_add(i42, -1) 
i101 = int_add(i43, 1) 
i103 = int_add(i44, 2) 
i105 = int_add(i45, 3) 
i107 = int_add(i46, 4) 
f109 = float_add(f50, 1.0) 
f111 = float_add(f51, 2.0) 
f113 = float_add(f49, 3.0) 
f115 = float_add(f52, 4.0) 
i117 = int_add(i63, 1) 
i119 = int_add(i63, 3) 
i121 = int_add(i63, 6) 
i123 = int_add(i63, 10) 
i125 = int_add(i47, 10) 
setfield_gc(p48, i123, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i127 = int_gt(i99, 0) 
guard_true(i127, descr=<Guard0xf505008c>) [i99, i101, i103, i105, i107, i125, p48, f113, f109, f111, f115] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
jump(i99, i101, i103, i105, i107, i125, p48, f113, f109, f111, f115, i123, descr=TargetToken(-184217652)) 
[c5fd604e5483700] jit-log-compiling-loop}
[c5fd604e5495c00] {jit-mem-looptoken-alloc
allocating Loop # 1 
[c5fd604e54a2b80] jit-mem-looptoken-alloc}
[c5fd604e551ed80] jit-backend}
compiled new loop 
[c5fd604e552c680] {jit-log-opt-loop
# Loop 1 ((jitdriver: no get_printable_location)) : loop with 42 ops 
[i0, i1, i2, i3, i4, i5, p6, f7, f8, f9, f10] 
label(i0, i1, i2, i3, i4, i5, p6, f7, f8, f9, f10, descr=TargetToken(-176243636)) 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
i12 = int_add(i0, -1) 
i14 = int_add(i1, 1) 
i16 = int_add(i2, 2) 
i18 = int_add(i3, 3) 
i20 = int_add(i4, 4) 
f22 = float_add(f8, 1.0) 
f24 = float_add(f9, 2.0) 
f26 = float_add(f7, 3.0) 
f28 = float_add(f10, 4.0) 
i29 = getfield_gc_i(p6, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i31 = int_add(i29, 1) 
i33 = int_add(i29, 3) 
i35 = int_add(i29, 6) 
i37 = int_add(i29, 10) 
i39 = int_add(i5, 10) 
setfield_gc(p6, i37, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i41 = int_gt(i12, 0) 
guard_true(i41, descr=<Guard0xf536f8ac>) [i12, i14, i16, i18, i20, i39, p6, f26, f22, f24, f28] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
label(i12, i14, i16, i18, i20, i39, p6, f26, f22, f24, f28, i37, descr=TargetToken(-184217652)) 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
i43 = int_add(i12, -1) 
i45 = int_add(i14, 1) 
i47 = int_add(i16, 2) 
i49 = int_add(i18, 3) 
i51 = int_add(i20, 4) 
f53 = float_add(f22, 1.0) 
f55 = float_add(f24, 2.0) 
f57 = float_add(f26, 3.0) 
f59 = float_add(f28, 4.0) 
i61 = int_add(i37, 1) 
i63 = int_add(i37, 3) 
i65 = int_add(i37, 6) 
i67 = int_add(i37, 10) 
i69 = int_add(i39, 10) 
setfield_gc(p6, i67, descr=FieldDescr(<GcStruct rpython.jit.metainterp.test.test_warmspot.MyObj { super, inst_val }>, 'inst_val')) 
i71 = int_gt(i43, 0) 
guard_true(i71, descr=<Guard0xf505008c>) [i43, i45, i47, i49, i51, i69, p6, f57, f53, f55, f59] 
debug_merge_point(0, 0, '(jitdriver: no get_printable_location)') 
jump(i43, i45, i47, i49, i51, i69, p6, f57, f53, f55, f59, i67, descr=TargetToken(-184217652)) 
[c5fd604e565b200] jit-log-opt-loop}
DoneWithThisFrameInt 
[c5fd604e5d3c580] jit-tracing}
builder: rpython-linux-x86-32 build #857+
test: jit/metainterp/test/test_warmspot.py::TestLLWarmspot::()::test_loop_automatic_reds_with_floats_and_refs