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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/high-il/high-opt.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/high-il/high-opt.sml

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

revision 1016, Fri Apr 29 21:59:23 2011 UTC revision 1017, Sun May 1 03:06:05 2011 UTC
# Line 132  Line 132 
132                 of SOME[] => IL.CFG.deleteNode nd                 of SOME[] => IL.CFG.deleteNode nd
133                  | SOME assigns => (                  | SOME assigns => (
134                      List.app (fn (y, rhs) => V.setBinding(y, IL.VB_RHS rhs)) assigns;                      List.app (fn (y, rhs) => V.setBinding(y, IL.VB_RHS rhs)) assigns;
135                      IL.CFG.splice (nd, IL.CFG.mkBlock assigns))                      IL.CFG.replaceNodeWithCFG (nd, IL.CFG.mkBlock assigns))
136                  | NONE => ()                  | NONE => ()
137                (* end case *))                (* end case *))
138        | simplify _ = ()        | simplify _ = ()
# Line 180  Line 180 
180              loop (Stats.sum{from=firstCounter, to=lastCounter})              loop (Stats.sum{from=firstCounter, to=lastCounter})
181            end            end
182    
183      fun optimize (prog as IL.Program{globals, globalInit, initially, strands}) = let      fun optimize (prog as IL.Program{globalInit, initially, strands}) = let
184            fun doCFG cfg = (            fun doCFG cfg = (
185                  loopToFixPt (fn () => IL.CFG.apply simplify cfg);                  loopToFixPt (fn () => IL.CFG.apply simplify cfg);
186                  loopToFixPt (fn () => IL.CFG.apply reduce cfg))                  loopToFixPt (fn () => IL.CFG.apply reduce cfg))
# Line 193  Line 193 
193                  List.app doStrand strands)                  List.app doStrand strands)
194            in            in
195              loopToFixPt optPass;              loopToFixPt optPass;
196    (* FIXME: after optimization, we should filter out any globals that are now unused *)
197              IL.Program{              IL.Program{
                 globals = globals,  
198                  globalInit = globalInit,                  globalInit = globalInit,
199                  initially = initially,  (* FIXME: we should optimize this code *)                  initially = initially,  (* FIXME: we should optimize this code *)
200                  strands = strands                  strands = strands

Legend:
Removed from v.1016  
changed lines
  Added in v.1017

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