Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /MLRISC/releases/release-110.64/IR/mlrisc-ir.sml
ViewVC logotype

Diff of /MLRISC/releases/release-110.64/IR/mlrisc-ir.sml

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

sml/branches/SMLNJ/src/MLRISC/IR/mlrisc-ir.sml revision 469, Wed Nov 10 22:42:52 1999 UTC sml/trunk/src/MLRISC/IR/mlrisc-ir.sml revision 744, Fri Dec 8 04:11:42 2000 UTC
# Line 11  Line 11 
11   * -- Allen   * -- Allen
12   *)   *)
13    
14  functor MLRISC_IRFn  functor MLRISC_IR
15     (structure CFG         : CONTROL_FLOW_GRAPH     (structure CFG         : CONTROL_FLOW_GRAPH
16      structure CDG         : CONTROL_DEPENDENCE_GRAPH      structure CDG         : CONTROL_DEPENDENCE_GRAPH
17      structure Loop        : LOOP_STRUCTURE      structure Loop        : LOOP_STRUCTURE
# Line 72  Line 72 
72     val verbose = MLRiscControl.getFlag "verbose"     val verbose = MLRiscControl.getFlag "verbose"
73    
74     fun memo name compute =     fun memo name compute =
75     let val {get,set,rmv,...} = A.new NONE     let val {get,set,...} = A.new(SOME(fn _ => name))
76         fun getView(IR as G.GRAPH{graph_info=CFG.INFO{annotations,...},...}:IR)=         fun getView(IR as G.GRAPH ir : IR)=
77         let fun process(SOME(ref(SOME info))) =         let val CFG.INFO{annotations, ...} = #graph_info ir
78               fun process(SOME(ref(SOME info))) =
79                   (if !verbose then print ("[reusing "^name^"]") else (); info)                   (if !verbose then print ("[reusing "^name^"]") else (); info)
80               | process(SOME r) =               | process(SOME r) =
81                   let val _    = if !verbose then print("[computing "^name)                   let val _    =
82                                  else ()                          if !verbose then print("[computing "^name) else ()
83                       val info = compute IR                       val info = compute IR
84                       val _    = if !verbose then print "]" else ()                       val _    = if !verbose then print "]" else ()
85                   in  r := SOME info; info end                   in  r := SOME info; info end
# Line 87  Line 88 
88                    fun kill() = (r := NONE;                    fun kill() = (r := NONE;
89                                  if !verbose then print("[uncaching "^name^"]")                                  if !verbose then print("[uncaching "^name^"]")
90                                  else ())                                  else ())
91                in  annotations := #create CFG.CHANGED kill ::                in  annotations := #create CFG.CHANGED(name, kill) ::
92                                   set(r,!annotations);                                   set(r,!annotations);
93                    process(SOME r)                    process(SOME r)
94                end                end
# Line 128  Line 129 
129     fun layoutCDG IR = CFG.viewLayout(cdg IR)     fun layoutCDG IR = CFG.viewLayout(cdg IR)
130     fun layoutLoop (IR as G.GRAPH cfg) =     fun layoutLoop (IR as G.GRAPH cfg) =
131         let val loop   = loop IR         let val loop   = loop IR
132             val regmap = CFG.regmap IR             val an     = !(CFG.annotations IR)
            val an     = CFG.getAnnotations IR  
133             fun mkNodes nodes =             fun mkNodes nodes =
134                String.concat(map (fn i => Int.toString i^" ") nodes)                String.concat(map (fn i => Int.toString i^" ") nodes)
135             fun mkEdges edges =             fun mkEdges edges =
# Line 139  Line 139 
139                                  backedges,exits,...}) =                                  backedges,exits,...}) =
140                 [L.LABEL                 [L.LABEL
141                  ("nesting: "^Int.toString nesting^"\n"^                  ("nesting: "^Int.toString nesting^"\n"^
142                   CFG.show_block an regmap (#node_info cfg header)^                   CFG.show_block an (#node_info cfg header)^
143                   "entry edges: "^mkEdges(Loop.entryEdges loop header)^"\n"^                   "entry edges: "^mkEdges(Loop.entryEdges loop header)^"\n"^
144                   "loop_nodes: "^mkNodes loop_nodes^"\n"^                   "loop_nodes: "^mkNodes loop_nodes^"\n"^
145                   "backedges: "^mkEdges backedges^"\n"^                   "backedges: "^mkEdges backedges^"\n"^

Legend:
Removed from v.469  
changed lines
  Added in v.744

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