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/block-placement/default-block-placement.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/block-placement/default-block-placement.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 906 - (download) (annotate)
Fri Aug 24 17:36:40 2001 UTC (17 years, 10 months ago) by george
File size: 677 byte(s)
Initial revision
(* default-block-placement.sml
 *
 * COPYRIGHT (c) 2001 Bell Labs, Lucent Technologies
 *)

(* Just the order in which blocks were generated *)
functor DefaultBlockPlacement (CFG : CONTROL_FLOW_GRAPH) : BLOCK_PLACEMENT = 
struct
  structure CFG=CFG
  structure G = Graph

  fun error msg = MLRiscErrorMsg.error ("NaiveBlockPlacement", msg)

  fun blockPlacement (cfg as G.GRAPH graph) = let
    val ENTRY = 
      (case #entries graph () of [n] => n | _ => error "ENTRY")
    val EXIT = 
      (case #exits graph () of [n] => n | _ => error "EXIT")

  in 
      List.filter
         (fn (i, CFG.BLOCK{kind, ...}) => i <> ENTRY andalso i <> EXIT)
	 (#nodes graph ())
  end 
end

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