Author: Richard Plangger <planri...@gmail.com> Branch: vecopt-merge Changeset: r79843:658ed0c0b405 Date: 2015-09-25 20:49 +0200 http://bitbucket.org/pypy/pypy/changeset/658ed0c0b405/
Log: some translation issues indicated by test_zjit diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py --- a/pypy/module/micronumpy/test/test_zjit.py +++ b/pypy/module/micronumpy/test/test_zjit.py @@ -18,6 +18,7 @@ return pyjitpl._warmrunnerdesc.metainterp_sd.profiler class TestNumpyJit(Jit386Mixin): + enable_opts = "intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll" graph = None interp = None @@ -97,6 +98,11 @@ backendopt=True, graph_and_interp_only=True, ProfilerClass=Profiler, + translate_support_code=True, + translationoptions={'gc':'minimark', + 'gcrootfinder': 'asmgcc', + 'gcremovetypeptr': False + }, vec=True) self.__class__.interp = interp self.__class__.graph = graph diff --git a/rpython/jit/backend/x86/vector_ext.py b/rpython/jit/backend/x86/vector_ext.py --- a/rpython/jit/backend/x86/vector_ext.py +++ b/rpython/jit/backend/x86/vector_ext.py @@ -99,7 +99,7 @@ else: not_implemented("accum operator %s not implemented" % (accum_info.accum_operation)) - accum_info = accum_info.prev + accum_info = accum_info.next() def _accum_reduce_mul(self, arg, accumloc, targetloc): scratchloc = X86_64_XMM_SCRATCH_REG diff --git a/rpython/jit/metainterp/optimizeopt/vector.py b/rpython/jit/metainterp/optimizeopt/vector.py --- a/rpython/jit/metainterp/optimizeopt/vector.py +++ b/rpython/jit/metainterp/optimizeopt/vector.py @@ -52,6 +52,9 @@ token.original_jitcell_token = jitcell_token jitcell_token.target_tokens.append(token) self.label.setdescr(token) + else: + token = self.jump.getdescr() + assert isinstance(token, TargetToken) if self.prefix_label: token = TargetToken(jitcell_token) token.original_jitcell_token = jitcell_token @@ -102,7 +105,7 @@ user_code = not jitdriver_sd.vec and warmstate.vec_all loop = VectorLoop(loop_info.label_op, loop_ops[1:-1], loop_ops[-1]) if user_code and user_loop_bail_fast_path(loop, warmstate): - return + return loop_info, loop_ops # the original loop (output of optimize_unroll) info = LoopVersionInfo(loop_info) version = info.snapshot(loop) @@ -113,7 +116,7 @@ # start = time.clock() opt = VectorizingOptimizer(metainterp_sd, jitdriver_sd, warmstate.vec_cost) - index_vars = opt.propagate_all_forward(info, loop) + index_vars = opt.run_optimization(info, loop) gso = GuardStrengthenOpt(index_vars) gso.propagate_all_forward(info, loop, user_code) end = time.clock() @@ -144,6 +147,7 @@ llop.debug_print_traceback(lltype.Void) else: raise + return loop_info, loop_ops def user_loop_bail_fast_path(loop, warmstate): """ In a fast path over the trace loop: try to prevent vecopt @@ -200,7 +204,7 @@ self.smallest_type_bytes = 0 self.orig_label_args = None - def propagate_all_forward(self, info, loop): + def run_optimization(self, info, loop): self.orig_label_args = loop.label.getarglist_copy() self.linear_find_smallest_type(loop) byte_count = self.smallest_type_bytes 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 @@ -198,6 +198,12 @@ def get_forwarded(self): return self._forwarded +def vector_repr(self, num): + if self.opnum in (rop.VEC_UNPACK_I, rop.VEC_UNPACK_F): + return self.type + str(num) + return 'v%d[%dx%s%d]' % (num, self.count, self.datatype, + self.bytesize * 8) + class AbstractResOp(AbstractResOpOrInputArg): """The central ResOperation class, representing one operation.""" @@ -308,8 +314,7 @@ num = len(memo) memo[self] = num if self.is_vector(): - assert isinstance(self, VectorOp) - sres = self.vector_repr(num) + ' = ' + sres = vector_repr(self, num) + ' = ' else: sres = self.type + str(num) + ' = ' #if self.result is not None: @@ -339,8 +344,7 @@ num = len(memo) memo[self] = num if self.is_vector(): - assert isinstance(self, VectorOp) - return self.vector_repr(num) + return vector_repr(self, num) return self.type + str(num) def __repr__(self): @@ -714,12 +718,6 @@ class VectorOp(object): _mixin_ = True - def vector_repr(self, num): - if self.opnum in (rop.VEC_UNPACK_I, rop.VEC_UNPACK_F): - return self.type + str(num) - return 'v%d[%dx%s%d]' % (num, self.count, self.datatype, - self.bytesize * 8) - def vector_bytesize(self): assert self.count > 0 return self.byte_size * self.count _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit