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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/low-to-tree/flatten.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/low-to-tree/flatten.sml

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

revision 3891, Sat May 21 16:19:41 2016 UTC revision 3892, Sat May 21 17:08:42 2016 UTC
# Line 42  Line 42 
42      fun index (x, path) = let      fun index (x, path) = let
43            fun mkIndex (x, path) = let            fun mkIndex (x, path) = let
44                  val t = IR.Var.new("t", LowTypes.realTy)                  val t = IR.Var.new("t", LowTypes.realTy)
45                    val rator = (case (V.ty x, path)
46                           of (Ty.TensorTy[d], [idx]) => Op.VIndex(d, idx)
47                            | _ => Op.TensorIndex(V.ty x, path)
48                          (* end case *))
49                  in                  in
50                    (t, SOME(IR.ASSGN(t, IR.OP(Op.TensorIndex(V.ty x, path), [use x]))))                    (t, SOME(IR.ASSGN(t, IR.OP(rator, [use x]))))
51                  end                  end
52            fun getGlobal (gv, path) = let            fun getGlobal (gv, path) = let
53                  fun get (x, []) = (case V.binding x                  fun get (x, []) = (case V.binding x
# Line 99  Line 103 
103                  fun getArgs (i, args, stms) =                  fun getArgs (i, args, stms) =
104                        if (i < d)                        if (i < d)
105                          then (case index(x, List.rev(i::path))                          then (case index(x, List.rev(i::path))
106                             of (y, NONE) => getArgs (i+1, y::args, stms)                             of (y, NONE) => getArgs (i+1, (use y)::args, stms)
107                              | (y, SOME stm) => getArgs (i+1, y::args, stm::stms)                              | (y, SOME stm) => getArgs (i+1, (use y)::args, stm::stms)
108                            (* end case *))                            (* end case *))
109                          else (args, stms)                          else (args, stms)
110                  in                  in

Legend:
Removed from v.3891  
changed lines
  Added in v.3892

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