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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/high-opt/normalize.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/high-opt/normalize.sml

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

revision 4088, Wed Jun 29 00:51:17 2016 UTC revision 4132, Fri Jul 1 13:57:17 2016 UTC
# Line 31  Line 31 
31      fun decUse (IR.V{useCnt, ...}) = (useCnt := !useCnt - 1)      fun decUse (IR.V{useCnt, ...}) = (useCnt := !useCnt - 1)
32      fun use x = (incUse x; x)      fun use x = (incUse x; x)
33    
34    (*** OLD VERSION
35      fun getEinApp x = (case V.getDef x      fun getEinApp x = (case V.getDef x
36             of IR.EINAPP(e, arg) => SOME(e, arg)             of IR.EINAPP(e, arg) => SOME(e, arg)
37              | _ => NONE              | _ => NONE
38            (* end case *))            (* end case *))
39    ****)
40      (* get the EIN application that "x" is bound to (if any).  Note that we are conservative
41       * on following globals so as to avoid duplicating computation.
42       *)
43        fun getEinApp x = let
44              fun getEinRHS (IR.EINAPP app) = SOME app
45                | getEinRHS _ = NONE
46              in
47                case V.ty x
48                 of HighTypes.KernelTy => getEinRHS(V.getDef x)
49                  | HighTypes.FieldTy => getEinRHS(V.getDef x)
50                  | _ => getEinRHS(V.getLocalDef x)
51                (* end case *)
52              end
53    
54   (* doNormalize : EIN -> EIN   (* doNormalize : EIN -> EIN
55    * Orders EIN, normalizes it, then cleans the summation    * Orders EIN, normalizes it, then cleans the summation
# Line 72  Line 87 
87                  end                  end
88            (* end case *))            (* end case *))
89    
90    (* FIXME: it would be much more efficient to do all of the substitutions in one go,
91     * instead of repeatedly rewriting the term for each argument.
92     *)
93    (* doRHS: HighIR.var * rhs -> (var * rhs) list option    (* doRHS: HighIR.var * rhs -> (var * rhs) list option
94     * Looks at each argument to the original EINAPP.     * Looks at each argument to the original EINAPP.
95     * If it is another EIN APP calls rewriteEin to do application     * If it is another EIN APP calls rewriteEin to do application

Legend:
Removed from v.4088  
changed lines
  Added in v.4132

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