Author: Richard Plangger <r...@pasra.at>
Branch: vecopt2
Changeset: r77129:c9ea863cdc2d
Date: 2015-05-01 10:44 +0200
http://bitbucket.org/pypy/pypy/changeset/c9ea863cdc2d/

Log:    guard_early_exit are not passed to the backend. vectorize tests all
        pass again

diff --git a/rpython/jit/metainterp/optimizeopt/rewrite.py 
b/rpython/jit/metainterp/optimizeopt/rewrite.py
--- a/rpython/jit/metainterp/optimizeopt/rewrite.py
+++ b/rpython/jit/metainterp/optimizeopt/rewrite.py
@@ -559,6 +559,9 @@
     def optimize_GUARD_FUTURE_CONDITION(self, op):
         pass # just remove it
 
+    def optimize_GUARD_EARLY_EXIT(self, op):
+        pass # just remove it
+
     def optimize_INT_FLOORDIV(self, op):
         v1 = self.getvalue(op.getarg(0))
         v2 = self.getvalue(op.getarg(1))
diff --git a/rpython/jit/metainterp/optimizeopt/simplify.py 
b/rpython/jit/metainterp/optimizeopt/simplify.py
--- a/rpython/jit/metainterp/optimizeopt/simplify.py
+++ b/rpython/jit/metainterp/optimizeopt/simplify.py
@@ -65,8 +65,8 @@
     def optimize_GUARD_FUTURE_CONDITION(self, op):
         pass
 
-    #def optimize_GUARD_EARLY_EXIT(self, op):
-    #    pass
+    def optimize_GUARD_EARLY_EXIT(self, op):
+        pass
 
 dispatch_opt = make_dispatcher_method(OptSimplify, 'optimize_',
         default=OptSimplify.emit_operation)
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
@@ -102,7 +102,6 @@
         opt.combine_packset()
         opt.schedule()
         opt.collapse_index_guards()
-        self._do_optimize_loop(loop, {}, export_state=False)
         return opt
 
     def assert_unroll_loop_equals(self, loop, expected_loop, \
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
@@ -109,8 +109,8 @@
         self.collapse_index_guards()
 
     def emit_operation(self, op):
-        #if op.getopnum() == rop.GUARD_EARLY_EXIT or \
-        if op.getopnum() == rop.DEBUG_MERGE_POINT:
+        if op.getopnum() == rop.GUARD_EARLY_EXIT or \
+           op.getopnum() == rop.DEBUG_MERGE_POINT:
             return
         self._last_emitted_op = op
         self._newoperations.append(op)
@@ -131,11 +131,13 @@
         jump_op = loop.operations[op_count-1]
         # use the target token of the label
         assert jump_op.getopnum() in (rop.LABEL, rop.JUMP)
+        target_token = label_op.getdescr()
+        target_token.assumed_classes = {}
         if jump_op.getopnum() == rop.LABEL:
-            jump_op = ResOperation(rop.JUMP, jump_op.getarglist(), None, 
label_op.getdescr())
+            jump_op = ResOperation(rop.JUMP, jump_op.getarglist(), None, 
target_token)
         else:
             jump_op = jump_op.clone()
-            #jump_op.setdescr(label_op.getdescr())
+            jump_op.setdescr(target_token)
         assert jump_op.is_final()
 
         self.emit_unrolled_operation(label_op)
diff --git a/rpython/jit/metainterp/pyjitpl.py 
b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -2317,6 +2317,10 @@
         frame = self.framestack[-1]
         if opnum == rop.GUARD_FUTURE_CONDITION:
             pass
+        elif opnum == rop.GUARD_EARLY_EXIT:
+            # prevents it from building a bridge
+            # TODO
+            self.resumekey_original_loop_token = None
         elif opnum == rop.GUARD_TRUE:     # a goto_if_not that jumps only now
             frame.pc = frame.jitcode.follow_jump(frame.pc)
         elif opnum == rop.GUARD_FALSE:     # a goto_if_not that stops jumping;
diff --git a/rpython/jit/metainterp/test/test_vectorize.py 
b/rpython/jit/metainterp/test/test_vectorize.py
--- a/rpython/jit/metainterp/test/test_vectorize.py
+++ b/rpython/jit/metainterp/test/test_vectorize.py
@@ -15,6 +15,9 @@
 class VectorizeTests:
     enable_opts = 
'intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll'
 
+    def setup_method(self, method):
+        print "RUNNING", method.__name__
+
     def meta_interp(self, f, args, policy=None):
         return ll_meta_interp(f, args, enable_opts=self.enable_opts,
                               policy=policy,
@@ -92,7 +95,7 @@
             return res
         res = self.meta_interp(f, [i])
         assert res == f(i)
-        if i > 4:
+        if 4 < i:
             self.check_trace_count(1)
 
 class VectorizeLLtypeTests(VectorizeTests):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to