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 4932, Wed Feb 22 17:36:51 2017 UTC revision 4945, Thu Mar 9 00:12:53 2017 UTC
# Line 57  Line 57 
57    * Orders EIN, normalizes it, then cleans the summation    * Orders EIN, normalizes it, then cleans the summation
58    *)    *)
59      fun doNormalize e' = let      fun doNormalize e' = let
60    val _ = print ("\n\npost do normalize:"^EinPP.toString(e'))
61            val ordered = Reorder.transform e'            val ordered = Reorder.transform e'
62            val rtn = case NormalizeEin.transform ordered            val rtn = case NormalizeEin.transform ordered
63               of NONE => ordered               of NONE => ordered
# Line 80  Line 81 
81     *    lhs     *    lhs
82     *)     *)
83      fun rewriteEin (changed, params, place, newEinOp, newArgs, done, arg, orig, lhs) = (      fun rewriteEin (changed, params, place, newEinOp, newArgs, done, arg, orig, lhs) = (
84        print ("\n\n*************************pre  app:"^EinPP.toString(newEinOp));
85            case List.nth(params, place)            case List.nth(params, place)
86             of Ein.TEN(false, _) => (             of Ein.TEN(false, _) => (
87                  (changed, orig, place+1, done@[arg]))                  (changed, orig, place+1, done@[arg]))
88              | _ => (case Apply.apply (orig, place, newEinOp)              | _ => (case Apply.apply (orig, place, newEinOp)
89                   of SOME einOp => ( (* einOp is the result of the beta-reduction *)                   of SOME einOp => ( (* einOp is the result of the beta-reduction *)
90                print ("\n\n*************************post  app:"^EinPP.toString(einOp));
91                        decUse arg; List.app incUse newArgs;                        decUse arg; List.app incUse newArgs;
92                        (true, einOp, place + length newArgs, done @ newArgs))                        (true, einOp, place + length newArgs, done @ newArgs))
93                    | NONE => ( (* arg was unused in orig, so we can get rid of it *)                    | NONE => ( (* arg was unused in orig, so we can get rid of it *)

Legend:
Removed from v.4932  
changed lines
  Added in v.4945

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