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

SCM Repository

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

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

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

revision 3394, Tue Nov 10 17:42:19 2015 UTC revision 3395, Tue Nov 10 18:23:07 2015 UTC
# Line 127  Line 127 
127              @(List.map (fn e=> (DstIL.Var.toString(e)^",")) einargs)))              @(List.map (fn e=> (DstIL.Var.toString(e)^",")) einargs)))
128          (*val _=checkEin.checkEIN e*)          (*val _=checkEin.checkEIN e*)
129    
130          val _ = print(String.concat["\n********",DstIL.Var.toString(y),"\n\t-prescan"])          val _ = print(String.concat["\n********",DstIL.Var.toString(y), " prescan"])
131   val _=print (P.printerE e)   (*val _=print (P.printerE e)*)
132    
133          val code = EtLow.scan(y,e,einargs)          val code = EtLow.scan(y,e,einargs)
134    
135         val _ = print(String.concat["\n\t-postscan"])         val _ = print(String.concat[" postscan"])
136    
137          val tbl0= lowSet.LowSet.empty          val tbl0= lowSet.LowSet.empty
138              fun getSet([],done,_,cnt)=(done,cnt)              fun getSet([],done,_,cnt)=(done,cnt)
# Line 139  Line 140 
140                  val (opset,var) = lowSet.filter(opset,(lhs,rhs))                  val (opset,var) = lowSet.filter(opset,(lhs,rhs))
141                  in  (case var                  in  (case var
142                      of NONE => getSet(es,done@[DstIL.ASSGN(lhs,rhs)], opset,cnt)                      of NONE => getSet(es,done@[DstIL.ASSGN(lhs,rhs)], opset,cnt)
143                      | SOME v=> getSet(es,done@[DstIL.ASSGN(lhs,DstIL.VAR v)], opset,cnt+1)                      | SOME v=> (("replacing"^DstIL.Var.toString(lhs));getSet(es,done@[DstIL.ASSGN(lhs,DstIL.VAR v)], opset,cnt+1))
144                  (*end case*))                  (*end case*))
145                  end                  end
146              | getSet (e1::es, done, opset,cnt)=getSet(es,done@[e1],opset,cnt)              | getSet (e1::es, done, opset,cnt)=getSet(es,done@[e1],opset,cnt)
147            val _=print"creating set"
148          val (code,cnt)=getSet(code, [],tbl0,0)          val (code,cnt)=getSet(code, [],tbl0,0)
149         val _ = print(String.concat["\n\t-post creating set"])         val _ = print(String.concat[" post creating set"])
150          val n=length(code)          val n=length(code)
151          val _ = if (cnt> 100) then          val _ = if (cnt> 5) then
152                print(String.concat["\n Length: ",Int.toString n," Replaced: ", Int.toString cnt,                print(String.concat["\n Length: ",Int.toString n," Replaced: ", Int.toString cnt,
153                  "\n",DstIL.Var.toString(y),"=",(P.printerE e),"\n"])                  "\n",DstIL.Var.toString(y),"=",(P.printerE e),"\n"])
154  else      print(String.concat["\n Length: ",Int.toString n," Replaced: ", Int.toString cnt,  else      print  "" (*(String.concat["\n Length: ",Int.toString n," Replaced: ", Int.toString cnt,
155  "\n",DstIL.Var.toString(y),"\n"])  "\n",DstIL.Var.toString(y),"\n"])*)
156  (*  (*
157          val _=if (cnt>100) then print(P.printerE e) else print ""          val _=if (cnt>100) then print(P.printerE e) else print ""
158           val _ = "DONE"           val _ = "DONE"
159  *)  *)
160      val _ = print(String.concat["\n\t-done"])  val _ = print(String.concat[" done"])
161    
162          in          in
163              code              code
164          end          end

Legend:
Removed from v.3394  
changed lines
  Added in v.3395

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