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

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/cluster/flowgraph.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/cluster/flowgraph.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 412 - (download) (annotate)
Fri Sep 3 00:25:03 1999 UTC (20 years, 1 month ago) by monnier
File size: 2336 byte(s)
This commit was generated by cvs2svn to compensate for changes in r411,
which included commits to RCS files with non-trunk default branches.
(* flowgraph.sml
 *
 * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
 *
 * Defines the flowgraph data structure used as the intermediate program
 * representation.
 *
 *)

signature FLOWGRAPH = sig

  structure B : BLOCK_NAMES
  structure C : CELLS
  structure I : INSTRUCTIONS
  structure P : PSEUDO_OPS
  structure W : FREQ
	  sharing I.C = C

  datatype block =
      PSEUDO of P.pseudo_op
    | LABEL of Label.label
    | BBLOCK of { blknum      : int,
                  freq        : W.freq ref,
                  annotations : Annotations.annotations ref,
		  name        : B.name,
		  liveIn      : C.cellset ref,
		  liveOut     : C.cellset ref,
		  succ 	      : edge list ref,
		  pred 	      : edge list ref,
		  insns	      : I.instruction list ref
	        }
    | ENTRY of {blknum : int, freq : W.freq ref, succ : edge list ref}
    | EXIT of {blknum : int, freq : W.freq ref, pred : edge list ref}
  withtype edge = block * W.freq ref

  datatype cluster = 
      CLUSTER of {
        blocks: block list, 
	entry : block,
	exit  : block,	  
        regmap: C.regmap,
        blkCounter : int ref,
        annotations : Annotations.annotations ref
      }
end


(*  Create the flowgraph data structure specialized towards	
 *  a specific type of cells and instructions.
 *)
functor FlowGraph(structure I : INSTRUCTIONS
		  structure P : PSEUDO_OPS
		  structure B : BLOCK_NAMES) : FLOWGRAPH = 
struct
  structure I = I
  structure C = I.C
  structure P = P
  structure B = B
  structure W = Freq

  datatype block =
      PSEUDO of P.pseudo_op
    | LABEL of Label.label
    | BBLOCK of { blknum      : int,
                  freq        : W.freq ref,
                  annotations : Annotations.annotations ref,
		  name        : B.name,
		  liveIn      : C.cellset ref,
		  liveOut     : C.cellset ref,
		  succ 	      : edge list ref,
		  pred 	      : edge list ref,
		  insns	      : I.instruction list ref
	        }
    | ENTRY of {blknum : int, freq : W.freq ref, succ : edge list ref}
    | EXIT of {blknum : int, freq : W.freq ref, pred : edge list ref}
  withtype edge = block * W.freq ref

  datatype cluster = 
      CLUSTER of {
        blocks: block list, 
	entry : block,
	exit  : block,	  
        regmap: C.regmap,
        blkCounter : int ref,
        annotations : Annotations.annotations ref
      }
end

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