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

SCM Repository

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

Diff of /branches/lamont/src/compiler/IL/ssa-fn.sml

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

revision 2297, Fri Mar 15 22:05:31 2013 UTC revision 2298, Fri Mar 15 22:18:22 2013 UTC
# Line 117  Line 117 
117        | OP of Op.rator * var list        | OP of Op.rator * var list
118        | APPLY of MathFuns.name * var list (* basis function application *)        | APPLY of MathFuns.name * var list (* basis function application *)
119        | CONS of Ty.ty * var list        (* tensor/sequence-value construction *)        | CONS of Ty.ty * var list        (* tensor/sequence-value construction *)
120    
121      and var = V of {      and var = V of {
122          name : string,                  (* name *)          name : string,                  (* name *)
123          id : Stamp.stamp,               (* unique ID *)          id : Stamp.stamp,               (* unique ID *)
# Line 310  Line 311 
311                  pred = ref dummy, cond = cond,                  pred = ref dummy, cond = cond,
312                  trueBranch = ref trueBranch, falseBranch = ref falseBranch                  trueBranch = ref trueBranch, falseBranch = ref falseBranch
313                })                })
314          fun mkFOREACH {cond,stmBranch,sName,phis} = (          fun mkFOREACH {cond,stmBranch,sName,phis} = new (FOREACH{
315            new (FOREACH{pred = ref dummy, cond = cond, stmBranch = ref stmBranch,                  pred = ref dummy, cond = cond, stmBranch = ref stmBranch,
316                         phis = ref phis, shouldReplace = ref false, varStrandName = ref sName,                         phis = ref phis, shouldReplace = ref false, varStrandName = ref sName,
317                        stmBranchDone = ref false,  succ = ref dummy}))                  stmBranchDone = ref false,  succ = ref dummy
318                  })
319          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})
320          fun mkASSIGN (lhs, rhs) = (          fun mkASSIGN (lhs, rhs) = (
321                Var.setBinding (lhs, VB_RHS rhs);                Var.setBinding (lhs, VB_RHS rhs);
# Line 698  Line 700 
700                  appf                  appf
701                end                end
702    
703    (*  fun reductionSame(r,r') = (case (r,r')    (*
704            fun reductionSame(r,r') = (case (r,r')
705          of (R_Max,R_Max) => true          of (R_Max,R_Max) => true
706           | (R_Min,R_Min) => true           | (R_Min,R_Min) => true
707           | (R_Or,R_Or) => true           | (R_Or,R_Or) => true
# Line 706  Line 709 
709           | (R_Xor,R_Xor) => true           | (R_Xor,R_Xor) => true
710           | (R_Product,R_Product) => true           | (R_Product,R_Product) => true
711           | (R_Sum,R_Sum) => true           | (R_Sum,R_Sum) => true
712           | (_,_) => false)                  | (_,_) => false
713                  (* end case *))
714    
715      fun reductionToString(r) = (case r      fun reductionToString(r) = (case r
716       of R_Max => "max"       of R_Max => "max"
# Line 716  Line 719 
719        | R_And => "and"        | R_And => "and"
720        | R_Xor => "xor"        | R_Xor => "xor"
721        | R_Product => "product"        | R_Product => "product"
722        | R_Sum => "sum") *)                  | R_Sum => "sum"
723                  (* end case *))
724    *)
725    
726      fun toStringSets(sets) = let      fun toStringSets sets = let
727        fun ppSetsList([]) = []            fun ppSetsList [] = []
728          | ppSetsList(x::[]) = (case x              | ppSetsList [x] = (case x
729              of SS_All => ["all"]              of SS_All => ["all"]
730               | SS_Active => ["active"]               | SS_Active => ["active"]
731               | SS_Stable => ["stable"])                    | SS_Stable => ["stable"]
732                    (* end case *))
733          | ppSetsList(x::xs) = (case x          | ppSetsList(x::xs) = (case x
734              of SS_All => "all,"::ppSetsList(xs)              of SS_All => "all,"::ppSetsList(xs)
735               | SS_Active => "active,"::ppSetsList(xs)               | SS_Active => "active,"::ppSetsList(xs)
736               | SS_Stable => "stable,"::ppSetsList(xs))                    | SS_Stable => "stable,"::ppSetsList(xs)
737                    (* end case *))
738        in        in
739           ppSetsList(sets)              ppSetsList sets
740        end        end
741    
742     fun strandSetSame(s,s') = let  (* FIXME: there must be a better way to implement this, since this code is broken and inefficient *)
743            fun strandSetSame (s : strand_set list, s') = let
744        fun same ([],[]) =  true        fun same ([],[]) =  true
745        | same(t,[]) = false        | same(t,[]) = false
746        | same([],t) = false        | same([],t) = false
747        | same((x::xs),(x'::xs')) =                  | same ((x : string)::xs, x'::xs') =
748            if (x = x')            if (x = x')
749            then same(xs,xs')            then same(xs,xs')
750            else false            else false

Legend:
Removed from v.2297  
changed lines
  Added in v.2298

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