SCM Repository
Annotation of /trunk/src/compiler/README
Parent Directory
|
Revision Log
Revision 1116 - (view) (download)
1 : | jhr | 325 | This directory contains the sources of Diderot compiler. The compiler is |
2 : | organized into a series of passes, each of which takes a Diderot program | ||
3 : | in some representation and produces a new representation. Here is a summary | ||
4 : | of the passes: | ||
5 : | |||
6 : | 1) Scanning and parsing | ||
7 : | This phase scans and parses the Diderot source program. | ||
8 : | (see parser) | ||
9 : | |||
10 : | 2) Typechecking | ||
11 : | This phase takes the parse tree and typechecks it, producing a typed | ||
12 : | AST representation. | ||
13 : | (see ast, basis, parser, typechecker) | ||
14 : | |||
15 : | 3) Simplification | ||
16 : | This takes the Typed AST representation and produces the Simple AST | ||
17 : | representation. Simple AST only allows simple expressions over | ||
18 : | jhr | 445 | variables. This phase is also responsible for loading the image |
19 : | summary information. To do so, we determine which input variables are | ||
20 : | jhr | 1116 | required to load the images, get the values from the user, and then |
21 : | jhr | 445 | evaluate the static code (including using dnorm to get image info). |
22 : | jhr | 325 | (see ast, simplify) |
23 : | |||
24 : | 4) Translation to HighIL | ||
25 : | This pass takes the Simple AST representation and translates it to | ||
26 : | HighIL representation, which is a block-structured SSA representation. | ||
27 : | (see basis, high-il, IL, simplify, translation) | ||
28 : | |||
29 : | 5) HighIL optimization | ||
30 : | jhr | 430 | The HighIL optimization phase is mostly a normalization phase that |
31 : | lifts static computations to the global level and eliminates | ||
32 : | dynamic field, kernel, and image values (i.e., statically resolves | ||
33 : | them). | ||
34 : | jhr | 1116 | (see high-il, IL) |
35 : | jhr | 325 | |
36 : | 6) Translation to MidIL | ||
37 : | jhr | 430 | This pass translates the HighIL representation to MidIL. The main |
38 : | purpose of this step is to replace fields with convolved images. | ||
39 : | The MidIL includes operations to transform world-space positions | ||
40 : | to image-space, to load voxels from images, and to evaluate kernels. | ||
41 : | The MidIL representation supports vector operations, but tensors | ||
42 : | with order > 1 are flattened. | ||
43 : | jhr | 325 | (see high-il, high-to-mid, IL, mid-il) |
44 : | |||
45 : | 7) MidIL optimization | ||
46 : | *** Not implemented yet *** | ||
47 : | jhr | 1116 | (see mid-il, IL) |
48 : | jhr | 325 | |
49 : | jhr | 1116 | 8) Translation to LowIL |
50 : | This pass translates the MidIL representation to LowIL. It expands | ||
51 : | kernel evaluations into their piecewise polynomial equivalents and | ||
52 : | it expands out the address calculations for voxel addresses. | ||
53 : | jhr | 325 | (see IL, low-il, mid-il, mid-to-low) |
54 : | |||
55 : | jhr | 1116 | 9) LowIL optimization |
56 : | jhr | 325 | *** Not implemented yet *** |
57 : | jhr | 1116 | (see IL, low-il) |
58 : | jhr | 325 | |
59 : | jhr | 1116 | 10) Translation to TreeIL |
60 : | The first part of code generation is to turn SSA assignments into | ||
61 : | expression trees and to turn the CFG into block structured code. | ||
62 : | This is accomplished by the translation from LowIL to TreeIL, which | ||
63 : | uses the same operators and types as LowIL. This phase also includes | ||
64 : | a transformation of the LowIL to properly handle variable scoping. | ||
65 : | (see IL, low-il, tree-il) | ||
66 : | |||
67 : | 11) TreeIL optimization | ||
68 : | jhr | 325 | *** Not implemented yet *** |
69 : | jhr | 1116 | This pass will cleanup some of the artifacts from the SSA form by |
70 : | coalescing variables. | ||
71 : | (see tree-il) | ||
72 : | jhr | 325 | |
73 : | jhr | 1116 | 12) Code generation |
74 : | After translation to TreeIL, we generate code using the abstract TARGET | ||
75 : | interface. | ||
76 : | (see c-target, codegen, tree-il) | ||
77 : | |||
78 : | jhr | 325 | And here is a roadmap of the subdirectories: |
79 : | |||
80 : | IL - The generic IL modules that are used for the HighIL, | ||
81 : | MidIL, and LowIL representations. | ||
82 : | IL/gen - A simple program generator for the IL modules. | ||
83 : | ast - The typed AST representation | ||
84 : | basis - The definition of the Diderot Basis environment | ||
85 : | jhr | 430 | c-target - Backend support for generating C code. |
86 : | jhr | 1116 | codegen - Generic code-generation infrastructure, including the |
87 : | TreeIL representation | ||
88 : | jhr | 325 | common - Various miscellaneous utility modules |
89 : | driver - The driver glues the various phases together | ||
90 : | env - The environment representation used in typechecking | ||
91 : | fields - Internal representations of image info, kernels, and | ||
92 : | fields | ||
93 : | high-il - The HighIL representation | ||
94 : | high-to-mid - The HighIL to MidIL translation phase | ||
95 : | low-il - The LowIL representation | ||
96 : | mid-il - The MidIL representation | ||
97 : | jhr | 430 | mid-to-low - The MidIL to LowIL translation phase |
98 : | jhr | 325 | parser - The parser, scanner, and parse-tree representation. |
99 : | simplify - Contains the Simple AST representation and the | ||
100 : | simplification phase. | ||
101 : | translate - The translation from Simple AST to High IL | ||
102 : | typechecker - The typechecker | ||
103 : |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |