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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 476 - (view) (download)

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 : monnier 469 CM.make "src/compiler/MLRISC-OPTIMIZER.cm";
16 : monnier 245
17 :     2. At the top level execute:
18 :    
19 :     structure M = Compiler.Control.MLRISC;
20 :    
21 : monnier 469 M.mlrisc :=true; (* enable optimizer *)
22 : monnier 245 M.getString "viewer" := "daVinci"; (* set viewer *)
23 : monnier 411 M.getFlag "view-IR" := true; (* enable viewer *)
24 : monnier 245 M.mlrisc_phases := (* set phases *)
25 : monnier 469 ["cluster->cfg", "view-dom", "cfg->cluster"];
26 : monnier 245
27 :     3. Compiling anything from here onwards, will go through the
28 :     optimizer.
29 :    
30 :     Currently, the optimizer uses two different representations:
31 :     the cluster and the IR. The cluster is the old representation used
32 :     in the register allocator and instruction selection. The IR
33 :     is the new representation. Most new optimizations operate on
34 :     the new IR.
35 :    
36 :     Several phases are possible in the mlrisc_phases list such as:
37 :    
38 :     a. view-cfg -- view control flow graph
39 :     b. view-dom -- view dominator tree
40 :     c. view-pdom -- view post dominator tree
41 :     d. view-doms -- view dominator tree and post dominator tree together.
42 :     The post dominator is upside down.
43 :     e. view-cdg -- view control dependence graph
44 :     f. view-loop -- show loop nesting tree
45 :     g. guess -- apply static branch prediction
46 :     (this need better machine descriptions)
47 :     h. reshape -- reorder the branch structure using frequencies
48 :     gathered by static branch prediction
49 :    
50 :     All phases above transform IR into IR, so
51 :     they must be enclosed in phases "cluster->cfg", and "cfg->cluster",
52 :     which translate clusters into IRs and vice versa. In addition,
53 :     there is a phase "copy-prop", which performs copy propagation on
54 :     clusters.
55 :     *)
56 :    
57 : monnier 469 Library
58 :     structure Compiler
59 :     structure MLRISCOptimizer
60 :     is
61 : monnier 245
62 : monnier 469 basis.cm
63 :     comp-lib.cm
64 :     viscomp-lib.cm
65 :     smlnj-lib.cm
66 :     host-compiler.cm
67 : monnier 245
68 : monnier 469 MLRISC.cm
69 :     (* Could use the anchors to eliminate the path *)
70 :     ../MLRISC/MLRISC-IR.cm
71 :     ../MLRISC/MLRISC-Visual.cm
72 :     ../MLRISC/MLRISC-Graphs.cm
73 :     ../MLRISC/MLRISC-ir.cm
74 : monnier 475 ../MLRISC/MLRISC-Lib.cm
75 : monnier 245
76 : monnier 469 CodeGen/optimizer/mlrisc-optimizer.sml

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