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 4190, Tue Jul 12 21:40:37 2016 UTC revision 4191, Tue Jul 12 22:09:36 2016 UTC
# Line 55  Line 55 
55    * Orders EIN, normalizes it, then cleans the summation    * Orders EIN, normalizes it, then cleans the summation
56    *)    *)
57      fun doNormalize e' = let      fun doNormalize e' = let
58            (* DEBUG  val _ =print(String.concat["\n\n\n do normalize:", EinPP.toString(e')])*)            (* DEBUG val _ =print(String.concat["\n\n\n pre normalize:", EinPP.toString(e')]) *)
59            val ordered = Reorder.transform e'            val ordered = Reorder.transform e'
60            in            val rtn = case NormalizeEin.transform ordered
             case NormalizeEin.transform ordered  
61               of NONE => ordered               of NONE => ordered
62                | SOME e => EinSums.clean e                | SOME e => EinSums.clean e
63              (* end case *)              (* end case *)
64               (* val _ =print(String.concat["\n\n\n post normalize:", EinPP.toString(rtn)]) *)
65              in
66                rtn
67            end            end
68    
69      fun nameCnt e = String.concat[V.toString e, "(", Int.toString(useCount e), ")"]      fun nameCnt e = String.concat[V.toString e, "(", Int.toString(useCount e), ")"]
# Line 79  Line 81 
81              | _ => let              | _ => let
82                  val rtnArgs = done @ newArgs                  val rtnArgs = done @ newArgs
83                  val (c, subst) = Apply.apply(orig, place, newE)                  val (c, subst) = Apply.apply(orig, place, newE)
84                    (* DEBUG val _ =print(String.concat["\n\n\n apply new:", EinPP.toString(newE)]) *)
85                    (* DEBUG val _ =print(String.concat["\n\n\n apply orig:", EinPP.toString(orig)]) *)
86                  (* DEBUG  val _ =print(String.concat["\n\n\n after substition:", EinPP.toString(subst)]) *)                  (* DEBUG  val _ =print(String.concat["\n\n\n after substition:", EinPP.toString(subst)]) *)
87                  in                  in
88                    if c                    if c
# Line 99  Line 103 
103     * Keeps track of the place of the argument in substitution.     * Keeps track of the place of the argument in substitution.
104     *)     *)
105      fun doRHS (lhs, IR.EINAPP(ein, args)) = let      fun doRHS (lhs, IR.EINAPP(ein, args)) = let
106            (* DEBUG val _ =print(String.concat["\n\n\n doRHS:", EinPP.toString(ein)]) *)            (* DEBUG  val _ =print(String.concat["\n\n\n*******************************************\n doRHS:", EinPP.toString(ein)]) *)
107            fun rewrite (false, _, _, [], _) = NONE            fun rewrite (false, _, _, [], _) = NONE
108              | rewrite (true, orig, _, [], args') =              | rewrite (true, orig, _, [], args') =
109                  SOME[(lhs, IR.EINAPP(doNormalize orig, args'))]                  SOME[(lhs, IR.EINAPP(doNormalize orig, args'))]

Legend:
Removed from v.4190  
changed lines
  Added in v.4191

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