[pypy-svn] r23376 - in pypy/dist/pypy: doc/discussion jit jit/test rpython rpython/test

pedronis at codespeak.net pedronis at codespeak.net
Wed Feb 15 19:55:33 CET 2006


Author: pedronis
Date: Wed Feb 15 19:55:28 2006
New Revision: 23376

Modified:
   pypy/dist/pypy/doc/discussion/draft-jit-ideas.txt
   pypy/dist/pypy/jit/hintrtyper.py
   pypy/dist/pypy/jit/hinttimeshift.py
   pypy/dist/pypy/jit/llabstractinterp.py
   pypy/dist/pypy/jit/llvalue.py
   pypy/dist/pypy/jit/rtimeshift.py
   pypy/dist/pypy/jit/test/test_hint_timeshift.py
   pypy/dist/pypy/rpython/rgenop.py
   pypy/dist/pypy/rpython/test/test_rgenop.py
   pypy/dist/pypy/rpython/test/test_rlist.py
Log:
(arre, pedronis)

implemented proper new block creation logic in enter_block. merge logic is still not there,
just calling enter_block for now.

Refactored rgenop interface to take wrapped constant lltypes, for convenience writing 
enter_block. Notice that constTYPE can be called insided rtyped functions so this is not
too bad.

Now the timeshifted functions return a jitstate with attached a curvale redbox (either 
constant or with a variable in it)

everything is very much in flux.



Modified: pypy/dist/pypy/doc/discussion/draft-jit-ideas.txt
==============================================================================
--- pypy/dist/pypy/doc/discussion/draft-jit-ideas.txt	(original)
+++ pypy/dist/pypy/doc/discussion/draft-jit-ideas.txt	Wed Feb 15 19:55:28 2006
@@ -94,9 +94,9 @@
 
 * newblock() -> (opaque block object)
 
-* geninputarg(block, CONCRETE_TYPE) -> (input var)
+* geninputarg(block, consTYPE(CONCRETE_TYPE)) -> (input var)
 
-* genop(block, opname, [list-of-vars], RESULT_CONCRETE_TYPE) -> (result var)
+* genop(block, opname, [list-of-vars], constTYPE(RESULT_CONCRETE_TYPE)) -> (result var)
 
 * genconst(llvalue) -> (result var) # not for Void consts
 
@@ -106,7 +106,7 @@
 
 * placeholder(dummy)   # likely ignored Void constant, likely not runtime
 
-* gencallableconst(block, name, target-block, FUNCTYPE) -> (result var)
+* gencallableconst(block, name, target-block, constTYPE(FUNCTYPE)) -> (result var)
 
 * closeblock1(block) -> link
 

Modified: pypy/dist/pypy/jit/hintrtyper.py
==============================================================================
--- pypy/dist/pypy/jit/hintrtyper.py	(original)
+++ pypy/dist/pypy/jit/hintrtyper.py	Wed Feb 15 19:55:28 2006
@@ -206,6 +206,7 @@
 class GreenRepr(Repr):
     def __init__(self, lowleveltype):
         self.lowleveltype = lowleveltype
+        self.original_concretetype = lowleveltype        
 
     def annotation(self):
         return annmodel.lltype_to_annotation(self.lowleveltype)

Modified: pypy/dist/pypy/jit/hinttimeshift.py
==============================================================================
--- pypy/dist/pypy/jit/hinttimeshift.py	(original)
+++ pypy/dist/pypy/jit/hinttimeshift.py	Wed Feb 15 19:55:28 2006
@@ -2,7 +2,8 @@
 from pypy.objspace.flow import model as flowmodel
 from pypy.annotation import model as annmodel
 from pypy.annotation import listdef, dictdef
-from pypy.jit.rtimeshift import STATE_PTR, REDBOX_PTR
+from pypy.jit.rtimeshift import STATE_PTR, REDBOX_PTR, VARLIST
+from pypy.jit.rtimeshift import make_types_const
 from pypy.rpython import rmodel, rtuple, rlist, rdict
 from pypy.jit import rtimeshift
 from pypy.jit.hintrtyper import HintRTyper, s_JITState, originalconcretetype
@@ -60,7 +61,13 @@
             for link in block.exits:
                 if link.target.operations != ():
                     link.args.insert(0, v_jitstate)
-
+                elif len(link.args) == 1: # pass the jitstate instead of the return value
+                                          # to the return block!
+                    link.args[0] = v_jitstate
+                    v_returnjitstate = flowmodel.Variable('jitstate')                    
+                    self.hannotator.bindings[v_returnjitstate] = s_JITState
+                    link.target.inputargs = [v_returnjitstate]
+                    
     def insert_before_block(self, block, entering_links):
         newinputargs = []
         for var in block.inputargs:
@@ -92,53 +99,72 @@
 
         s_box_list = annmodel.SomeList(listdef.ListDef(None,
                                                        annmodel.SomePtr(REDBOX_PTR)))
+        TYPES = []
         boxes_v = []
         for r, newvar in zip(args_r, newinputargs):
             if isinstance(r, RedRepr):
-                boxes_v.append(newvar)              
+                boxes_v.append(newvar)
+                TYPES.append(r.original_concretetype)                
         getrepr = self.rtyper.getrepr
 
         r_box_list = getrepr(s_box_list)
         r_box_list.setup()        
         v_boxes = rlist.newlist(llops, r_box_list, boxes_v)
+        c_TYPES = rmodel.inputconst(VARLIST, make_types_const(TYPES))        
+
 
         if nentrylinks > 1:
-            v_newjiststate = self.bookeeping_enter_for_join(args_r,
-                                                            newinputargs,
-                                                            llops,
-                                                            s_box_list,
-                                                            v_boxes)
+            enter_block_logic = self.bookkeeping_enter_for_join
         else:
-            v_newjiststate = newinputargs[0]
+            enter_block_logic = self.bookkeeping_enter_simple
 
 
+        # fill the block with logic
+        v_newjitstate = enter_block_logic(args_r, newinputargs,
+                                          llops,
+                                          s_box_list, v_boxes,
+                                          c_TYPES)
+
+        def read_out_box(i):
+            c_dum_nocheck = rmodel.inputconst(lltype.Void, rlist.dum_nocheck)
+            c_i = rmodel.inputconst(lltype.Signed, i)
+            v_box = llops.gendirectcall(rlist.ll_getitem_nonneg,
+                                        c_dum_nocheck,
+                                        v_boxes,
+                                        c_i)
+            return v_box
+            
+
         bridge = before_block.exits[0]
-        if bridge.target.operations != (): # don't pass the jistate to the return block
-            newinputargs2 = [v_newjiststate]
-        else:
-            newinputargs2 = []
-        i = 0
-        for r, newvar in zip(args_r[1:], newinputargs[1:]):
-            if isinstance(r, RedRepr):
-                c_dum_nocheck = rmodel.inputconst(lltype.Void, rlist.dum_nocheck)
-                c_i = rmodel.inputconst(lltype.Signed, i)
-                v_box = llops.gendirectcall(rlist.ll_getitem_nonneg,
-                                            c_dum_nocheck,
-                                            v_boxes,
-                                            c_i)
-                newinputargs2.append(v_box)
-                i += 1
+        newinputargs2 = [v_newjitstate]
+        if bridge.target.operations == (): # special case the return block
+            # XXX maybe better to return a tuple (state, value)?
+            c_curvalue = rmodel.inputconst(lltype.Void, "curvalue")
+            if isinstance(args_r[1], GreenRepr):
+                v_value = llops.gendirectcall(rtimeshift.REDBOX.ll_make_from_const,
+                                              newinputargs[1])
             else:
-                newinputargs2.append(newvar)
+                v_value = read_out_box(0)
+            llops.genop('setfield', [v_newjitstate, c_curvalue, v_value])
+        else:
+            i = 0
+            for r, newvar in zip(args_r[1:], newinputargs[1:]):
+                if isinstance(r, RedRepr):
+                    newinputargs2.append(read_out_box(i))
+                    i += 1
+                else:
+                    newinputargs2.append(newvar)
 
         # patch before block and bridge
         before_block.operations[:] = llops
         bridge.args = newinputargs2 # patch the link
 
-    def bookeeping_enter_simple(self, args_r, newinputargs, llops, s_box_list, v_boxes):
+    def bookkeeping_enter_simple(self, args_r, newinputargs, llops, s_box_list, v_boxes,
+                                c_TYPES):
         v_newjiststate = llops.genmixlevelhelpercall(rtimeshift.enter_block,
-                             [annmodel.SomePtr(STATE_PTR), s_box_list],
-                             [newinputargs[0], v_boxes])
+                             [annmodel.SomePtr(STATE_PTR), s_box_list,
+                              annmodel.SomePtr(VARLIST)],
+                             [newinputargs[0], v_boxes, c_TYPES])
         return v_newjiststate
         
 
@@ -153,7 +179,8 @@
     # ll_retrieve_jitstate_for_merge is supposed to use the "constant" dict as cache
     # mapping green values combinations to frozen states for red boxes values
     # and generated blocks
-    def bookeeping_enter_for_join(self, args_r, newinputargs, llops, s_box_list, v_boxes):
+    def bookkeeping_enter_for_join(self, args_r, newinputargs, llops, s_box_list, v_boxes,
+                                  c_TYPES):
         getrepr = self.rtyper.getrepr        
         items_s = []
         key_v = []
@@ -188,8 +215,9 @@
 
 
         v_newjiststate = llops.genmixlevelhelpercall(rtimeshift.retrieve_jitstate_for_merge,
-                             [s_state_dic, annmodel.SomePtr(STATE_PTR), s_key_tuple, s_box_list],
-                             [c_state_dic, newinputargs[0], v_key, v_boxes])
+                             [s_state_dic, annmodel.SomePtr(STATE_PTR), s_key_tuple, s_box_list,
+                              annmodel.SomePtr(VARLIST)],
+                             [c_state_dic, newinputargs[0], v_key, v_boxes, c_TYPES])
         return v_newjiststate
         
         
@@ -207,12 +235,24 @@
                     vprime.concretetype = v.concretetype
                     inargs.append(v)
 
+        orig_v_jitstate = block.inputargs[0]
+        introduce(orig_v_jitstate)
+
         newlinks = []
 
+        v_newjitstate = flowmodel.Variable('jitstate')
+        v_newjitstate.concretetype = STATE_PTR
+
+        def rename_on_link(v):
+            if v is orig_v_jitstate:
+                return v_newjitstate
+            else:
+                return rename(v)
+
         for link in block.exits:
             for v in link.args:
                 introduce(v)
-            newlink =  link.copy(rename)
+            newlink =  link.copy(rename_on_link)
             newlinks.append(newlink)
             target = link.target
             # update entering_links as necessary
@@ -232,6 +272,18 @@
         block.exitswitch = None
         block.recloseblock(inlink)
 
+        llops = HintLowLevelOpList(self, None)
+
+        v_res = llops.genmixlevelhelpercall(rtimeshift.leave_block,
+                                            [annmodel.SomePtr(STATE_PTR)],
+                                            [rename(orig_v_jitstate)])     
+
+        llops.append(flowmodel.SpaceOperation('same_as',
+                               [v_res],
+                               v_newjitstate))
+
+        newblock.operations[:] = llops
+
     def timeshift_block(self, block):
         self.hrtyper.specialize_block(block)
 

Modified: pypy/dist/pypy/jit/llabstractinterp.py
==============================================================================
--- pypy/dist/pypy/jit/llabstractinterp.py	(original)
+++ pypy/dist/pypy/jit/llabstractinterp.py	Wed Feb 15 19:55:28 2006
@@ -536,7 +536,8 @@
         return b
 
     def genop(self, opname, args, RESULT_TYPE):
-        return rgenop.genop(self.newblock, opname, args, RESULT_TYPE)
+        return rgenop.genop(self.newblock, opname, args,
+                            rgenop.constTYPE(RESULT_TYPE))
 
     def genconst(self, llvalue):
         return rgenop.genconst(llvalue)
@@ -593,7 +594,7 @@
         gen_fn_const = rgenop.gencallableconst(self.newblock,
                                                name,
                                                target,
-                                               FUNCTYPE)
+                                               rgenop.constTYPE(FUNCTYPE))
         retvar = self.genop('direct_call', [gen_fn_const] +
                               [a.forcegenvarorconst(self) for a in args_a],
                               T)

Modified: pypy/dist/pypy/jit/llvalue.py
==============================================================================
--- pypy/dist/pypy/jit/llvalue.py	(original)
+++ pypy/dist/pypy/jit/llvalue.py	Wed Feb 15 19:55:28 2006
@@ -200,7 +200,7 @@
             assert c.concretetype == self.concretetype
             result = LLAbstractValue(c)
         else:
-            gen_v = rgenop.geninputarg(block, self.concretetype)
+            gen_v = rgenop.geninputarg(block, rgenop.constTYPE(self.concretetype))
             result = LLAbstractValue(AVariable(self.concretetype, genvar=gen_v))
         result.origin.append(self)
         return result

Modified: pypy/dist/pypy/jit/rtimeshift.py
==============================================================================
--- pypy/dist/pypy/jit/rtimeshift.py	(original)
+++ pypy/dist/pypy/jit/rtimeshift.py	Wed Feb 15 19:55:28 2006
@@ -3,18 +3,26 @@
 from pypy.rpython import rgenop
 
 # ____________________________________________________________
-# types and adts
+# types and adtmeths
 
 def ll_fixed_items(l):
     return l
 
+def ll_fixed_length(l):
+    return len(l)
+
 VARLIST = lltype.Ptr(lltype.GcArray(rgenop.CONSTORVAR,
                                     adtmeths = {
                                         "ll_items": ll_fixed_items,
+                                        "ll_length": ll_fixed_length
                                     }))
 
-STATE = lltype.GcStruct("jitstate", ("curblock", rgenop.BLOCK))
-STATE_PTR = lltype.Ptr(STATE)
+def make_types_const(TYPES):
+    n = len(TYPES)
+    l = lltype.malloc(VARLIST.TO, n)
+    for i in range(n):
+        l[i] = rgenop.constTYPE(TYPES[i])
+    return l
 
 
 def ll_make_for_gvar(gvar):
@@ -49,6 +57,12 @@
                                     ("value", lltype.Signed))
 REDBOX_FOR_SIGNED_PTR = lltype.Ptr(REDBOX_FOR_SIGNED)
 
+STATE = lltype.GcStruct("jitstate", ("curblock", rgenop.BLOCK),
+                                    ("curoutgoinglink", rgenop.LINK),
+                                    ("curvalue", REDBOX_PTR))
+STATE_PTR = lltype.Ptr(STATE)
+
+
 # ____________________________________________________________
 # ll helpers on boxes
 
@@ -117,7 +131,8 @@
         return REDBOX.ll_make_from_const(res)
     op_args = lltype.malloc(VARLIST.TO, 1)
     op_args[0] = ll_gvar_from_redbox(jitstate, argbox, ARG0)
-    gvar = rgenop.genop(jitstate.curblock, opdesc.opname, op_args, RESULT)
+    gvar = rgenop.genop(jitstate.curblock, opdesc.opname, op_args,
+                        rgenop.constTYPE(RESULT))
     return REDBOX.ll_make_for_gvar(gvar)
 
 def ll_generate_operation2(opdesc, jitstate, argbox0, argbox1):
@@ -133,7 +148,8 @@
     op_args = lltype.malloc(VARLIST.TO, 2)
     op_args[0] = ll_gvar_from_redbox(jitstate, argbox0, ARG0)
     op_args[1] = ll_gvar_from_redbox(jitstate, argbox1, ARG1)
-    gvar = rgenop.genop(jitstate.curblock, opdesc.opname, op_args, RESULT)
+    gvar = rgenop.genop(jitstate.curblock, opdesc.opname, op_args,
+                        rgenop.constTYPE(RESULT))
     return REDBOX.ll_make_for_gvar(gvar)
 
 #def ll_generate_operation(jitstate, opname, args, RESULTTYPE):
@@ -144,19 +160,27 @@
 # other jitstate/graph level operations
 
 
-# XXX dummy for now, playing with mix level annotation
-def retrieve_jitstate_for_merge(states_dic, jitstate, key, redboxes):
-    # modifies redbox in place
-    states_dic[key] = redboxes
-    # fun playing junk
-    if not redboxes[0].isvar and redboxes[0].ll_getvalue(lltype.Signed) == 0:
-        redboxes[0] = redboxes[0]
-    return jitstate # XXX
+# XXX dummy for now, no appropriate caching, just call enter_block
+def retrieve_jitstate_for_merge(states_dic, jitstate, key, redboxes, TYPES):
+    return enter_block(jitstate, redboxes, TYPES)
 retrieve_jitstate_for_merge._annspecialcase_ = "specialize:arglltype2"
     
-# XXX dummy for now
-def enter_block(jistate, redboxes):
-    # XXX do more
+def enter_block(jitstate, redboxes, TYPES):
+    newblock = rgenop.newblock()
+    incoming = []
+    for i in range(len(redboxes)):
+        redbox = redboxes[i]
+        if redbox.isvar:
+            incoming.append(redbox.genvar)
+            newgenvar = rgenop.geninputarg(newblock, TYPES[i])
+            redboxes[i] = REDBOX.ll_make_for_gvar(newgenvar)
+    rgenop.closelink(jitstate.curoutgoinglink, incoming, newblock)
+    jitstate.curblock = newblock
+    jitstate.curoutgoinglink = lltype.nullptr(rgenop.LINK.TO)
+    return jitstate
+
+def leave_block(jitstate):
+    jitstate.curoutgoinglink = rgenop.closeblock1(jitstate.curblock)
     return jitstate
 
 def ll_setup_jitstate():
@@ -164,11 +188,14 @@
     jitstate.curblock = rgenop.newblock()
     return jitstate
 
-def ll_close_jitstate(jitstate, return_gvar):
-    link = rgenop.closeblock1(jitstate.curblock)
+def ll_end_setup_jitstate(jitstate):
+    jitstate.curoutgoinglink = rgenop.closeblock1(jitstate.curblock)
+
+def ll_close_jitstate(final_jitstate, return_gvar):
+    link = rgenop.closeblock1(final_jitstate.curblock)
     rgenop.closereturnlink(link, return_gvar)
-    return jitstate.curblock
 
 def ll_input_redbox(jitstate, TYPE):
-    genvar = rgenop.geninputarg(jitstate.curblock, TYPE)
+    genvar = rgenop.geninputarg(jitstate.curblock,
+                                rgenop.constTYPE(TYPE))
     return REDBOX.ll_make_for_gvar(genvar)

Modified: pypy/dist/pypy/jit/test/test_hint_timeshift.py
==============================================================================
--- pypy/dist/pypy/jit/test/test_hint_timeshift.py	(original)
+++ pypy/dist/pypy/jit/test/test_hint_timeshift.py	Wed Feb 15 19:55:28 2006
@@ -65,18 +65,16 @@
                 box = rtimeshift.REDBOX.ll_make_from_const(llvalue)
             graph1args.append(box)
             residual_graph_args.append(llvalue)
+    rtimeshift.ll_end_setup_jitstate(jitstate)
+    startblock = jitstate.curblock
     llinterp = LLInterpreter(rtyper)
-    result1 = llinterp.eval_graph(graph1, graph1args)
-    # now try to run the block produced by the jitstate
-    r = htshift.hrtyper.bindingrepr(graph1.getreturnvar())
-    if isinstance(r, hintrtyper.GreenRepr):
-        result_gvar = rgenop.genconst(result1)
-    elif isinstance(r, hintrtyper.RedRepr):
-        result_gvar = rtimeshift.ll_gvar_from_redbox(jitstate, result1, r.original_concretetype)
-    else:
-        raise NotImplementedError(r)
-    jitblock = rtimeshift.ll_close_jitstate(jitstate, result_gvar)
-    residual_graph = rgenop.buildgraph(jitblock)
+    newjitstate = llinterp.eval_graph(graph1, graph1args)
+    # now try to run the blocks produced by the jitstate
+    r = htshift.hrtyper.getrepr(hs)
+    result_gvar = rtimeshift.ll_gvar_from_redbox(newjitstate, newjitstate.curvalue,
+                                                 r.original_concretetype)
+    rtimeshift.ll_close_jitstate(newjitstate, result_gvar)
+    residual_graph = rgenop.buildgraph(startblock)
     insns = summary(residual_graph)
     res = rgenop.testgengraph(residual_graph, residual_graph_args,
                               viewbefore = conftest.option.view)
@@ -122,7 +120,7 @@
     assert res == -5
     assert insns == {}
 
-def test_loop_merge():
+def test_loop_folding():
     def ll_function(x, y):
         tot = 0
         x = hint(x, concrete=True)        
@@ -132,5 +130,4 @@
         return tot
     insns, res = timeshift(ll_function, [7, 2], [0, 1])
     assert res == 14
-    # not really testing merge logic properly, we would need both a split
-    # (on a red exitswitch) and a join for that, just that the new code doesn't explode
+    assert insns == {}

Modified: pypy/dist/pypy/rpython/rgenop.py
==============================================================================
--- pypy/dist/pypy/rpython/rgenop.py	(original)
+++ pypy/dist/pypy/rpython/rgenop.py	Wed Feb 15 19:55:28 2006
@@ -23,8 +23,9 @@
     initblock(blockcontainer.obj)
     return blockcontainer
 
-def geninputarg(blockcontainer, CONCRETE_TYPE):
+def geninputarg(blockcontainer, cvCONCRETE_TYPE):
     block = from_opaque_object(blockcontainer.obj)
+    CONCRETE_TYPE = from_opaque_object(cvCONCRETE_TYPE).value
     v = flowmodel.Variable()
     v.concretetype = CONCRETE_TYPE
     block.inputargs.append(v)
@@ -32,19 +33,23 @@
 
 def _inputvars(vars):
     if not isinstance(vars, list):
-        vars = vars.ll_items()
+        n = vars.ll_length()
+        vars = vars.ll_items()        
+    else:
+        n = len(vars)
     res = []
-    for v in vars:
-        v = from_opaque_object(v)
+    for i in range(n):
+        v = from_opaque_object(vars[i])
         assert isinstance(v, (flowmodel.Constant, flowmodel.Variable))
         res.append(v)
     return res
 
 # is opname a runtime value?
-def genop(blockcontainer, opname, vars, RESULT_TYPE):
+def genop(blockcontainer, opname, vars, cvRESULT_TYPE):
     if not isinstance(opname, str):
         opname = from_rstr(opname)
-    block = from_opaque_object(blockcontainer.obj) 
+    block = from_opaque_object(blockcontainer.obj)
+    RESULT_TYPE = from_opaque_object(cvRESULT_TYPE).value
     opvars = _inputvars(vars)    
     v = flowmodel.Variable()
     v.concretetype = RESULT_TYPE
@@ -52,9 +57,10 @@
     block.operations.append(op)
     return to_opaque_object(v)
 
-def gencallableconst(blockcontainer, name, targetcontainer, FUNCTYPE):
+def gencallableconst(blockcontainer, name, targetcontainer, cvFUNCTYPE):
     # is name useful, is it runtime variable?
     target = from_opaque_object(targetcontainer.obj)
+    FUNCTYPE = from_opaque_object(cvFUNCTYPE).value
     fptr = lltype.functionptr(FUNCTYPE, name,
                               graph=_buildgraph(target))
     return genconst(fptr)

Modified: pypy/dist/pypy/rpython/test/test_rgenop.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rgenop.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rgenop.py	Wed Feb 15 19:55:28 2006
@@ -8,8 +8,8 @@
 def build_square():
     """def square(v0): return v0*v0"""
     block = newblock()
-    v0 = geninputarg(block, Signed)
-    v1 = genop(block, 'int_mul', [v0, v0], Signed)
+    v0 = geninputarg(block, constTYPE(Signed))
+    v1 = genop(block, 'int_mul', [v0, v0], constTYPE(Signed))
     link = closeblock1(block)
     closereturnlink(link, v1)
     return block
@@ -29,7 +29,7 @@
 def test_rtype_geninputarg():
     def onearg():
         block = newblock()
-        v0 = geninputarg(block, Signed)
+        v0 = geninputarg(block, constTYPE(Signed))
         return v0
     opaquev = interpret(onearg, [])
     v = from_opaque_object(opaquev)
@@ -49,9 +49,9 @@
             return v0
     """
     block = newblock()
-    v0 = geninputarg(block, Signed)
+    v0 = geninputarg(block, constTYPE(Signed))
     const0 = genconst(0)
-    v1 = genop(block, 'int_lt', [v0, const0], Bool)
+    v1 = genop(block, 'int_lt', [v0, const0], constTYPE(Bool))
     exitspair = closeblock2(block, v1)
     false_link, true_link = exitspair.item0, exitspair.item1
     closereturnlink(true_link, const0)
@@ -83,18 +83,18 @@
         return result
     """
     block = newblock()
-    v0 = geninputarg(block, Signed)
+    v0 = geninputarg(block, constTYPE(Signed))
     const1 = genconst(1)
     link = closeblock1(block)
     loopblock = newblock()
-    result0 = geninputarg(loopblock, Signed)
-    i0 = geninputarg(loopblock, Signed)
-    v1 = geninputarg(loopblock, Signed)
+    result0 = geninputarg(loopblock, constTYPE(Signed))
+    i0 = geninputarg(loopblock, constTYPE(Signed))
+    v1 = geninputarg(loopblock, constTYPE(Signed))
     closelink(link, [const1, const1, v0], loopblock)
     const1 = genconst(1)
-    result1 = genop(loopblock, 'int_mul', [result0, i0], Signed)
-    i1 = genop(loopblock, 'int_add', [i0, const1], Signed)
-    v2 = genop(loopblock, 'int_le', [i1, v1], Bool)
+    result1 = genop(loopblock, 'int_mul', [result0, i0], constTYPE(Signed))
+    i1 = genop(loopblock, 'int_add', [i0, const1], constTYPE(Signed))
+    v2 = genop(loopblock, 'int_le', [i1, v1], constTYPE(Bool))
     exitspair = closeblock2(loopblock, v2)
     false_link, true_link = exitspair.item0, exitspair.item1
     closereturnlink(false_link, result1)

Modified: pypy/dist/pypy/rpython/test/test_rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rlist.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rlist.py	Wed Feb 15 19:55:28 2006
@@ -913,7 +913,8 @@
             self.bareblock = support.from_opaque_object(self.newblock.obj)
 
         def genop(self, opname, args, RESULT_TYPE):
-            return rgenop.genop(self.newblock, opname, args, RESULT_TYPE)
+            return rgenop.genop(self.newblock, opname, args,
+                                rgenop.constTYPE(RESULT_TYPE))
 
         def genconst(self, llvalue):
             return rgenop.genconst(llvalue)



More information about the Pypy-commit mailing list