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 /sml/branches/SMLNJ/src/MLRISC/IR/mlrisc-ir.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/MLRISC/IR/mlrisc-ir.sml

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

revision 428, Wed Sep 8 09:47:00 1999 UTC revision 429, Wed Sep 8 09:47:00 1999 UTC
# Line 19  Line 19 
19      structure Util        : CFG_UTIL      structure Util        : CFG_UTIL
20         sharing Loop.Dom = CDG.Dom         sharing Loop.Dom = CDG.Dom
21         sharing Util.CFG = CFG         sharing Util.CFG = CFG
     structure Ctrl : MLRISC_CONTROL  
22     ) : MLRISC_IR =     ) : MLRISC_IR =
23  struct  struct
24    
# Line 70  Line 69 
69      * This function defines how we compute a new view      * This function defines how we compute a new view
70      *)      *)
71    
72     val verbose = Ctrl.getFlag "verbose"     val verbose = MLRiscControl.getFlag "verbose"
73    
74     fun memo name compute =     fun memo name compute =
75     let val {get,put,rmv,...} = A.new()     let val {get,put,rmv,...} = A.new()
# Line 99  Line 98 
98      *  Extract various views from an IR      *  Extract various views from an IR
99      *)      *)
100    
101     val doms = memo "dom" Dom.dominator_trees     val dom = memo "dom" Dom.makeDominator
102     fun dom IR  = #1 (doms IR)     val pdom = memo "pdom" Dom.makePostdominator
103     fun pdom IR = #2 (doms IR)     fun doms IR = (dom IR,pdom IR)
104     val cdg  = memo "cdg"     val cdg  = memo "cdg"
105               (fn IR => CDG.control_dependence_graph CFG.cdgEdge (doms IR))               (fn IR => CDG.control_dependence_graph CFG.cdgEdge (pdom IR))
106     val loop = memo "loop" (Loop.loop_structure o dom)     val loop = memo "loop" (Loop.loop_structure o dom)
107     val changed = CFG.changed     val changed = CFG.changed
108    
# Line 116  Line 115 
115     let val {node,...} = CFG.viewStyle IR     let val {node,...} = CFG.viewStyle IR
116     in  L.makeLayout {edge = defaultEdge,     in  L.makeLayout {edge = defaultEdge,
117                       graph= defaultGraph,                       graph= defaultGraph,
118                       node = fn (x,Dom.DOM{node=n,...}) => node(x,n)} G                       node = node} G
119     end     end
120    
121     fun layoutDom IR  = layoutDom' IR (dom IR)     fun layoutDom IR  = layoutDom' IR (dom IR)
# Line 129  Line 128 
128     fun layoutLoop (IR as G.GRAPH cfg) =     fun layoutLoop (IR as G.GRAPH cfg) =
129         let val loop = loop IR         let val loop = loop IR
130             val regmap = CFG.regmap IR             val regmap = CFG.regmap IR
131               val an     = CFG.getAnnotations IR
132             fun mkNodes nodes =             fun mkNodes nodes =
133                String.concat(map (fn i => Int.toString i^" ") nodes)                String.concat(map (fn i => Int.toString i^" ") nodes)
134             fun mkEdges edges =             fun mkEdges edges =
# Line 137  Line 137 
137             fun node(_,Loop.LOOP{nesting,header,loop_nodes,             fun node(_,Loop.LOOP{nesting,header,loop_nodes,
138                                  backedges,exits,...}) =                                  backedges,exits,...}) =
139                 [L.LABEL("nesting: "^Int.toString nesting^"\n"^                 [L.LABEL("nesting: "^Int.toString nesting^"\n"^
140                          CFG.show_block regmap (#node_info cfg header)^                          CFG.show_block an regmap (#node_info cfg header)^
141                          "loop_nodes: "^mkNodes loop_nodes^"\n"^                          "loop_nodes: "^mkNodes loop_nodes^"\n"^
142                          "backedges: "^mkEdges backedges^"\n"^                          "backedges: "^mkEdges backedges^"\n"^
143                          "exits: "^mkEdges exits^"\n"                          "exits: "^mkEdges exits^"\n"

Legend:
Removed from v.428  
changed lines
  Added in v.429

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