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 4338, Mon Aug 1 19:16:52 2016 UTC revision 4339, Mon Aug 1 19:46:37 2016 UTC
# Line 92  Line 92 
92              rhs : var,              rhs : var,
93              succ : node ref              succ : node ref
94            }            }
95          | MAPREDUCE of {                  (* map-reduce statement *)
96                pred : node ref,
97                lhs : var list,             (* results of the map-reduce *)
98                reds : Reductions.t list,   (* the reduction operators (one per result) *)
99                mapf : func,                (* the map operation *)
100                args : var list,            (* the arguments to the map; the first arg will be `src` *)
101                src : var,                  (* binding occurrence for the strand variable *)
102                succ : node ref
103              }
104        | NEW of {                        (* create new strand instance *)        | NEW of {                        (* create new strand instance *)
105              pred : node ref,              pred : node ref,
106              strand : Atom.atom,              strand : Atom.atom,
# Line 139  Line 148 
148        | VB_PHI of var option list       (* defined by a phi node *)        | VB_PHI of var option list       (* defined by a phi node *)
149        | VB_PARAM                        (* parameter to a strand *)        | VB_PARAM                        (* parameter to a strand *)
150        | VB_ITER                         (* bound in a foreach loop *)        | VB_ITER                         (* bound in a foreach loop *)
151          | VB_MAPREDUCE                    (* bound in a MAPREDUCE node *)
152    
153    (***** global variables *****)    (***** global variables *****)
154      and global_var = GV of {      and global_var = GV of {
# Line 432  Line 442 
442                        | ASSIGN _ => "ASSIGN"                        | ASSIGN _ => "ASSIGN"
443                        | MASSIGN _ => "MASSIGN"                        | MASSIGN _ => "MASSIGN"
444                        | GASSIGN _ => "GASSIGN"                        | GASSIGN _ => "GASSIGN"
445                          | MAPREDUCE _ => "MAPREDUCE"
446                        | NEW _ => "NEW"                        | NEW _ => "NEW"
447                        | SAVE _ => "SAVE"                        | SAVE _ => "SAVE"
448                        | EXIT{kind=ExitKind.RETURN _, ...} => "RETURN"                        | EXIT{kind=ExitKind.RETURN _, ...} => "RETURN"
# Line 517  Line 528 
528          fun mkGASSIGN (lhs, rhs) = (          fun mkGASSIGN (lhs, rhs) = (
529                if not(GlobalVar.isVarying lhs) then GlobalVar.setBinding(lhs, rhs) else ();                if not(GlobalVar.isVarying lhs) then GlobalVar.setBinding(lhs, rhs) else ();
530                new (GASSIGN{pred = ref dummy, lhs = lhs, rhs = rhs, succ = ref dummy}))                new (GASSIGN{pred = ref dummy, lhs = lhs, rhs = rhs, succ = ref dummy}))
531          fun mkNEW {strand, args} = new (NEW{          fun mkMAPREDUCE (lhs, reds, f, args, src) = (
532                  List.app (fn x => Var.setBinding (x, VB_MAPREDUCE)) lhs;
533                  new (MAPREDUCE{
534                      pred = ref dummy, lhs = lhs, reds = reds,
535                      mapf = f, args = args, src = src, succ = ref dummy
536                    }))
537            fun mkNEW (strand, args) = new (NEW{
538                  pred = ref dummy, strand = strand, args = args, succ = ref dummy                  pred = ref dummy, strand = strand, args = args, succ = ref dummy
539                })                })
540          fun mkSAVE (lhs, rhs) = new (SAVE{          fun mkSAVE (lhs, rhs) = new (SAVE{
# Line 554  Line 571 
571                  | ASSIGN{pred, ...} => pred := nd                  | ASSIGN{pred, ...} => pred := nd
572                  | MASSIGN{pred, ...} => pred := nd                  | MASSIGN{pred, ...} => pred := nd
573                  | GASSIGN{pred, ...} => pred := nd                  | GASSIGN{pred, ...} => pred := nd
574                    | MAPREDUCE{pred, ...} => pred := nd
575                  | NEW{pred, ...} => pred := nd                  | NEW{pred, ...} => pred := nd
576                  | SAVE{pred, ...} => pred := nd                  | SAVE{pred, ...} => pred := nd
577                  | EXIT{pred, ...} => pred := nd                  | EXIT{pred, ...} => pred := nd
# Line 569  Line 587 
587                  | ASSIGN{pred, ...} => [!pred]                  | ASSIGN{pred, ...} => [!pred]
588                  | MASSIGN{pred, ...} => [!pred]                  | MASSIGN{pred, ...} => [!pred]
589                  | GASSIGN{pred, ...} => [!pred]                  | GASSIGN{pred, ...} => [!pred]
590                    | MAPREDUCE{pred, ...} => [!pred]
591                  | NEW{pred, ...} => [!pred]                  | NEW{pred, ...} => [!pred]
592                  | SAVE{pred, ...} => [!pred]                  | SAVE{pred, ...} => [!pred]
593                  | EXIT{pred, ...} => [!pred]                  | EXIT{pred, ...} => [!pred]
# Line 585  Line 604 
604                  | MASSIGN _ => true                  | MASSIGN _ => true
605                  | GASSIGN _ => true                  | GASSIGN _ => true
606                  | NEW _ => true                  | NEW _ => true
607                    | MAPREDUCE _ => true
608                  | SAVE _ => true                  | SAVE _ => true
609                  | EXIT{succ=ref(SOME _), ...} => true                  | EXIT{succ=ref(SOME _), ...} => true
610                  | EXIT _ => false                  | EXIT _ => false
# Line 600  Line 620 
620                  | ASSIGN{succ, ...} => succ := nd                  | ASSIGN{succ, ...} => succ := nd
621                  | MASSIGN{succ, ...} => succ := nd                  | MASSIGN{succ, ...} => succ := nd
622                  | GASSIGN{succ, ...} => succ := nd                  | GASSIGN{succ, ...} => succ := nd
623                    | MAPREDUCE{succ, ...} => succ := nd
624                  | NEW{succ, ...} => succ := nd                  | NEW{succ, ...} => succ := nd
625                  | SAVE{succ, ...} => succ := nd                  | SAVE{succ, ...} => succ := nd
626                  | EXIT{succ, ...} => succ := SOME nd                  | EXIT{succ, ...} => succ := SOME nd
# Line 615  Line 636 
636                  | ASSIGN{succ, ...} => [!succ]                  | ASSIGN{succ, ...} => [!succ]
637                  | MASSIGN{succ, ...} => [!succ]                  | MASSIGN{succ, ...} => [!succ]
638                  | GASSIGN{succ, ...} => [!succ]                  | GASSIGN{succ, ...} => [!succ]
639                    | MAPREDUCE{succ, ...} => [!succ]
640                  | NEW{succ, ...} => [!succ]                  | NEW{succ, ...} => [!succ]
641                  | SAVE{succ, ...} => [!succ]                  | SAVE{succ, ...} => [!succ]
642                  | EXIT{succ=ref(SOME nd), ...} => [nd]                  | EXIT{succ=ref(SOME nd), ...} => [nd]
# Line 1036  Line 1058 
1058            ]            ]
1059        | vbToString VB_PARAM = "PARAM"        | vbToString VB_PARAM = "PARAM"
1060        | vbToString VB_ITER = "ITER"        | vbToString VB_ITER = "ITER"
1061          | vbToString VB_MAPREDUCE = "MAPREDUCE"
1062    
1063    (* return a string representation of a PHI node *)    (* return a string representation of a PHI node *)
1064      fun phiToString (y, xs) = String.concat [      fun phiToString (y, xs) = String.concat [

Legend:
Removed from v.4338  
changed lines
  Added in v.4339

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