Commits

Hakan Ardo committed 3863f50

simple example where we generate 8 identical copies of the same birdge

Comments (0)

Files changed (1)

pypy/jit/metainterp/test/test_ajit.py

         assert self.meta_interp(f, [20, 20, 10]) == f(20, 20, 10)
         self.check_tree_loop_count(2)
 
+    def test_excessive_bridgeing(self):
+        myjitdriver = JitDriver(greens = [], reds = ['n', 'i', 'sa'])
+
+        def f(n):
+            sa = i = 0
+            while i < n:
+                myjitdriver.jit_merge_point(n=n, i=i, sa=sa)
+                if i & 8:
+                    sa += 2
+                if i & 16:
+                    sa += 3
+                if i & 32:
+                    sa *= 3
+                i += 1
+            return sa
+        assert self.meta_interp(f, [64]) == f(64)
+        self.check_loop_count(15)
+        self.check_loops(int_mul=8, everywhere=True)
 
     def test_retrace_limit_with_extra_guards(self):
         myjitdriver = JitDriver(greens = [], reds = ['n', 'i', 'sa', 'a',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.