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

Legend:
Removed from v.3369  
changed lines
  Added in v.3460

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