Commits

Maciej Fijalkowski  committed 6debbdd

disable unrolling for now + fixes

  • Participants
  • Parent commits 3d4afd8
  • Branches resume-refactor

Comments (0)

Files changed (9)

File rpython/jit/metainterp/compile.py

 
     if not loop.quasi_immutable_deps:
         loop.quasi_immutable_deps = None
-    for frame in loop.inputframes:
-        for box in frame:
-            assert isinstance(box, Box)
 
     loop.original_jitcell_token = jitcell_token
     for label in all_target_tokens:
     if quasi_immutable_deps:
         loop.quasi_immutable_deps = quasi_immutable_deps
 
-    for frame in loop.inputframes:
-        for box in frame:
-            assert isinstance(box, Box)
-
     target_token = loop.operations[-1].getdescr()
     resumekey.compile_and_attach(metainterp, loop)
 

File rpython/jit/metainterp/history.py

 
 class TreeLoop(object):
     inputframes = None
+    inputargs = None
     inputlocs = None
     operations = None
     call_pure_results = None

File rpython/jit/metainterp/inliner.py

         args = newop.getarglist()
         newop.initarglist([self.inline_arg(a) for a in args])
 
-        if newop.is_guard():
-            args = newop.getfailargs()
-            if args and not ignore_failargs:
-                newop.setfailargs([self.inline_arg(a) for a in args])
-            else:
-                newop.setfailargs([])
-
         if newop.result and not ignore_result:
             old_result = newop.result
             newop.result = newop.result.clonebox()
             self.argmap[old_result] = newop.result
 
-        self.inline_descr_inplace(newop.getdescr())
-
         return newop
 
-    def inline_descr_inplace(self, descr):
-        from rpython.jit.metainterp.compile import ResumeGuardDescr
-        if isinstance(descr, ResumeGuardDescr):
-            descr.rd_snapshot = self.inline_snapshot(descr.rd_snapshot)
-
     def inline_arg(self, arg):
         if arg is None:
             return None
         if isinstance(arg, Const):
             return arg
         return self.argmap[arg]
-
-    def inline_snapshot(self, snapshot):
-        if snapshot in self.snapshot_map:
-            return self.snapshot_map[snapshot]
-        boxes = [self.inline_arg(a) for a in snapshot.boxes]
-        new_snapshot = Snapshot(self.inline_snapshot(snapshot.prev), boxes)
-        self.snapshot_map[snapshot] = new_snapshot
-        return new_snapshot

File rpython/jit/metainterp/optimizeopt/__init__.py

             ('string', OptString),
             ('earlyforce', OptEarlyForce),
             ('pure', OptPure),
-            ('heap', OptHeap),
-            ('unroll', None)]
+            ('heap', OptHeap)]
 # no direct instantiation of unroll
 unroll_all_opts = unrolling_iterable(ALL_OPTS)
 

File rpython/jit/metainterp/optimizeopt/optimizer.py

         value = self.getvalue(op.getarg(0))
         self.optimizer.opaque_pointers[value] = True
 
+    def optimize_ENTER_FRAME(self, op):
+        self.optimize_default(op)
+
 dispatch_opt = make_dispatcher_method(Optimizer, 'optimize_',
         default=Optimizer.optimize_default)
 

File rpython/jit/metainterp/optimizeopt/unroll.py

         assert self.optimizer.loop.resume_at_jump_descr
         resume_at_jump_descr = self.optimizer.loop.resume_at_jump_descr
         assert isinstance(resume_at_jump_descr, ResumeGuardDescr)
-        resume_at_jump_descr.rd_snapshot = self.fix_snapshot(jump_args, resume_at_jump_descr.rd_snapshot)
 
         modifier = VirtualStateAdder(self.optimizer)
         virtual_state = modifier.get_virtual_state(jump_args)
             op = newoperations[i]
             self.boxes_created_this_iteration[op.result] = None
             args = op.getarglist()
-            if op.is_guard():
-                args = args + op.getfailargs()
             for a in args:
                 self.import_box(a, inputargs, short_jumpargs, [])
             i += 1
 
                 self.boxes_created_this_iteration[op.result] = None
                 args = op.getarglist()
-                if op.is_guard():
-                    args = args + op.getfailargs()
 
                 #if self.optimizer.loop.logops:
                 #    debug_print('OP: ' + self.optimizer.loop.logops.repr_of_resop(op))
                 target_token.assumed_classes[newop.result] = self.short_boxes.assumed_classes[op.result]
             short[i] = newop
         target_token.resume_at_jump_descr = target_token.resume_at_jump_descr
-        inliner.inline_descr_inplace(target_token.resume_at_jump_descr)
 
         # Forget the values to allow them to be freed
         for box in short[0].getarglist():
                                                   'of the bridge does not mach the class ' +
                                                   'it has at the start of the target loop')
                 except InvalidLoop:
-                    #debug_print("Inlining failed unexpectedly",
-                    #            "jumping to preamble instead")
+                    debug_print("Inlining failed unexpectedly",
+                                "jumping to preamble instead")
                     assert cell_token.target_tokens[0].virtual_state is None
                     jumpop.setdescr(cell_token.target_tokens[0])
                     self.optimizer.send_extra_operation(jumpop)

File rpython/jit/metainterp/test/test_loop.py

         assert res == f(6, 13)
         self.check_trace_count(1)
         if self.enable_opts:
-            self.check_resops(setfield_gc=2, getfield_gc=0)
+            self.check_resops(setfield_gc=1, getfield_gc=0)
 
 
     def test_loop_with_two_paths(self):
                 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'])

File rpython/jit/metainterp/test/test_loop_unroll.py

     enable_opts = ALL_OPTS_NAMES
 
     automatic_promotion_result = {
-        'int_gt': 2, 'guard_false': 2, 'jump': 1, 'int_add': 6,
+        'int_gt': 1, 'guard_false': 1, 'jump': 1, 'int_add': 3,
         'guard_value': 1
     }
 

File rpython/rlib/jit.py

     """Inconsistency in the JIT hints."""
 
 ENABLE_ALL_OPTS = (
-    'intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll')
+    'intbounds:rewrite:virtualize:string:earlyforce:pure:heap')
 
 PARAMETER_DOCS = {
     'threshold': 'number of times a loop has to run for it to become hot',