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

SCM Repository

[diderot] Diff of /trunk/src/compiler/IL/ssa-fn.sml
ViewVC logotype

Diff of /trunk/src/compiler/IL/ssa-fn.sml

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

revision 137, Wed Jul 7 21:30:23 2010 UTC revision 176, Mon Jul 26 19:47:48 2010 UTC
# Line 18  Line 18 
18          props : PropList.holder          props : PropList.holder
19        }        }
20    
21      (* a statement is a CFG fragment with a single entrypoint and
22       * a single continuation.
23       *)
24    datatype stmt    datatype stmt
25      = BLOCK of block        = BLOCK of stmt
26      | SEQ of stmt list      | SEQ of stmt list
27      | IF of {      | IF of {
28          pre : block,            pre : stmt,
29          cond : var,          cond : var,
30          trueBranch : stmt          trueBranch : stmt
31          falseBranch : stmt          falseBranch : stmt
# Line 50  Line 53 
53    
54      and rhs      and rhs
55        = VAR of var        = VAR of var
56          | LIT of Literal.literal
57        | OP of Op.rator * var list        | OP of Op.rator * var list
58          | CONS of var list                (* tensor-value construction *)
59    
60      val newVar : string -> var      val newVar : string -> var
61      val newBlock : unit -> block      val newBlock : unit -> block
62    
63        val entryBlock : stmt -> block
64        val nextBlock : stmt -> block
65    
66    end    end
67    
68  functor SSAFn (Op : OPERATORS) : SSA =  functor SSAFn (Op : OPERATORS) : SSA =
# Line 68  Line 76 
76        }        }
77    
78    datatype stmt    datatype stmt
79      = BLOCK of block      = EXIT
80      | SEQ of stmt list      | SEQ of block * stmt
81      | IF of {      | IF of {
82          pre : block,          pre : stmt,
83          cond : var,          cond : var,
84          trueBranch : stmt          trueBranch : stmt,
85          falseBranch : stmt          falseBranch : stmt,
86            next : stmt             (* ?? *)
87        }        }
88      | WHILE of {      | WHILE of {
89          hdr : block,          hdr : stmt,
90          cond : var,          cond : var,
91          body : stmt          body : stmt,
92            exit : stmt             (* ?? *)
93        }        }
94    
95    and block = BLK of {    and block = BLK of {
# Line 149  Line 159 
159    
160      end (* local *)      end (* local *)
161    
162        fun entryBlock (BLOCK blk) = blk
163          | entryBlock (SEQ(s1::_)) = entryBlock s1
164          | entryBlock (IF{pre, ...}) = entryBlock pre
165          | entryBlock (WHILE{hdr, ...}) = entryBlock hdr
166    
167        fun nextBlock (SEQ(, next)) = nextBlock next
168          | nextBlock (SEQ stms) = nextBlock(List.last stms)
169          | nextBlock (IF{pre, ...}) = entryBlock pre
170          | nextBlock (WHILE{hdr, ...}) = entryBlock hdr
171    
172    end    end

Legend:
Removed from v.137  
changed lines
  Added in v.176

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