Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/FLINT/opt/loopify.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/opt/loopify.sml

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

revision 422, Sun Sep 5 22:49:38 1999 UTC revision 423, Mon Sep 6 02:32:11 1999 UTC
# Line 13  Line 13 
13      structure F  = FLINT      structure F  = FLINT
14      structure O  = Option      structure O  = Option
15      structure M  = IntBinaryMap      structure M  = IntBinaryMap
16      structure S  = IntSetF      structure S  = IntBinarySet
17      structure OU = OptUtils      structure OU = OptUtils
18      structure LK = LtyKernel      structure LK = LtyKernel
19      structure CTRL = FLINT_Control      structure CTRL = FLINT_Control
# Line 58  Line 58 
58         let val I{tcp,calls,icalls,...} = new(f, known, p)         let val I{tcp,calls,icalls,...} = new(f, known, p)
59             val _ = loop le             val _ = loop le
60             val necalls = length(!calls)             val necalls = length(!calls)
61         in  collect f (if !tcp then S.add(f,tfs) else S.singleton f) body;         in  collect f (if !tcp then S.add(tfs, f) else S.singleton f) body;
62             icalls := List.take(!calls, length(!calls) - necalls)             icalls := List.take(!calls, length(!calls) - necalls)
63         end         end
64       | F.FIX(fdecs,le) =>       | F.FIX(fdecs,le) =>
# Line 76  Line 76 
76         end         end
77       | F.APP(F.VAR f,vs) =>       | F.APP(F.VAR f,vs) =>
78         (let val I{tails,calls,tcp,parent,...} = get f         (let val I{tails,calls,tcp,parent,...} = get f
79         in if S.member tfs f then tails := vs::(!tails)         in if S.member(tfs, f) then tails := vs::(!tails)
80            else (calls := vs::(!calls);            else (calls := vs::(!calls);
81                  if S.member tfs parent then () else tcp := false)                  if S.member(tfs, parent) then () else tcp := false)
82         end handle NotFound => ())         end handle NotFound => ())
83       | F.TFN((_,_,_,body),le) => (collect p S.empty body; loop le)       | F.TFN((_,_,_,body),le) => (collect p S.empty body; loop le)
84       | F.TAPP _ => ()       | F.TAPP _ => ()
# Line 222  Line 222 
222                of SOME(fl, filt) =>                of SOME(fl, filt) =>
223                     F.APP(F.VAR fl, OU.filter filt vs)                     F.APP(F.VAR fl, OU.filter filt vs)
224                 | NONE => le                 | NONE => le
225              (*esac*))              (*esac*)))
226       | F.TFN((tfk,f,args,body),le) => F.TFN((tfk, f, args, loop body), loop le)       | F.TFN((tfk,f,args,body),le) => F.TFN((tfk, f, args, loop body), loop le)
227       | F.TAPP(f,tycs) => le       | F.TAPP(f,tycs) => le
228       | F.SWITCH(v,ac,arms,def) =>       | F.SWITCH(v,ac,arms,def) =>

Legend:
Removed from v.422  
changed lines
  Added in v.423

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