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 3355, Thu Oct 29 22:08:40 2015 UTC revision 3489, Tue Dec 8 20:49:31 2015 UTC
# Line 17  Line 17 
17      structure L=LiftEin      structure L=LiftEin
18      in      in
19    
20      val testinitial=0      val liftflag=true
21        val splitflag=true
22        val splitlimit=SOME 2650
23    
24        val testinitial=1
25      val testing=0      val testing=0
26      fun testp n=(case testing      fun testp n=(case testing
27          of 0=> 1          of 0=> 1
# Line 30  Line 34 
34      fun useCount (HighIL.V{useCnt, ...}) = !useCnt      fun useCount (HighIL.V{useCnt, ...}) = !useCnt
35      fun expandEinOp (srcy,bind00)=let      fun expandEinOp (srcy,bind00)=let
36          (*val _=raise Fail"development branch- do not use"*)          (*val _=raise Fail"development branch- do not use"*)
37    
38          val star="************"          val star="************"
39          val _=("\n Start"^star)          val _=("\n Start"^star)
40          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]
# Line 37  Line 42 
42    
43    
44          (* ************* Sweep for 0's'*********** *)          (* ************* Sweep for 0's'*********** *)
45            val _ =testp["Pre Sweep\n",P.printbody body,"\n"]
46          val bodysweep=sweepEin.sweep body          val bodysweep=sweepEin.sweep body
47          val ein1=Ein.EIN{params=params, index=index, body=bodysweep}          val ein1=Ein.EIN{params=params, index=index, body=bodysweep}
48          val _=testp["Post Sweep\n",P.printbody bodysweep,"\n"]          val _=testp["Post Sweep\n",P.printbody bodysweep,"\n"]
# Line 46  Line 52 
52          val bind3 = (y,DstIL.EINAPP(SummationEin.main ein1,args))          val bind3 = (y,DstIL.EINAPP(SummationEin.main ein1,args))
53          val _ =testp["\n\n summation \n\n =>", toStringBind bind3]          val _ =testp["\n\n summation \n\n =>", toStringBind bind3]
54    
55  (*          (* **************** lift - split ************* *)
56      (* **************** lift field phase ************* *)          val newbies5=  (case (splitflag,liftflag,splitlimit)
57                of (true,false,NONE) => Split.splitEinApp bind3
          val (einapp1,e2)=L.testLift  bind3  
         val newbies5=  Split.iterAll2(einapp1,e2)  
         val n =length(newbies5)  
         val _ = if (n > 10) then print("\n **** SPLIT Length"^(Int.toString(n))) else print ""  
   
 *)  
   
58          (* **************** split phase ************* *)          (* **************** split phase ************* *)
59                | (true,false,SOME limit) =>let
60          val (newbies5)= Split.splitEinApp(bind3,9)                  val _ =print (String.concat["\nSPLit with limit",Int.toString(limit)])
61          val _ =test0["\n\n Returning \n\n =>",                  in Split.limitSplit(bind3,limit) end
62                | (true,true,SOME limit) =>  let
63                    (* **************** lift and split Limit ************* *)
64                    val (einapp1,e2)=L.testLift  bind3
65                    val _ =print (String.concat["\nSPLit with limit",Int.toString(limit),"\n **** lift Length:",Int.toString(length(e2))])
66                    val newbies4=Split.limitSplit(einapp1,limit)
67                    in (e2@newbies4) end
68                | (true,true, NONE) => let
69                    (* **************** lift and split All ************* *)
70                    val (einapp1,e2)=L.testLift  bind3
71                    val _ =  testp["\n **** lift Length"^(Int.toString(length(e2)))]
72                    val newbies4=Split.splitEinApp einapp1
73                    in (e2@newbies4) end
74                | (false,true,_) => let
75                    val (einapp1,e2)=L.testLift  bind3
76                    val _ =  print("\n **** lift Length"^(Int.toString(length(e2))))
77                    in (e2@[einapp1]) end
78                |  (false,false,_)=>Split.splitEinApp bind3
79            (* end case *))
80            val _ =print"************** TASH"
81            (**************** printing result ***************)
82            val _ =testp["\n\n Returning \n\n =>",
83          String.concatWith",\n\t"(List.map toStringBind newbies5)]          String.concatWith",\n\t"(List.map toStringBind newbies5)]
84            val n =length(newbies5)
85            val _ = if (n > 10) then print(String.concat["\n **** SPLIT Length",Int.toString(n)]) else print ""
86           (* ************** ProbeEIN *********** *)           (* ************** ProbeEIN *********** *)
87          (*gives probeEIN the set. Could split into a sepearate step*)          (*gives probeEIN the set. Could split into a sepearate step*)
88          val fieldset= einSet.EinSet.empty          val fieldset= einSet.EinSet.empty
# Line 80  Line 100 
100          val code=iter(newbies5, fieldset)          val code=iter(newbies5, fieldset)
101    
102          val n= List.length(code)          val n= List.length(code)
103            val _ =testp[HighIL.Var.name srcy ," Pieces",Int.toString (n),"\n"]
104    (*
105            val _ = if (n>5)            val _ = if (n>5)
106           then  (String.concat["\n\n",star,":Name:",HighIL.Var.name srcy ,            then  print(String.concat["\n",star,":Name:",HighIL.Var.name srcy ,
107              ":VarCount(",Int.toString(useCount srcy),")",              ":VarCount(",Int.toString(useCount srcy),")","Pieces now: ",Int.toString (n),
                 "\n\t",star,"Pieces now: ",Int.toString (n),  
108              " Fields:",Int.toString(!isField)," isReplaced:",Int.toString(!isReplaced),              " Fields:",Int.toString(!isField)," isReplaced:",Int.toString(!isReplaced),
109              " Replaced_Fields:",Int.toString(!isFieldR)              " Replaced_Fields:",Int.toString(!isFieldR)])
110                 ,toStringBind bind3])              else print ""
111              else  ""  *)
   
112          val flatcode= List.foldr op@ [] code          val flatcode= List.foldr op@ [] code
113    
114    
115          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)
116          val _=(star^"end")          val _=(star^"end")
117          in          in

Legend:
Removed from v.3355  
changed lines
  Added in v.3489

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