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/compiler/MLRISC-OPTIMIZER.cm
ViewVC logotype

View of /sml/trunk/src/compiler/MLRISC-OPTIMIZER.cm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (download) (annotate)
Thu Jun 1 18:34:03 2000 UTC (19 years, 5 months ago) by monnier
File size: 2431 byte(s)
bring revisions from the vendor branch to the trunk
(* This file is intended to load MLRISC optimization modules within
 * the toplevel interactive loop. At present various compiler data
 * structures can be graphically viewed. 
 *)

(* The following steps are required:
  Requires:
     daVinci: ftp://ftp.uni-bremen.de/pub/graphics/daVinci, 
    or
     vcg: http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.html
  

  1. Load the optimizer sources:

	CM.make "src/compiler/MLRISC-OPTIMIZER.cm";

  2. At the top level execute:

       structure M = Compiler.Control.MLRISC;

       M.mlrisc :=true;				(* enable optimizer *)
       M.getString "viewer" := "daVinci";	(* set viewer *)
       M.getFlag "view-IR" := true;		(* enable viewer *)
       M.mlrisc_phases :=			(* set phases *)
	 ["cluster->cfg", "view-dom", "cfg->cluster"];

  3. Compiling anything from here onwards, will go through the 
     optimizer. 

  Currently, the optimizer uses two different representations:
  the cluster and the IR.  The cluster is the old representation used
  in the register allocator and instruction selection.  The IR
  is the new representation.  Most new optimizations operate on
  the new IR.

  Several phases are possible in the mlrisc_phases list such as:

   a. view-cfg  -- view control flow graph
   b. view-dom  -- view dominator tree
   c. view-pdom -- view post dominator tree
   d. view-doms -- view dominator tree and post dominator tree together.
                   The post dominator is upside down.
   e. view-cdg  -- view control dependence graph
   f. view-loop -- show loop nesting tree
   g. guess     -- apply static branch prediction
                   (this need better machine descriptions)
   h. reshape   -- reorder the branch structure using frequencies 
                    gathered by static branch prediction

  All phases above transform IR into IR, so 
  they must be enclosed in phases "cluster->cfg", and "cfg->cluster",
  which translate clusters into IRs and vice versa.  In addition,
  there is a phase "copy-prop", which performs copy propagation on
  clusters.
*)

Library
  structure Compiler
  structure MLRISCOptimizer
is

  basis.cm
  comp-lib.cm
  viscomp-lib.cm
  smlnj-lib.cm
  host-compiler.cm

  MLRISC.cm
	(* Could use the anchors to eliminate the path *)
  ../MLRISC/MLRISC-IR.cm
  ../MLRISC/MLRISC-Visual.cm
  ../MLRISC/MLRISC-Graphs.cm
  ../MLRISC/MLRISC-ir.cm
  ../MLRISC/MLRISC-Lib.cm

  CodeGen/optimizer/mlrisc-optimizer.sml

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