Author: Richard Plangger <r...@pasra.at>
Branch: vecopt
Changeset: r77993:652fca81f3d1
Date: 2015-06-09 15:41 +0200
http://bitbucket.org/pypy/pypy/changeset/652fca81f3d1/

Log:    preventing the transformation of cumsum (some problems that followed
        from last changes)

diff --git a/rpython/jit/metainterp/optimizeopt/schedule.py 
b/rpython/jit/metainterp/optimizeopt/schedule.py
--- a/rpython/jit/metainterp/optimizeopt/schedule.py
+++ b/rpython/jit/metainterp/optimizeopt/schedule.py
@@ -715,13 +715,6 @@
                 accum = False
             elif self.accum_position != other.accum_position:
                 accum = False
-            # aa
-            #else:
-            #    i = self.accum_position
-            #    lop = leftmost.getoperation()
-            #    roper = rightmost.getoperation()
-            #    if lop.getarg(i) is not roper.result:
-            #        accum = False
         return rightmost is leftmost and accum
 
     def __repr__(self):
diff --git a/rpython/jit/metainterp/optimizeopt/vectorize.py 
b/rpython/jit/metainterp/optimizeopt/vectorize.py
--- a/rpython/jit/metainterp/optimizeopt/vectorize.py
+++ b/rpython/jit/metainterp/optimizeopt/vectorize.py
@@ -292,7 +292,7 @@
                 # that point forward:
                 if node_a.is_before(node_b):
                     if memref_a.is_adjacent_to(memref_b):
-                        pair = self.packset.can_be_packed(node_a, node_b, None)
+                        pair = self.packset.can_be_packed(node_a, node_b, 
None, False)
                         if pair:
                             self.packset.add_pack(pair)
 
@@ -314,7 +314,7 @@
                 rnode = rdep.to
                 isomorph = isomorphic(lnode.getoperation(), 
rnode.getoperation())
                 if isomorph and lnode.is_before(rnode):
-                    pair = self.packset.can_be_packed(lnode, rnode, pack)
+                    pair = self.packset.can_be_packed(lnode, rnode, pack, 
False)
                     if pair:
                         self.packset.add_pack(pair)
 
@@ -326,7 +326,7 @@
                 rnode = rdep.to
                 isomorph = isomorphic(lnode.getoperation(), 
rnode.getoperation())
                 if isomorph and lnode.is_before(rnode):
-                    pair = self.packset.can_be_packed(lnode, rnode, pack)
+                    pair = self.packset.can_be_packed(lnode, rnode, pack, True)
                     if pair:
                         self.packset.add_pack(pair)
 
@@ -540,10 +540,10 @@
     def add_pack(self, pack):
         self.packs.append(pack)
 
-    def can_be_packed(self, lnode, rnode, origin_pack):
+    def can_be_packed(self, lnode, rnode, origin_pack, forward):
         if isomorphic(lnode.getoperation(), rnode.getoperation()):
             if lnode.independent(rnode):
-                if isinstance(origin_pack, AccumPair):
+                if forward and isinstance(origin_pack, AccumPair):
                     # in this case the splitted accumulator must
                     # be combined. This case is not supported
                     raise NotAVectorizeableLoop()
@@ -626,11 +626,6 @@
         return last_pos
 
     def accumulates_pair(self, lnode, rnode, origin_pack):
-        if isinstance(origin_pack, AccumPair):
-            # in this case the splitted accumulator must
-            # be combined. This case is not supported
-            raise NotAVectorizeableLoop()
-        #
         # lnode and rnode are isomorphic and dependent
         assert isinstance(origin_pack, Pair)
         lop = lnode.getoperation()
diff --git a/rpython/jit/tool/oparser.py b/rpython/jit/tool/oparser.py
--- a/rpython/jit/tool/oparser.py
+++ b/rpython/jit/tool/oparser.py
@@ -239,7 +239,7 @@
         args, descr = self.parse_args(opname, line[num + 1:endnum])
         if rop._GUARD_FIRST <= opnum <= rop._GUARD_LAST:
             i = line.find('[', endnum) + 1
-            j = line.find(']', i)
+            j = line.rfind(']', i)
             if (i <= 0 or j <= 0) and not self.nonstrict:
                 raise ParseError("missing fail_args for guard operation")
             fail_args = []
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to