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

SCM Repository

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

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

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

revision 4143, Fri Jul 1 16:14:15 2016 UTC revision 4159, Mon Jul 4 16:31:23 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 do normalize:", EinPP.toString(e')])*)
59            val ordered = Reorder.transform e'            val ordered = Reorder.transform e'
60            in            in
61              case NormalizeEin.transform ordered              case NormalizeEin.transform ordered
# Line 79  Line 79 
79              | _ => let              | _ => let
80                  val rtnArgs = done @ newArgs                  val rtnArgs = done @ newArgs
81                  val (c, subst) = Apply.apply(orig, place, newE)                  val (c, subst) = Apply.apply(orig, place, newE)
82  (*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)]) *)
83                  in                  in
84                    if c                    if c
85                      then (true, subst, place + length newArgs, rtnArgs)                      then (true, subst, place + length newArgs, rtnArgs)
# Line 99  Line 99 
99     * Keeps track of the place of the argument in substitution.     * Keeps track of the place of the argument in substitution.
100     *)     *)
101      fun doRHS (lhs, IR.EINAPP(ein, args)) = let      fun doRHS (lhs, IR.EINAPP(ein, args)) = let
102  (*DEBUG* val _ =print(String.concat["\n\n\n doRHS:", EinPP.toString(ein)]) *)            (* DEBUG val _ =print(String.concat["\n\n\n doRHS:", EinPP.toString(ein)]) *)
103            fun rewrite (false, _, _, [], _) = NONE            fun rewrite (false, _, _, [], _) = NONE
104              | rewrite (true, orig, _, [], args') =              | rewrite (true, orig, _, [], args') =
105                  SOME[(lhs, IR.EINAPP(doNormalize orig, args'))]                  SOME[(lhs, IR.EINAPP(doNormalize orig, args'))]

Legend:
Removed from v.4143  
changed lines
  Added in v.4159

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