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-cfg.sig
ViewVC logotype

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

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

revision 410, Fri Sep 3 00:25:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1  (*  (*
2   * Control flow graph data structure.   * Control flow graph data structure used by the MLRISC IR.
3     * All basic optimizations are based on this representation.
4     *
5     * -- Allen
6   *)   *)
7    
8  signature CONTROL_FLOW_GRAPH =  signature CONTROL_FLOW_GRAPH =
# Line 9  Line 12 
12     structure B : BLOCK_NAMES     structure B : BLOCK_NAMES
13     structure P : PSEUDO_OPS     structure P : PSEUDO_OPS
14     structure C : CELLS     structure C : CELLS
15     structure W : FIXED_POINT     structure W : FREQ
16        sharing I.C = C        sharing I.C = C
17    
18     type weight = W.fixed_point     type weight = W.freq
19    
20     datatype block_kind =     datatype block_kind =
21         START          (* entry node *)         START          (* entry node *)
# Line 24  Line 27 
27     and data = LABEL  of Label.label     and data = LABEL  of Label.label
28              | PSEUDO of P.pseudo_op              | PSEUDO of P.pseudo_op
29    
30       (*
31        * NOTE: the instructions are listed in reverse order.
32        * This choice is for a few reasons:
33        * i)  Clusters represent instructions in reverse order, so keeping this
34        *     the same avoid having to do conversions.
35        * ii) This makes it easier to add instructions at the end of the block,
36        *     which is more common than adding instructions to the front.
37        * iii) This also makes it easier to manipulate the branch/jump instruction
38        *      at the end of the block.
39        *)
40    
41     and block =     and block =
42        BLOCK of        BLOCK of
43        {  id          : int,                        (* block id *)        {  id          : int,                        (* block id *)
# Line 54  Line 68 
68     type node = block Graph.node     type node = block Graph.node
69    
70     datatype info =     datatype info =
71         INFO of { regmap      : C.regmap,         INFO of { regmap      : C.regmap ref,
72                   annotations : Annotations.annotations ref,                   annotations : Annotations.annotations ref,
73                   firstBlock  : int ref,                   firstBlock  : int ref,
74                   reorder     : bool ref                   reorder     : bool ref
# Line 76  Line 90 
90     *  Methods for manipulating basic blocks     *  Methods for manipulating basic blocks
91     *     *
92     *========================================================================*)     *========================================================================*)
93     val newBlock          : int * B.name -> block      (* empty *)     val newBlock          : int * B.name * W.freq ref -> block (* empty *)
94     val newStart          : int -> block               (* start node *)     val newStart          : int * W.freq ref -> block          (* start node *)
95     val newStop           : int -> block               (* stop node *)     val newStop           : int * W.freq ref -> block          (* stop node *)
96     val newFunctionEntry  : int -> block               (* fun entry node *)     val newFunctionEntry  : int * W.freq ref -> block  (* fun entry node *)
97     val copyBlock         : int * block -> block       (* copy a block *)     val copyBlock         : int * block -> block       (* copy a block *)
98     val defineLabel       : block -> Label.label       (* define a label *)     val defineLabel       : block -> Label.label       (* define a label *)
99     val emit              : C.regmap -> block -> unit  (* emit assembly *)     val emit              : C.regmap -> block -> unit  (* emit assembly *)
# Line 97  Line 111 
111     val changed  : cfg -> unit      (* mark cfg as changed *)     val changed  : cfg -> unit      (* mark cfg as changed *)
112    
113     val regmap    : cfg -> C.regmap     val regmap    : cfg -> C.regmap
114       val setRegmap      : cfg * C.regmap -> unit
115       val setAnnotations : cfg * Annotations.annotations -> unit
116     val reglookup : cfg -> C.register -> C.register     val reglookup : cfg -> C.register -> C.register
117     val liveOut   : block -> C.cellset     val liveOut   : block -> C.cellset
118     val fallsThruFrom : cfg * Graph.node_id -> Graph.node_id option     val fallsThruFrom : cfg * Graph.node_id -> Graph.node_id option
# Line 123  Line 139 
139    
140  end  end
141    
 (*  
  * $Log$  
  *)  
   

Legend:
Removed from v.410  
changed lines
  Added in v.411

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