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

SCM Repository

[smlnj] Annotation of /sml/trunk/compiler/MLRISC-OPTIMIZER.cm
ViewVC logotype

Annotation of /sml/trunk/compiler/MLRISC-OPTIMIZER.cm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download)
Original Path: sml/branches/SMLNJ/src/compiler/MLRISC-OPTIMIZER.cm

1 : monnier 245 (* This file is intended to load MLRISC optimization modules within
2 :     * the toplevel interactive loop. At present various compiler data
3 :     * structures can be graphically viewed.
4 :     *)
5 :    
6 :     (* The following steps are required:
7 :     Requires:
8 :     daVinci: ftp://ftp.uni-bremen.de/pub/graphics/daVinci,
9 :     or
10 :     vcg: http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.html
11 :    
12 :    
13 :     1. Load the optimizer sources:
14 :    
15 :     CM.make'{force_relink=false,
16 :     group="src/compiler/MLRISC-OPTIMIZER.cm"};
17 :    
18 :     2. At the top level execute:
19 :    
20 :     structure M = Compiler.Control.MLRISC;
21 :    
22 : monnier 411 M.mlrisc" :=true; (* enable optimizer *)
23 : monnier 245 M.getString "viewer" := "daVinci"; (* set viewer *)
24 : monnier 411 M.getFlag "view-IR" := true; (* enable viewer *)
25 : monnier 245 M.mlrisc_phases := (* set phases *)
26 :     ["cluster->cfg", "view-dom", "cfg->cluster"];
27 :    
28 :     3. Compiling anything from here onwards, will go through the
29 :     optimizer.
30 :    
31 :     Currently, the optimizer uses two different representations:
32 :     the cluster and the IR. The cluster is the old representation used
33 :     in the register allocator and instruction selection. The IR
34 :     is the new representation. Most new optimizations operate on
35 :     the new IR.
36 :    
37 :     Several phases are possible in the mlrisc_phases list such as:
38 :    
39 :     a. view-cfg -- view control flow graph
40 :     b. view-dom -- view dominator tree
41 :     c. view-pdom -- view post dominator tree
42 :     d. view-doms -- view dominator tree and post dominator tree together.
43 :     The post dominator is upside down.
44 :     e. view-cdg -- view control dependence graph
45 :     f. view-loop -- show loop nesting tree
46 :     g. guess -- apply static branch prediction
47 :     (this need better machine descriptions)
48 :     h. reshape -- reorder the branch structure using frequencies
49 :     gathered by static branch prediction
50 :    
51 :     All phases above transform IR into IR, so
52 :     they must be enclosed in phases "cluster->cfg", and "cfg->cluster",
53 :     which translate clusters into IRs and vice versa. In addition,
54 :     there is a phase "copy-prop", which performs copy propagation on
55 :     clusters.
56 :     *)
57 :    
58 :     Group is
59 :    
60 :     CodeGen/optimizer/mlrisc-optimizer.sml
61 :     CodeGen/optimizer/mlrisc-environment.sml
62 :    
63 : monnier 411 ../MLRISC/library/sources.cm
64 :     ../MLRISC/graphs/sources.cm
65 :     ../MLRISC/visualization/sources.cm
66 :     ../MLRISC/ir/sources.cm
67 : monnier 245
68 :     ../MLRISC/IR/dataflow.sig
69 :     ../MLRISC/IR/dataflow.sml
70 :     ../MLRISC/IR/mlrisc-cfg-util.sig
71 :     ../MLRISC/IR/mlrisc-cfg-util.sml
72 :     ../MLRISC/IR/mlrisc-cfg.sig
73 :     ../MLRISC/IR/mlrisc-cfg.sml
74 :     ../MLRISC/IR/mlrisc-cfg2cluster.sml
75 :     ../MLRISC/IR/mlrisc-cluster2cfg.sml
76 :     ../MLRISC/IR/mlrisc-format-insn.sml
77 :     ../MLRISC/IR/mlrisc-ir.sig
78 :     ../MLRISC/IR/mlrisc-ir.sml
79 :     ../MLRISC/IR/mlrisc-liveness.sml
80 :     ../MLRISC/IR/mlrisc-reshape-branches.sig
81 :     ../MLRISC/IR/mlrisc-reshape-branches.sml
82 :     ../MLRISC/IR/static-branch-prediction.sig
83 :     ../MLRISC/IR/static-branch-prediction.sml
84 :    
85 :     ../MLRISC/Glue/mlrisc-glue.sig
86 :     ../MLRISC/Glue/mlrisc-glue.sml
87 : monnier 411

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