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/FLINT/LIST
ViewVC logotype

Annotation of /sml/trunk/src/compiler/FLINT/LIST

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21 - (view) (download)

1 : monnier 21 =========================================================================
2 :     THE TRANSLATION PHASE
3 :    
4 :     NOW: SML Absyn --> Lambda --> CPS
5 :     FUTURE: SML Absyn --> FLINT --> CPS (FLINT)
6 :    
7 :     The current structure:
8 :    
9 :     SML Absyn
10 :     --> PLambda (match compilation) ----
11 :     --> FLINT (a-normalize, multiple arg) | alt. route
12 :     --> Lambda (non-opt, single arg again) <---
13 :     --> Lambda (opt)
14 :     --> Lambda (rep-analysis, inlining type primitives)
15 :     --> Lambda (narrowed, tfn and tapp become fn and app)
16 :     --> Lambda (lambdaopt and reorder)
17 :     * --> CPS (switch optimized)
18 :     * --> CPS (cps transed with wrapper eliminated)
19 :     * --> CPS (cpsopt)
20 :     * --> CLO (closure)
21 :     * --> MLRISC
22 :    
23 :    
24 :     Directory structure:
25 :    
26 :     trans (* Absyn -> PLambda, calls mcomp *)
27 :     mcomp (* match compilation *)
28 :     plambda (* refer to plambdatype *)
29 :    
30 :     flint (* refer to flinttype ? *)
31 :    
32 :     lambda (* refer to lambdatype *)
33 :     opt (* lambda optimizations *)
34 :     reps (* representation analysis *)
35 :    
36 :     narrow (* refer to narrowtype *)
37 :     obsol (* files that are already obsolete *)
38 :    
39 :     The future structure:
40 :    
41 :     SML Absyn
42 :     --> PLambda
43 :     --> FLINT (a-normalize, multiple arg, + switch opt + exn elim?)
44 :     --> FLINT (flint opt, reorder, lambdaopt, cpsopt)
45 :     --> FLINT (post-rep-analysis ?)
46 :     --> CPS (cps convert, cont-related primop made explicit)
47 :     --> CLO (closure convert, fundec flattening)
48 :     --> MLRISC
49 :    
50 :     To do: changing the datatype representations in the front-end elaborator
51 :     propagating datatypes from the frontend into FLINT
52 :     update the FLINT typechecker to support strong typing
53 :     propagating the labels of records and sums into FLINT as well
54 :    
55 :     =========================================================================
56 :     PHASE I SML Absyn --> PLambda
57 :    
58 :     4-FLINT/plambda/plambda.sig
59 :     4-FLINT/plambda/plambda.sml
60 :     4-FLINT/plambda/pplexp.sml
61 :     4-FLINT/plambda/chkplexp.sml
62 :    
63 :     4-FLINT/mcomp/matchcomp.sml
64 :     4-FLINT/mcomp/mccommon.sml
65 :     4-FLINT/mcomp/tempexpn.sml
66 :    
67 :     4-FLINT/trans/translate.sml
68 :     4-FLINT/trans/transmodules.sml
69 :     4-FLINT/trans/transtypes.sml
70 :    
71 :     4-FLINT/trans/pequal.sml
72 :     4-FLINT/trans/interp.sml
73 :     4-FLINT/trans/literals.sml
74 :    
75 :     Needs an interface of FLINT types used
76 :     by this translation.
77 :    
78 :     =========================================================================
79 :     PHASE II PLambda --> FLINT
80 :    
81 :     4-FLINT/flint/flintnm.sml
82 :    
83 :     Currently does two things:
84 :     (1) A-normalization
85 :     (2) argument expansions
86 :    
87 :     Notice there should not be any translation on
88 :     lambda types. PLambda ought to carry normalized
89 :     types (i.e., known cooked types should be raw)
90 :    
91 :     Will do more in the future, potentially:
92 :     (1) Not treating exceptions as constructors
93 :     (2) Elimination of exception switches ?
94 :     (3) Effect inference ?
95 :    
96 :     =========================================================================
97 :     PHASE III FLINT --> FLINT
98 :    
99 :    
100 :     4-FLINT/flint/flint.sig
101 :     4-FLINT/flint/flint.sml
102 :    
103 :     4-FLINT/flint/debindex.sml
104 :     4-FLINT/flint/ltykernel.sig
105 :     4-FLINT/flint/ltykernel.sml
106 :    
107 :     ---------------------------------------------------
108 :    
109 :     4-FLINT/flint/lambdatype.sig
110 :     4-FLINT/flint/lambdatype.sml
111 :     4-FLINT/flint/ltyenv.sig
112 :     4-FLINT/flint/ltyenv.sml
113 :    
114 :     4-FLINT/flint/ltysingle.sig
115 :     4-FLINT/flint/ltysingle.sml
116 :    
117 :     4-FLINT/flint/ppflint.sig
118 :     4-FLINT/flint/ppflint.sml
119 :     (* 4-FLINT/flint/chkflint.sml *)
120 :     4-FLINT/flint/flintutil.sml
121 :    
122 :     =========================================================================
123 :     PHASE IV FLINT --> Lambda
124 :    
125 :     4-FLINT/flint/flint2lambda.sml
126 :    
127 :     Goes from multiple arguments back
128 :     into singleton argument.
129 :    
130 :    
131 :     =========================================================================
132 :     PHASE V PLambda -> Lambda
133 :    
134 :     4-FLINT/opt/normalize.sml
135 :    
136 :     Alternative route: goes from PLambda directly
137 :     into Lambda.
138 :    
139 :     =========================================================================
140 :     PHASE VI Lambda -> Lambda
141 :    
142 :     4-FLINT/lambda/checklty.sml
143 :     4-FLINT/lambda/lambda.sig
144 :     4-FLINT/lambda/lambda.sml
145 :     4-FLINT/lambda/lambdavar.sig
146 :     4-FLINT/lambda/lambdavar.sml
147 :     4-FLINT/lambda/lexputil.sml
148 :     4-FLINT/lambda/mcprint.sml
149 :    
150 :     4-FLINT/opt/flintcomp.sml
151 :     4-FLINT/opt/specialize.sml
152 :     4-FLINT/opt/equal.sml
153 :     4-FLINT/opt/lcontract.sml
154 :     4-FLINT/opt/coerce.sml
155 :     4-FLINT/opt/wrapping.sml
156 :     4-FLINT/opt/ltyprim.sml
157 :     4-FLINT/opt/ltycomp.sml
158 :     4-FLINT/opt/ltnarrow.sml
159 :     4-FLINT/opt/lambdaopt.sml
160 :     4-FLINT/opt/reorder.sml
161 :    
162 :     =========================================================================
163 :     PHASE VII Lambda -> CPS
164 :    
165 :     5-CPS/conv/convert.sml
166 :     5-CPS/conv/cpstrans.sml
167 :     5-CPS/conv/switch.sml
168 :    
169 :     =========================================================================
170 :     PHASE VIII CPS -> CPS
171 :    
172 :     The cpsopt and closure phase should be rewritten
173 :     to be performed upon FLINT instead.
174 :    
175 :     =========================================================================
176 :    
177 :     There are four clients of the Lambda Types:
178 :    
179 :     (1) PLambda --- used by translate --- plambdatype.sig plambdatype.sml
180 :     (2) FlintType --- used by flint clients --- flinttype.sig flinttype.sml
181 :     (3) Lambda --- used by the old Lambda --- lambdatype.sig lambdatype.sml
182 :     (4) CPS --- narrowtype.sig and narrowtype.sml
183 :    
184 :     =========================================================================
185 :     Goal: make the FLINT backend independent of the front end
186 :    
187 :     Right now, the front-end references the following structures:
188 :     LtyKernel, LambdaType, Lambda, LambdaVar,
189 :     DebIndex, PrimTyc, PrimOp.
190 :    
191 :     The FLINT phase references the following structures in the front
192 :     end:
193 :     Access --- the conrep for datatypes
194 :     Symbol --- names of constructors and record labels
195 :     ErrorMsg --- for debugging only
196 :    
197 :     LtyKernel
198 :    
199 :     3-Semant/pickle/pickmod.sml
200 :     3-Semant/pickle/unpickmod.sml
201 :     (* must use LtyKernel for pickling and unpickling *)
202 :    
203 :     5-CPS/conv/convert.sml
204 :     5-CPS/opt/contract.sml
205 :     5-CPS/opt/flatten.sml
206 :     5-CPS/opt/uncurry.sml
207 :     (* currently uses both LtyKernel and NarrowType; LtyKernel is
208 :     used for pattern-matching to support unboxed float vectors *)
209 :    
210 :     LambdaType
211 :    
212 :     3-Semant/pickle/unpickmod.sml
213 :     (* currently use LambdaType, but really it should use something
214 :     that is more basic than LambdaType *)
215 :    
216 :     Lambda
217 :    
218 :     1-TopLevel/*/*.sml (* currently Lambda is used for inlining *)
219 :     3-Semant/basics/inlinfo.sml (* Lambda used for inlining *)
220 :     3-Semant/pickle/pickmod.sml (* pickled for cross-mod-inl *)
221 :     3-Semant/pickle/unpickmod.sml (* pickled for cross-mod-inl *)
222 :     5-CPS/conv/convert.sml (* translation into CPS *)
223 :     5-CPS/conv/switch.sml (* translation into CPS *)
224 :     5-CPS/cps/cpscomp.sml (* translation into CPS *)
225 :     5-CPS/cps/cpsphases.sig (* translation into CPS *)
226 :    
227 :     We should replace Lambda.lexp with FLINT.prog (?); eventually
228 :     Lambda should go away.
229 :    
230 :     LambdaVar
231 :    
232 :     1-TopLevel/interact/compile.sml (* used in compInfo *)
233 :     3-Semant/elaborate/elabutil.sml (* type of compInfo *)
234 :     3-Semant/basics/access.sig (* used in access path *)
235 :     3-Semant/basics/access.sml (* used in access path *)
236 :     3-Semant/pickle/pickmod.sml (* pickling of access *)
237 :     3-Semant/pickle/unpickmod.sml (* pickling of access *)
238 :    
239 :     otherwise, it is heavily used by 4-FLINT and 5-CPS
240 :    
241 :     DebIndex
242 :    
243 :     3-Semant/elaborate/elabmod.sml (* we track depth during elaboration *)
244 :     3-Semant/elaborate/elabutil.sig (* used by context type *)
245 :     3-Semant/elaborate/elabutil.sml (* used by context type *)
246 :     3-Semant/modules/evalent.sml (* we track depth during elaboration *)
247 :     3-Semant/modules/instantiate.sml (* we track depth during elaboration *)
248 :     3-Semant/modules/modules.sig (* for lty memoization *)
249 :     3-Semant/modules/modules.sml (* for lty memoization *)
250 :     3-Semant/modules/sigmatch.sml (* we track depth during elaboration *)
251 :    
252 :     3-Semant/pickle/pickmod.sml (* pickling of IL *)
253 :     3-Semant/pickle/unpickmod.sml (* unpickling of IL *)
254 :     3-Semant/types/types.sig (* used by LBOUND tv to ease translation *)
255 :     3-Semant/types/types.sml (* also by memoization on large types *)
256 :     3-Semant/types/typesutil.sig (* used by reformat, soon obsolete *)
257 :    
258 :     PrimTyc
259 :    
260 :     3-Semant/pickle/pickmod.sml (* pickling of types *)
261 :     3-Semant/pickle/unpickmod.sml (* unpickling of types *)
262 :     3-Semant/types/basictypes.sml (* PRIMITIVE info, initial environment *)
263 :     3-Semant/types/types.sig (* PRIMITIVE info *)
264 :     3-Semant/types/types.sml (* PRIMITIVE info *)
265 :     3-Semant/types/typesutil.sml (* the use of PrimTyc.ptc_void *)
266 :     5-CPS/cps/cps.sml (* used by translation from lty to cty *)
267 :    
268 :     PrimOp
269 :    
270 :     3-Semant/basics/inlinfo.sml (* inlining information *)
271 :     3-Semant/statenv/prim.sml (* initial environment *)
272 :     3-Semant/pickle/pickmod.sml (* pickling of inlinfo and IL *)
273 :     3-Semant/pickle/unpickmod.sml (* unpickling of inlinfo and IL *)
274 :     5-CPS/conv/convert.sml (* translation to CPS primops *)
275 :     9-Misc/profile/sprof.sml (* instrumenting absyn *)
276 :     9-Misc/profile/tprof.sml (* instrumenting absyn *)
277 :    
278 :     =========================================================================

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