Author: Richard Plangger <r...@pasra.at>
Branch: vecopt
Changeset: r78107:3038636d0684
Date: 2015-06-15 10:49 +0200
http://bitbucket.org/pypy/pypy/changeset/3038636d0684/

Log:    jit.promote in the numpy internal iterator generates slightly
        different traces, adjusted tests with the new constant

diff --git a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py 
b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
--- a/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_micronumpy.py
@@ -14,6 +14,7 @@
         assert len(log.loops) == 1
         loop = log._filter(log.loops[0])
         assert loop.match("""
+            ...
             guard_class(p0, #, descr=...)
             p4 = getfield_gc_pure(p0, descr=<FieldP 
pypy.module.micronumpy.iterators.ArrayIter.inst_array \d+>)
             i5 = getfield_gc(p2, descr=<FieldS 
pypy.module.micronumpy.iterators.IterState.inst_offset \d+>)
@@ -40,7 +41,8 @@
             i26 = int_is_true(i25)
             guard_true(i26, descr=...)
             i27 = getfield_gc_pure(p6, descr=<FieldS 
pypy.module.micronumpy.descriptor.W_Dtype.inst_elsize \d+>)
-            i28 = int_add(i5, i27)
+            guard_value(i27, 8, descr=...)
+            i28 = int_add(i5, 8)
             i29 = getfield_gc_pure(p0, descr=<FieldS 
pypy.module.micronumpy.iterators.ArrayIter.inst_size \d+>)
             i30 = int_ge(i23, i29)
             guard_false(i30, descr=...)
@@ -65,6 +67,7 @@
         assert len(log.loops) == 1
         loop = log._filter(log.loops[0])
         assert loop.match("""
+            ...
             f31 = raw_load(i9, i29, descr=<ArrayF 8>)
             guard_not_invalidated(descr=...)
             i34 = getarrayitem_raw(#, #, descr=<ArrayU 1>)  # XXX what are 
these?
@@ -73,7 +76,7 @@
             guard_true(i32, descr=...)
             i35 = getarrayitem_raw(#, #, descr=<ArrayU 1>)  # XXX equiv 
test_zjit
             i36 = int_add(i24, 1)
-            i37 = int_add(i29, i28)
+            i37 = int_add(i29, 8)
             i38 = int_ge(i36, i30)
             guard_false(i38, descr=...)
             guard_value(i35, #, descr=...)                  # XXX
@@ -175,7 +178,7 @@
             guard_false(i88, descr=...)
             f90 = raw_load(i67, i89, descr=<ArrayF 8>)
             i91 = int_add(i87, 1)
-            i93 = int_add(i89, i76)
+            i93 = int_add(i89, 8)
             i94 = int_add(i79, 1)
             i95 = getfield_raw(#, descr=<FieldS pypysig_long_struct.c_value 0>)
             setfield_gc(p97, i91, descr=<FieldS 
pypy.module.micronumpy.iterators.IterState.inst_index .+>)
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_vectorize.py 
b/rpython/jit/metainterp/optimizeopt/test/test_vectorize.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_vectorize.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_vectorize.py
@@ -1375,8 +1375,22 @@
 
 
     def test_abc(self):
-        py.test.skip()
         trace ="""
+        [p0, p1, p5, p6, p7, p17, p19, i46, i37, i41]
+        guard_not_invalidated() [p1, p0, p5, p6, p7, p17, p19]
+        i59 = int_lt(i46, i37)
+        guard_true(i59) [p1, p0, i46, p5, p6, p7, p17, p19]
+        f60 = getarrayitem_raw(i41, i46, descr=floatarraydescr)
+        f61 = float_add(f60, 1.000000)
+        setarrayitem_raw(i41, i46, f61, descr=floatarraydescr)
+        i62 = int_add(i46, 1)
+        setfield_gc(50, i62, descr=<FieldS 
pypy.objspace.std.typeobject.IntMutableCell.inst_intvalue 8>)
+        i63 = int_ge(i62, 2024)
+        guard_false(i63) [p1, p0, p5, p6, p7, p17, p19, i62]
+        i64 = getfield_raw(140099887568000, descr=<FieldS 
pypysig_long_struct.c_value 0>)
+        i65 = int_lt(i64, 0)
+        guard_false(i65) [p1, p0, p5, p6, p7, p17, p19, None]
+        jump(p0, p1, p5, p6, p7, p17, p19, i62, i37, i41)
         """
         opt = self.vectorize(self.parse_loop(trace))
         self.debug_print_operations(opt.loop)
diff --git a/rpython/jit/tool/jitoutput.py b/rpython/jit/tool/jitoutput.py
--- a/rpython/jit/tool/jitoutput.py
+++ b/rpython/jit/tool/jitoutput.py
@@ -26,6 +26,8 @@
     (('nvirtuals',), '^nvirtuals:\s+(\d+)$'),
     (('nvholes',), '^nvholes:\s+(\d+)$'),
     (('nvreused',), '^nvreused:\s+(\d+)$'),
+    (('vecopt_tried',), '^vecopt tried:\s+(\d+)$'),
+    (('vecopt_success',), '^vecopt success:\s+(\d+)$'),
     (('total_compiled_loops',),   '^Total # of loops:\s+(\d+)$'),
     (('total_compiled_bridges',), '^Total # of bridges:\s+(\d+)$'),
     (('total_freed_loops',),      '^Freed # of loops:\s+(\d+)$'),
@@ -57,6 +59,8 @@
     nvirtuals = 0
     nvholes = 0
     nvreused = 0
+    vecopt_tried = 0
+    vecopt_success = 0
 
     def __init__(self):
         self.ops = Ops()
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to