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/split.sml
ViewVC logotype

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

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

revision 3374, Thu Nov 5 21:05:53 2015 UTC revision 3378, Fri Nov 6 15:39:55 2015 UTC
# Line 36  Line 36 
36    
37      val numFlag=1   (*remove common subexpression*)      val numFlag=1   (*remove common subexpression*)
38      val testing=0      val testing=0
39        val splitlimit=500
40      fun mkEin e = E.mkEin e      fun mkEin e = E.mkEin e
41      val einappzero= DstIL.EINAPP(mkEin([],[],E.Const 0),[])      val einappzero= DstIL.EINAPP(mkEin([],[],E.Const 0),[])
42      fun setEinZero y=  (y,einappzero)      fun setEinZero y=  (y,einappzero)
# Line 383  Line 384 
384    
385      fun iterAll2(einapp2,fields2)=let      fun iterAll2(einapp2,fields2)=let
386          val fieldset= einSet.EinSet.empty          val fieldset= einSet.EinSet.empty
387            val _ =print ("\nSPLit with limit"^(Int.toString(splitlimit)))
388          fun itercode([],rest,code,cnt)=(("\n Empty-SplitCount: "^Int.toString(cnt));(rest,code))          fun itercode([],rest,code,cnt)=(("\n Empty-SplitCount: "^Int.toString(cnt));(rest,code))
389          | itercode(e1::newbies,rest,code,cnt)=let          | itercode(e1::newbies,rest,code,cnt)=let
390              val ((einapp3,code3),_) = split(e1,fieldset,numFlag)              val ((einapp3,code3),_) = split(e1,fieldset,numFlag)
391              val (rest4,code4)=itercode(code3,[],[],cnt+1)              val (rest4,code4)=itercode(code3,[],[],cnt+1)
392              val _ =testp [toStringBind(e1),"\n\t===>\n",toStringBind(einapp3),"\nand\n",(String.concatWith",\n\t"(List.map toStringBind (code4@rest4)))]              val _ =testp [toStringBind(e1),"\n\t===>\n",toStringBind(einapp3),"\nand\n",(String.concatWith",\n\t"(List.map toStringBind (code4@rest4)))]
393              in              in
394                  if (length(rest@newbies@code) > 500) then let                  if (length(rest@newbies@code) > splitlimit) then let
395                          val _ =("\n SplitCount: "^Int.toString(cnt))                          val _ =("\n SplitCount: "^Int.toString(cnt))
396                          val code5=code4@rest4@code                          val code5=code4@rest4@code
397                          val rest5=rest@[einapp3]                          val rest5=rest@[einapp3]
# Line 417  Line 419 
419    
420    
421      fun iterAll(einapp2,fieldset)=let      fun iterAll(einapp2,fieldset)=let
422            val _=print"\nSplit All"
423          fun itercode([],rest,code,_)=(rest,code)          fun itercode([],rest,code,_)=(rest,code)
424          | itercode(e1::newbies,rest,code,cnt)=let          | itercode(e1::newbies,rest,code,cnt)=let
425              val ((einapp3,code3),_) = split(e1,fieldset,numFlag)              val ((einapp3,code3),_) = split(e1,fieldset,numFlag)

Legend:
Removed from v.3374  
changed lines
  Added in v.3378

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