[pypy-commit] pypy ppc-vsx-support: new test to ensure that operations that only the necessary index calculations are emitted

plan_rich pypy.commits at gmail.com
Wed Sep 7 10:07:20 EDT 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: ppc-vsx-support
Changeset: r86934:a867b0a573a4
Date: 2016-09-07 16:03 +0200
http://bitbucket.org/pypy/pypy/changeset/a867b0a573a4/

Log:	new test to ensure that operations that only the necessary index
	calculations are emitted

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_vecopt.py b/rpython/jit/metainterp/optimizeopt/test/test_vecopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_vecopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_vecopt.py
@@ -1384,5 +1384,23 @@
                 for arg in op.getfailargs():
                     assert not arg.is_constant()
 
+    def test_delay_pure_ops(self):
+        """ Pure operations can be delayed. Often (e.g. for index calc.) this means they can be omitted.
+        """
+        trace = self.parse_loop("""
+        [p0,i0]
+        f0 = raw_load_f(p0, i0, descr=floatarraydescr)
+        i1 = int_add(i0,8)
+        f1 = raw_load_f(p0, i1, descr=floatarraydescr)
+        i2 = int_add(i1,8)
+        jump(p0,i2)
+        """)
+        self.schedule(trace)
+        self.ensure_operations([
+            'v0[2xf64] = vec_load_f(p0, i0, 8, 0, descr=floatarraydescr)',
+            'i2 = int_add(i0, 16)',
+            'jump(p0,i2)',
+        ], trace)
+
 class TestLLtype(BaseTestVectorize, LLtypeMixin):
     pass


More information about the pypy-commit mailing list