Author: Richard Plangger <r...@pasra.at>
Branch: vecopt
Changeset: r78295:5008c5321939
Date: 2015-06-24 15:19 +0200
http://bitbucket.org/pypy/pypy/changeset/5008c5321939/

Log:    rpython translation issues

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
@@ -63,13 +63,27 @@
         end = time.clock()
         metainterp_sd.profiler.count(Counters.OPT_VECTORIZED)
         metainterp_sd.logger_noopt.log_loop(loop.inputargs, loop.operations, 
-2, None, None, "post vectorize")
+        debug_stop("vec-opt-loop")
+        #
+        # XXX
+        ns = int((end-start)*10.0**9)
+        debug_start("xxx-clock")
+        debug_print("vecopt unroll: %d gso count: %d opcount: (%d -> %d) took 
%dns" % \
+                      (opt.unroll_count+1,
+                       gso.strength_reduced,
+                       len(orig_ops),
+                       len(loop.operations),
+                       ns))
+        debug_stop("xxx-clock")
     except NotAVectorizeableLoop:
         # vectorization is not possible
         loop.operations = orig_ops
+        debug_stop("vec-opt-loop")
     except NotAProfitableLoop:
         # cost model says to skip this loop
         loop.operations = orig_ops
     except Exception as e:
+        debug_stop("vec-opt-loop")
         loop.operations = orig_ops
         debug_print("failed to vectorize loop. THIS IS A FATAL ERROR!")
         if we_are_translated():
@@ -78,20 +92,6 @@
             llop.debug_print_traceback(lltype.Void)
         else:
             raise
-    finally:
-        debug_stop("vec-opt-loop")
-        #
-        # XXX
-        if start > 0 and end > 0:
-            ns = int((end-start)*10.0**9)
-            debug_start("xxx-clock")
-            debug_print("vecopt unroll: %d gso count: %d opcount: (%d -> %d) 
took %dns" % \
-                          (opt.unroll_count+1,
-                           gso.strength_reduced,
-                           len(orig_ops),
-                           len(loop.operations),
-                           ns))
-            debug_stop("xxx-clock")
 
 
 class VectorizingOptimizer(Optimizer):
diff --git a/rpython/jit/metainterp/resoperation.py 
b/rpython/jit/metainterp/resoperation.py
--- a/rpython/jit/metainterp/resoperation.py
+++ b/rpython/jit/metainterp/resoperation.py
@@ -213,7 +213,9 @@
         _, _, to_type, size = self.casts
         if self.casts[3] == 0:
             if self.getopnum() == rop.INT_SIGNEXT:
+                from rpython.jit.metainterp.history import ConstInt
                 arg = self.getarg(1)
+                assert isinstance(arg, ConstInt)
                 return (to_type,arg.value)
             else:
                 raise NotImplementedError
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to