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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/cfg-ir/ssa-fn.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/cfg-ir/ssa-fn.sml

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

revision 3506, Fri Dec 18 04:03:54 2015 UTC revision 3522, Sun Dec 20 14:20:20 2015 UTC
# Line 12  Line 12 
12    
13  functor SSAFn (  functor SSAFn (
14    
15      val ilName : string      val irName : string
16    
17      structure Ty : SSA_TYPES      structure Ty : SSA_TYPES
18      structure Op : OPERATORS where type ty = Ty.ty      structure Op : OPERATORS where type ty = Ty.ty
# Line 22  Line 22 
22      structure Ty = Ty      structure Ty = Ty
23      structure Op = Op      structure Op = Op
24    
25      val ilName = ilName      val irName = irName
26    
27    (***** CFG *****)    (***** CFG *****)
28    
# Line 131  Line 131 
131                                          (* n'th result of operator in multi-assignment *)                                          (* n'th result of operator in multi-assignment *)
132        | VB_PHI of var option list       (* defined by a phi node *)        | VB_PHI of var option list       (* defined by a phi node *)
133        | VB_PARAM                        (* parameter to a strand *)        | VB_PARAM                        (* parameter to a strand *)
134          | VB_ITER                         (* bound in a foreach loop *)
135    
136    (***** global variables *****)    (***** global variables *****)
137      and global_var = GV of {      and global_var = GV of {
# Line 138  Line 139 
139          name : string,                  (* variable's name *)          name : string,                  (* variable's name *)
140          ty : Ty.ty,                     (* variable's type *)          ty : Ty.ty,                     (* variable's type *)
141          kind : global_kind,             (* the variable kind *)          kind : global_kind,             (* the variable kind *)
142            useCnt : int ref,               (* count of uses *)
143          props : PropList.holder          props : PropList.holder
144        }        }
145    
# Line 200  Line 202 
202                  name = name,                  name = name,
203                  ty = ty,                  ty = ty,
204                  kind = kind,                  kind = kind,
205                    useCnt = ref 0,
206                  props = PropList.newHolder()                  props = PropList.newHolder()
207                }                }
208          fun name (GV{name, ...}) = name          fun name (GV{name, ...}) = name
# Line 208  Line 211 
211          fun ty (GV{ty, ...}) = ty          fun ty (GV{ty, ...}) = ty
212          fun isInput (GV{kind=InputVar, ...}) = true          fun isInput (GV{kind=InputVar, ...}) = true
213            | isInput _ = false            | isInput _ = false
214            fun useCount (GV{useCnt, ...}) = !useCnt
215          fun same (GV{id=a, ...}, GV{id=b, ...}) = Stamp.same(a, b)          fun same (GV{id=a, ...}, GV{id=b, ...}) = Stamp.same(a, b)
216          fun compare (GV{id=a, ...}, GV{id=b, ...}) = Stamp.compare(a, b)          fun compare (GV{id=a, ...}, GV{id=b, ...}) = Stamp.compare(a, b)
217          fun hash (GV{id, ...}) = Stamp.hash id          fun hash (GV{id, ...}) = Stamp.hash id
# Line 387  Line 391 
391                  pred = ref dummy, cond = cond,                  pred = ref dummy, cond = cond,
392                  trueBranch = ref dummy, falseBranch = ref dummy                  trueBranch = ref dummy, falseBranch = ref dummy
393                })                })
394          fun mkFOREACH (var, src) = new (FOREACH{          fun mkFOREACH (var, src) = (
395                  Var.setBinding (var, VB_ITER);
396                  new (FOREACH{
397                  pred = ref dummy,                  pred = ref dummy,
398                  phis = ref [], mask = ref [],                  phis = ref [], mask = ref [],
399                  var = var, src = src,                  var = var, src = src,
400                  bodyEntry = ref dummy,                  bodyEntry = ref dummy,
401                  bodyExit = ref dummy,                  bodyExit = ref dummy,
402                  succ = ref dummy                  succ = ref dummy
403                })                  }))
404          fun mkCOM text = new (COM{pred = ref dummy, text = text, succ = ref dummy})          fun mkCOM text = new (COM{pred = ref dummy, text = text, succ = ref dummy})
405          fun mkASSIGN (lhs, rhs) = (          fun mkASSIGN (lhs, rhs) = (
406                Var.setBinding (lhs, VB_RHS rhs);                Var.setBinding (lhs, VB_RHS rhs);
# Line 889  Line 895 
895              String.concatWithMap "," (fn NONE => "_" | SOME x => Var.toString x) xs, ")"              String.concatWithMap "," (fn NONE => "_" | SOME x => Var.toString x) xs, ")"
896            ]            ]
897        | vbToString VB_PARAM = "PARAM"        | vbToString VB_PARAM = "PARAM"
898          | vbToString VB_ITER = "ITER"
899    
900    (* return a string representation of a PHI node *)    (* return a string representation of a PHI node *)
901      fun phiToString (y, xs) = String.concat [      fun phiToString (y, xs) = String.concat [

Legend:
Removed from v.3506  
changed lines
  Added in v.3522

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