[pypy-commit] pypy optresult-unroll: skip unrolling if the cpu does not support guard_gc_type
fijal
noreply at buildbot.pypy.org
Tue Sep 8 10:26:40 CEST 2015
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: optresult-unroll
Changeset: r79517:0494002efd6d
Date: 2015-09-08 10:14 +0200
http://bitbucket.org/pypy/pypy/changeset/0494002efd6d/
Log: skip unrolling if the cpu does not support guard_gc_type
diff --git a/rpython/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -1049,6 +1049,7 @@
info, newops = optimize_trace(metainterp_sd, jitdriver_sd,
data, metainterp.box_names_memo)
except InvalidLoop:
+ #pdb.post_mortem(sys.exc_info()[2])
debug_print("compile_new_bridge: got an InvalidLoop")
# XXX I am fairly convinced that optimize_bridge cannot actually raise
# InvalidLoop
diff --git a/rpython/jit/metainterp/optimizeopt/__init__.py b/rpython/jit/metainterp/optimizeopt/__init__.py
--- a/rpython/jit/metainterp/optimizeopt/__init__.py
+++ b/rpython/jit/metainterp/optimizeopt/__init__.py
@@ -33,6 +33,8 @@
def build_opt_chain(metainterp_sd, enable_opts):
optimizations = []
unroll = 'unroll' in enable_opts # 'enable_opts' is normally a dict
+ if not metainterp_sd.cpu.supports_guard_gc_type:
+ unroll = False
for name, opt in unroll_all_opts:
if name in enable_opts:
if opt is not None:
@@ -40,8 +42,7 @@
optimizations.append(o)
if ('rewrite' not in enable_opts or 'virtualize' not in enable_opts
- or 'heap' not in enable_opts or 'unroll' not in enable_opts
- or 'pure' not in enable_opts):
+ or 'heap' not in enable_opts or 'pure' not in enable_opts):
optimizations.append(OptSimplify(unroll))
return optimizations, unroll
diff --git a/rpython/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py
--- a/rpython/jit/metainterp/test/test_ajit.py
+++ b/rpython/jit/metainterp/test/test_ajit.py
@@ -2772,9 +2772,9 @@
raise InvalidLoop
old_optimize_trace = optimizeopt.optimize_trace
optimizeopt.optimize_trace = my_optimize_trace
- if not self.basic:
- py.test.skip("unrolling")
try:
+ if not self.basic:
+ py.test.skip("unrolling")
res = self.meta_interp(f, [23, 4])
assert res == 23
assert False in seen
More information about the pypy-commit
mailing list