Author: Maciej Fijalkowski <[email protected]>
Branch: resume-refactor
Changeset: r68976:36ccb35831a5
Date: 2014-01-28 13:42 +0100
http://bitbucket.org/pypy/pypy/changeset/36ccb35831a5/

Log:    reenable loop unrolling

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
@@ -19,7 +19,8 @@
             ('string', OptString),
             ('earlyforce', OptEarlyForce),
             ('pure', OptPure),
-            ('heap', OptHeap)]
+            ('heap', OptHeap),
+            ('unroll', None)]
 # no direct instantiation of unroll
 unroll_all_opts = unrolling_iterable(ALL_OPTS)
 
diff --git a/rpython/jit/metainterp/test/test_loop.py 
b/rpython/jit/metainterp/test/test_loop.py
--- a/rpython/jit/metainterp/test/test_loop.py
+++ b/rpython/jit/metainterp/test/test_loop.py
@@ -60,7 +60,7 @@
         assert res == f(6, 13)
         self.check_trace_count(1)
         if self.enable_opts:
-            self.check_resops(setfield_gc=1, getfield_gc=0)
+            self.check_resops(setfield_gc=2, getfield_gc=0)
 
 
     def test_loop_with_two_paths(self):
@@ -107,10 +107,10 @@
                 pattern >>= 1
             return 42
         self.meta_interp(f, [0xF0F0F0])
-        #if self.enable_opts:
-        #    self.check_trace_count(3)
-        #else:
-        self.check_trace_count(2)
+        if self.enable_opts:
+            self.check_trace_count(3)
+        else:
+            self.check_trace_count(2)
 
     def test_interp_simple(self):
         myjitdriver = JitDriver(greens = ['i'], reds = ['x', 'y'])
@@ -189,6 +189,10 @@
             found = 0
             for op in get_stats().loops[0]._all_operations():
                 if op.getopname() == 'guard_true':
+                    liveboxes = op.getfailargs()
+                    assert len(liveboxes) == 2     # x, y (in some order)
+                    assert isinstance(liveboxes[0], history.BoxInt)
+                    assert isinstance(liveboxes[1], history.BoxInt)
                     found += 1
             if 'unroll' in self.enable_opts:
                 assert found == 2
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -437,7 +437,7 @@
     """Inconsistency in the JIT hints."""
 
 ENABLE_ALL_OPTS = (
-    'intbounds:rewrite:virtualize:string:earlyforce:pure:heap')
+    'intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll')
 
 PARAMETER_DOCS = {
     'threshold': 'number of times a loop has to run for it to become hot',
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to