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/flowgraph/cfgExpandCopies.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 906 - (download) (annotate)
Fri Aug 24 17:36:40 2001 UTC (18 years, 1 month ago) by george
File size: 678 byte(s)
Initial revision
(* cfgExpandCopies.sml
 *
 * COPYRIGHT (c) 2001 Bell Labs, Lucent Technologies
 *
 * This module expands all parallel copies into normal instructions
 *)

functor CFGExpandCopies
   (structure CFG    : CONTROL_FLOW_GRAPH
    structure ExpandCopies : EXPAND_COPIES
       sharing CFG.I = ExpandCopies.I
   ) : CFG_OPTIMIZATION =
  struct
    structure CFG = CFG

    val name = "expand copies"

    fun run (cfg as Graph.GRAPH graph) = let
	  fun expand (_, CFG.BLOCK{insns, ...}) =
	        insns := List.foldr
		  (fn (i, rest) => List.revAppend(ExpandCopies.expandCopies i,rest))
		  []
                  (!insns)
	  in
	    #forall_nodes graph expand;
	    cfg
	  end

  end

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