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

SCM Repository

[diderot] Diff of /branches/staging/src/compiler/IL/unused-elim-fn.sml
ViewVC logotype

Diff of /branches/staging/src/compiler/IL/unused-elim-fn.sml

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

revision 2658, Fri May 30 14:30:43 2014 UTC revision 2659, Fri May 30 14:32:52 2014 UTC
# Line 36  Line 36 
36                    phis := List.filter doVar (!phis)                    phis := List.filter doVar (!phis)
37                  end                  end
38              | IL.ASSIGN{stm=(y, rhs), ...} => if (useCount y = 0)              | IL.ASSIGN{stm=(y, rhs), ...} => if (useCount y = 0)
39                  then (case rhs                  then (
40                     of IL.STATE _ => IL.CFG.deleteNode nd                    case rhs
41                      | IL.VAR x => (decUse x; IL.CFG.deleteNode nd)                     of IL.STATE _ => (Stats.tick cntUnused; IL.CFG.deleteNode nd)
42                      | IL.LIT _ => IL.CFG.deleteNode nd                      | IL.VAR x => (Stats.tick cntUnused; decUse x; IL.CFG.deleteNode nd)
43                        | IL.LIT _ => (Stats.tick cntUnused; IL.CFG.deleteNode nd)
44  (* FIXME: we should distinguish between mutation effects and allocation effects! *)  (* FIXME: we should distinguish between mutation effects and allocation effects! *)
45                      | IL.OP(rator, xs) => if IL.Op.isPure rator                      | IL.OP(rator, xs) => if IL.Op.isPure rator
46                          then (List.app decUse xs; IL.CFG.deleteNode nd)                          then (Stats.tick cntUnused; List.app decUse xs; IL.CFG.deleteNode nd)
47                          else ()                          else ()
48                      | IL.APPLY(_, xs) => (List.app decUse xs; IL.CFG.deleteNode nd)                      | IL.APPLY(_, xs) => (
49                      | IL.CONS(_, xs) => (List.app decUse xs; IL.CFG.deleteNode nd)                          Stats.tick cntUnused; List.app decUse xs; IL.CFG.deleteNode nd)
50                        | IL.CONS(_, xs) => (
51                            Stats.tick cntUnused; List.app decUse xs; IL.CFG.deleteNode nd)
52                    (* end case *))                    (* end case *))
53                  else ()                  else ()
54              | IL.MASSIGN{stm=([], _, _), ...} => ()  (* executed for side effects *)              | IL.MASSIGN{stm=([], _, _), ...} => ()  (* executed for side effects *)

Legend:
Removed from v.2658  
changed lines
  Added in v.2659

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