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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/tree-opt/tree-contract.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/tree-opt/tree-contract.sml

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

revision 3994, Sat Jun 18 18:41:33 2016 UTC revision 3995, Sat Jun 18 20:00:19 2016 UTC
# Line 148  Line 148 
148  (* TODO: unused variable elimination; tensor/vector conversion elimination *)  (* TODO: unused variable elimination; tensor/vector conversion elimination *)
149      fun transform prog = let      fun transform prog = let
150            val IR.Program{            val IR.Program{
151                  props, target, consts, inputs, constInit,                  props, target, consts, inputs, constInit, globals,
152                  globals, globalInit, strand, create, update                  globInit, strand, create, init, update
153                } = prog                } = prog
154            val IR.Strand{name, params, state, stateInit, initM, updateM, stabilizeM} = strand            val IR.Strand{name, params, state, stateInit, initM, updateM, stabilizeM} = strand
155            val reduceBlk = reduceBlock (Properties.dualState props)            val reduceBlk = reduceBlock (Properties.dualState props)
# Line 157  Line 157 
157                    usesGlobals = usesGlobals, needsWorld = needsWorld, body = reduceBlk body                    usesGlobals = usesGlobals, needsWorld = needsWorld, body = reduceBlk body
158                  }                  }
159            val constInit = reduceBlk constInit            val constInit = reduceBlk constInit
160            val globalInit = reduceBlk globalInit            val globInit = reduceBlk globInit
           val create = (case create  
                  of IR.Create{dim, code} => IR.Create{dim=dim, code=reduceBlk code}  
                 (* end case *))  
           val update = Option.map reduceBlk update  
161            val strand = IR.Strand{            val strand = IR.Strand{
162                    name = name, params = params, state = state,                    name = name, params = params, state = state,
163                    stateInit = reduceMethod stateInit,                    stateInit = reduceMethod stateInit,
# Line 169  Line 165 
165                    updateM = reduceMethod updateM,                    updateM = reduceMethod updateM,
166                    stabilizeM = Option.map reduceMethod stabilizeM                    stabilizeM = Option.map reduceMethod stabilizeM
167                  }                  }
168              val create = (case create
169                     of IR.Create{dim, code} => IR.Create{dim=dim, code=reduceBlk code}
170                    (* end case *))
171              val init = Option.map reduceBlk init
172              val update = Option.map reduceBlk update
173            in            in
174              IR.Program{              IR.Program{
175                  props = props, target = target, consts = consts,                  props = props, target = target, consts = consts, inputs = inputs,
176                  inputs = inputs, constInit = constInit,                  constInit = constInit, globals = globals, globInit = globInit,
177                  globals = globals, globalInit = globalInit,                  strand = strand, create = create, init = init, update = update
                 strand = strand, create = create, update = update  
178                }                }
179            end            end
180    

Legend:
Removed from v.3994  
changed lines
  Added in v.3995

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