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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/ein/ein-sums.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/ein/ein-sums.sml

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

revision 4147, Fri Jul 1 19:24:22 2016 UTC revision 4148, Fri Jul 1 19:27:20 2016 UTC
# Line 144  Line 144 
144     * Rewrites body by moving summation indices around     * Rewrites body by moving summation indices around
145     *)     *)
146      fun clean (Ein.EIN{params, index, body}) = let      fun clean (Ein.EIN{params, index, body}) = let
147            fun rewriteBody body = let            fun rewriteBody body = (case body
             in (case body  
148                   of E.Lift e1             => E.Lift(rewriteBody e1)                   of E.Lift e1             => E.Lift(rewriteBody e1)
149                    | E.Apply(e1, e2)       => E.Apply(rewriteBody e1, rewriteBody e2)                    | E.Apply(e1, e2)       => E.Apply(rewriteBody e1, rewriteBody e2)
150                    | E.Probe(e1, e2)       => E.Probe(e1, rewriteBody e2)                    | E.Probe(e1, e2)       => E.Probe(e1, rewriteBody e2)
# Line 161  Line 160 
160                    | E.Opn(opn, es)        => E.Opn(opn, List.map rewriteBody es)                    | E.Opn(opn, es)        => E.Opn(opn, List.map rewriteBody es)
161                    | _                     => body                    | _                     => body
162                  (* end case *))                  (* end case *))
             end  
163            in            in
164              Ein.EIN{params=params, index=index, body=rewriteBody body}              Ein.EIN{params=params, index=index, body=rewriteBody body}
165            end            end
# Line 197  Line 195 
195                    | E.Op1(op1, e1) => E.Op1(op1, rewrite e1)                    | E.Op1(op1, e1) => E.Op1(op1, rewrite e1)
196  (* QUESTION: doesn't this optimization get done elsewhere? *)  (* QUESTION: doesn't this optimization get done elsewhere? *)
197                    | E.Op2(E.Sub, e1, E.Const 0) => (changed := true; rewrite e1)                    | E.Op2(E.Sub, e1, E.Const 0) => (changed := true; rewrite e1)
198                    | E.Op2(op2, e1, e2) =>                    | E.Op2(op2, e1, e2) => E.Op2(op2, rewrite e1, rewrite e2)
                     E.Op2(op2, rewrite e1, rewrite e2)  
199                    | E.Opn(E.Prod, es) => (case es                    | E.Opn(E.Prod, es) => (case es
200                         of [e1, E.Opn(E.Prod, es)] => (changed := true; mkProd(e1::es))                         of [e1, E.Opn(E.Prod, es)] => (changed := true; mkProd(e1::es))
201                          | [                          | [

Legend:
Removed from v.4147  
changed lines
  Added in v.4148

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