Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/charisee_dev/src/compiler/high-to-mid/handleEin.sml
ViewVC logotype

Diff of /branches/charisee_dev/src/compiler/high-to-mid/handleEin.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3414, Thu Nov 12 17:07:22 2015 UTC revision 3415, Thu Nov 12 20:59:23 2015 UTC
# Line 29  Line 29 
29      fun toStringBind e= MidToS.toStringBind e      fun toStringBind e= MidToS.toStringBind e
30      fun useCount (HighIL.V{useCnt, ...}) = !useCnt      fun useCount (HighIL.V{useCnt, ...}) = !useCnt
31      fun expandEinOp (srcy,bind00)=let      fun expandEinOp (srcy,bind00)=let
32          val _=raise Fail"development branch- do not use"         (* val _=raise Fail"development branch- do not use"*)
33          val star="************"          val star="************"
34          val _=print ("\n Start"^star)          val _= ("\n Start"^star)
35          val _ =test0[star,"\n Original EinApp",star,"\n\n","start get test",toStringBind bind00]          val _ =test0[star,"\n Original EinApp",star,"\n\n","start get test",toStringBind bind00]
36          val (y,einapp as DstIL.EINAPP(Ein.EIN{params, index, body},args))=bind00          val (y,einapp as DstIL.EINAPP(Ein.EIN{params, index, body},args))=bind00
37    
# Line 59  Line 59 
59           val (einapp1,e2)=L.testLift  bind3           val (einapp1,e2)=L.testLift  bind3
60          val _ =  print("\n **** lift Length"^(Int.toString(length(e2))))          val _ =  print("\n **** lift Length"^(Int.toString(length(e2))))
61          val newbies5=  Split.iterAll2(einapp1,e2)          val newbies5=  Split.iterAll2(einapp1,e2)
         val n =length(newbies5)  
         val _ = if (n > 10) then print("\n **** SPLIT Length"^(Int.toString(n))) else print ""  
62  *)  *)
63    
64          (* **************** split phase ************* *)          (* **************** split phase ************* *)
65    
66          val (newbies5)= Split.splitEinApp(bind3,9)          val (newbies5)= Split.splitEinApp(bind3,9)
         val _ =test0["\n\n Returning \n\n =>",  
         String.concatWith",\n\t"(List.map toStringBind newbies5)]  
67    
68    
69    (* **************** split With Limit phase ************* *)
70    
71    val (newbies5)=Split.iterAll2(bind3,[])
72    
73            (**************** printing result ***************)
74            val _ =testp["\n\n Returning \n\n =>",
75            String.concatWith",\n\t"(List.map toStringBind newbies5)]
76            val n =length(newbies5)
77            val _ = if (n > 10) then print("\n **** SPLIT Length"^(Int.toString(n))) else print ""
78          val _=print"probein\n"          val _=print"probein\n"
79           (* ************** ProbeEIN *********** *)           (* ************** ProbeEIN *********** *)
80          (*gives probeEIN the set. Could split into a sepearate step*)          (*gives probeEIN the set. Could split into a sepearate step*)
# Line 87  Line 93 
93          val code=iter(newbies5, fieldset)          val code=iter(newbies5, fieldset)
94    
95          val n= List.length(code)          val n= List.length(code)
96            val _ =print(String.concat[HighIL.Var.name srcy ," Pieces",Int.toString (n),"\n"])
97    (*
98            val _ = if (n>5)            val _ = if (n>5)
99            then  print(String.concat["\n\n",star,":Name:",HighIL.Var.name srcy ,            then  print(String.concat["\n",star,":Name:",HighIL.Var.name srcy ,
100              ":VarCount(",Int.toString(useCount srcy),")",              ":VarCount(",Int.toString(useCount srcy),")","Pieces now: ",Int.toString (n),
                 "\n\t",star,"Pieces now: ",Int.toString (n),  
101              " Fields:",Int.toString(!isField)," isReplaced:",Int.toString(!isReplaced),              " Fields:",Int.toString(!isField)," isReplaced:",Int.toString(!isReplaced),
102              " Replaced_Fields:",Int.toString(!isFieldR)])              " Replaced_Fields:",Int.toString(!isFieldR)])
103              else print ""              else print ""
104    *)
105      val flatcode= List.foldr op@ [] code      val flatcode= List.foldr op@ [] code
106    
 (*  
     (*added extra step*)  
     val tbl0= einSet.EinSet.empty  
     fun getSet([],done,_,cnt)=(done,cnt)  
       | getSet((lhs,rhs)::es,done,opset,cnt)=let  
         val (opset,var) = einSet.rtnVarN(opset,(lhs,rhs))  
         in  (case var  
             of NONE => getSet(es,done@[(lhs,rhs)], opset,cnt)  
             | SOME v=> getSet(es,done@[(lhs,DstIL.VAR v)], opset,cnt+1)  
             (*end case*))  
         end  
   
        val (flatcode,cnt)=getSet(flatcode, [],tbl0,0)  
107    
        val n=length(flatcode)  
         val _ =print(String.concat["\n Length: ",Int.toString n," Replaced: ", Int.toString cnt,  
                 "\n",DstIL.Var.toString(y),"\n"])  
   
 *)  
108          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)
109          val _=(star^"end")          val _=(star^"end")
110          in          in

Legend:
Removed from v.3414  
changed lines
  Added in v.3415

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0