/[cmucl]/src/compiler/ir1opt.lisp
ViewVC logotype

Contents of /src/compiler/ir1opt.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.83.2.1 - (show annotations)
Mon Dec 19 01:09:59 2005 UTC (8 years, 4 months ago) by rtoy
Branch: ppc_gencgc_branch
CVS Tags: ppc_gencgc_snap_2006-01-06, ppc_gencgc_snap_2005-12-17
Changes since 1.83: +20 -1 lines
Merge code from main branch of 2005-12-17 to ppc gencgc branch.  Still
doesn't work of course.
1 ;;; -*- Package: C; Log: C.Log -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;;
7 (ext:file-comment
8 "$Header: /tiger/var/lib/cvsroots/cmucl/src/compiler/ir1opt.lisp,v 1.83.2.1 2005/12/19 01:09:59 rtoy Exp $")
9 ;;;
10 ;;; **********************************************************************
11 ;;;
12 ;;; This file implements the IR1 optimization phase of the compiler. IR1
13 ;;; optimization is a grab-bag of optimizations that don't make major changes
14 ;;; to the block-level control flow and don't use flow analysis. These
15 ;;; optimizations can mostly be classified as "meta-evaluation", but there is a
16 ;;; sizable top-down component as well.
17 ;;;
18 ;;; Written by Rob MacLachlan
19 ;;;
20 (in-package :c)
21
22
23 ;;;; Interface for obtaining results of constant folding:
24
25 ;;; Constant-Continuation-P -- Interface
26 ;;;
27 ;;; Return true if the sole use of Cont is a reference to a constant leaf.
28 ;;;
29 (defun constant-continuation-p (cont)
30 (declare (type continuation cont) (values boolean))
31 (let ((use (continuation-use cont)))
32 (and (ref-p use)
33 (constant-p (ref-leaf use)))))
34
35
36 ;;; Continuation-Value -- Interface
37 ;;;
38 ;;; Return the constant value for a continuation whose only use is a
39 ;;; constant node.
40 ;;;
41 (defun continuation-value (cont)
42 (declare (type continuation cont))
43 (assert (constant-continuation-p cont))
44 (constant-value (ref-leaf (continuation-use cont))))
45
46
47 ;;;; Interface for obtaining results of type inference:
48
49 ;;; CONTINUATION-PROVEN-TYPE -- Interface
50 ;;;
51 ;;; Return a (possibly values) type that describes what we have proven about
52 ;;; the type of Cont without taking any type assertions into consideration.
53 ;;; This is just the union of the NODE-DERIVED-TYPE of all the uses. Most
54 ;;; often people use CONTINUATION-DERIVED-TYPE or CONTINUATION-TYPE instead of
55 ;;; using this function directly.
56 ;;;
57 (defun continuation-proven-type (cont)
58 (declare (type continuation cont))
59 (ecase (continuation-kind cont)
60 ((:block-start :deleted-block-start)
61 (let ((uses (block-start-uses (continuation-block cont))))
62 (if uses
63 (do ((res (node-derived-type (first uses))
64 (values-type-union (node-derived-type (first current))
65 res))
66 (current (rest uses) (rest current)))
67 ((null current) res))
68 *empty-type*)))
69 (:inside-block
70 (node-derived-type (continuation-use cont)))
71 (:unused
72 *empty-type*)))
73
74
75 ;;; Continuation-Derived-Type -- Interface
76 ;;;
77 ;;; Our best guess for the type of this continuation's value. Note that
78 ;;; this may be Values or Function type, which cannot be passed as an argument
79 ;;; to the normal type operations. See Continuation-Type. This may be called
80 ;;; on deleted continuations, always returning *.
81 ;;;
82 ;;; What we do is call CONTINUATION-PROVEN-TYPE and check whether the result
83 ;;; is a subtype of the assertion. If so, return the proven type and set
84 ;;; TYPE-CHECK to nil. Otherwise, return the intersection of the asserted and
85 ;;; proven types, and set TYPE-CHECK T. If TYPE-CHECK already has a non-null
86 ;;; value, then preserve it. Only in the somewhat unusual circumstance of
87 ;;; a newly discovered assertion will we change TYPE-CHECK from NIL to T.
88 ;;;
89 ;;; The result value is cached in the Continuation-%Derived-Type. If the
90 ;;; slot is true, just return that value, otherwise recompute and stash the
91 ;;; value there.
92 ;;;
93 (declaim (inline continuation-derived-type))
94 (defun continuation-derived-type (cont)
95 (declare (type continuation cont))
96 (or (continuation-%derived-type cont)
97 (%continuation-derived-type cont)))
98 ;;;
99 (defun %continuation-derived-type (cont)
100 (declare (type continuation cont))
101 (let ((proven (continuation-proven-type cont))
102 (asserted (continuation-asserted-type cont)))
103 (cond ((values-subtypep proven asserted)
104 (setf (continuation-%type-check cont) nil)
105 (setf (continuation-%derived-type cont) proven))
106 (t
107 (unless (or (continuation-%type-check cont)
108 (not (continuation-dest cont))
109 (eq asserted *universal-type*))
110 (setf (continuation-%type-check cont) t))
111
112 (setf (continuation-%derived-type cont)
113 (values-type-intersection asserted proven))))))
114
115
116 ;;; CONTINUATION-TYPE-CHECK -- Interface
117 ;;;
118 ;;; Call CONTINUATION-DERIVED-TYPE to make sure the slot is up to date, then
119 ;;; return it.
120 ;;;
121 (declaim (inline continuation-type-check))
122 (defun continuation-type-check (cont)
123 (declare (type continuation cont))
124 (continuation-derived-type cont)
125 (continuation-%type-check cont))
126
127
128 ;;; Continuation-Type -- Interface
129 ;;;
130 ;;; Return the derived type for Cont's first value. This is guaranteed not
131 ;;; to be a Values or Function type.
132 ;;;
133 (defun continuation-type (cont)
134 (declare (type continuation cont) (values ctype))
135 (single-value-type (continuation-derived-type cont)))
136
137
138 ;;;; Interface routines used by optimizers:
139
140 ;;; Reoptimize-Continuation -- Interface
141 ;;;
142 ;;; This function is called by optimizers to indicate that something
143 ;;; interesting has happened to the value of Cont. Optimizers must make sure
144 ;;; that they don't call for reoptimization when nothing has happened, since
145 ;;; optimization will fail to terminate.
146 ;;;
147 ;;; We clear any cached type for the continuation and set the reoptimize
148 ;;; flags on everything in sight, unless the continuation is deleted (in which
149 ;;; case we do nothing.)
150 ;;;
151 ;;; Since this can get called curing IR1 conversion, we have to be careful
152 ;;; not to fly into space when the Dest's Prev is missing.
153 ;;;
154 (defun reoptimize-continuation (cont)
155 (declare (type continuation cont))
156 (unless (member (continuation-kind cont) '(:deleted :unused))
157 (setf (continuation-%derived-type cont) nil)
158 (let ((dest (continuation-dest cont)))
159 (when dest
160 (setf (continuation-reoptimize cont) t)
161 (setf (node-reoptimize dest) t)
162 (let ((prev (node-prev dest)))
163 (when prev
164 (let* ((block (continuation-block prev))
165 (component (block-component block)))
166 (when (typep dest 'cif)
167 (setf (block-test-modified block) t))
168 (setf (block-reoptimize block) t)
169 (setf (component-reoptimize component) t))))))
170 (do-uses (node cont)
171 (setf (block-type-check (node-block node)) t)))
172 (undefined-value))
173
174
175 ;;; Derive-Node-Type -- Interface
176 ;;;
177 ;;; Annotate Node to indicate that its result has been proven to be typep to
178 ;;; RType. After IR1 conversion has happened, this is the only correct way to
179 ;;; supply information discovered about a node's type. If you fuck with the
180 ;;; Node-Derived-Type directly, then information may be lost and reoptimization
181 ;;; may not happen.
182 ;;;
183 ;;; What we do is intersect Rtype with Node's Derived-Type. If the
184 ;;; intersection is different from the old type, then we do a
185 ;;; Reoptimize-Continuation on the Node-Cont.
186 ;;;
187 (defun derive-node-type (node rtype)
188 (declare (type node node) (type ctype rtype))
189 (let ((node-type (node-derived-type node)))
190 (unless (eq node-type rtype)
191 (let ((int (values-type-intersection node-type rtype)))
192 (when (type/= node-type int)
193 (when (and *check-consistency*
194 (eq int *empty-type*)
195 (not (eq rtype *empty-type*)))
196 (let ((*compiler-error-context* node))
197 (compiler-warning
198 "New inferred type ~S conflicts with old type:~
199 ~% ~S~%*** Bug?"
200 (type-specifier rtype) (type-specifier node-type))))
201 (setf (node-derived-type node) int)
202 (reoptimize-continuation (node-cont node))))))
203 (undefined-value))
204
205 (declaim (start-block assert-continuation-type
206 assert-continuation-optional-type assert-call-type))
207
208 ;;; Assert-Continuation-Type -- Interface
209 ;;;
210 ;;; Similar to Derive-Node-Type, but asserts that it is an error for Cont's
211 ;;; value not to be typep to Type. If we improve the assertion, we set
212 ;;; TYPE-CHECK and TYPE-ASSERTED to guarantee that the new assertion will be
213 ;;; checked.
214 ;;;
215 (defun assert-continuation-type (cont type)
216 (declare (type continuation cont) (type ctype type))
217 (let ((cont-type (continuation-asserted-type cont)))
218 (unless (eq cont-type type)
219 (let ((int (values-type-intersection cont-type type)))
220 (when (type/= cont-type int)
221 (setf (continuation-asserted-type cont) int)
222 (do-uses (node cont)
223 (setf (block-attributep (block-flags (node-block node))
224 type-check type-asserted)
225 t))
226 (reoptimize-continuation cont)))))
227 (undefined-value))
228
229
230 ;;; Assert-continuation-optional-type -- Interface
231 ;;;
232 ;;; Similar to Assert-Continuation-Type, but asserts that the type is
233 ;;; for an optional argument and that other arguments may be received.
234 ;;;
235 (defun assert-continuation-optional-type (cont type)
236 (declare (type continuation cont) (type ctype type))
237 (let ((opt-type (make-values-type :optional (list type)
238 :rest *universal-type*)))
239 (assert-continuation-type cont opt-type)))
240
241
242 ;;; Assert-Call-Type -- Interface
243 ;;;
244 ;;; Assert that Call is to a function of the specified Type. It is assumed
245 ;;; that the call is legal and has only constants in the keyword positions.
246 ;;;
247 (defun assert-call-type (call type)
248 (declare (type combination call) (type function-type type))
249 (derive-node-type call (function-type-returns type))
250 (let ((args (combination-args call)))
251 (dolist (req (function-type-required type))
252 (when (null args) (return-from assert-call-type))
253 (let ((arg (pop args)))
254 (assert-continuation-optional-type arg req)))
255 (dolist (opt (function-type-optional type))
256 (when (null args) (return-from assert-call-type))
257 (let ((arg (pop args)))
258 (assert-continuation-optional-type arg opt)))
259
260 (let ((rest (function-type-rest type)))
261 (when rest
262 (dolist (arg args)
263 (assert-continuation-optional-type arg rest))))
264
265 (dolist (key (function-type-keywords type))
266 (let ((name (key-info-name key)))
267 (do ((arg args (cddr arg)))
268 ((null arg))
269 (when (eq (continuation-value (first arg)) name)
270 (assert-continuation-optional-type
271 (second arg) (key-info-type key)))))))
272 (undefined-value))
273
274
275 ;;;; IR1-OPTIMIZE:
276
277 (declaim (start-block ir1-optimize))
278
279 ;;; IR1-Optimize -- Interface
280 ;;;
281 ;;; Do one forward pass over Component, deleting unreachable blocks and
282 ;;; doing IR1 optimizations. We can ignore all blocks that don't have the
283 ;;; Reoptimize flag set. If Component-Reoptimize is true when we are done,
284 ;;; then another iteration would be beneficial.
285 ;;;
286 ;;; We delete blocks when there is either no predecessor or the block is in
287 ;;; a lambda that has been deleted. These blocks would eventually be deleted
288 ;;; by DFO recomputation, but doing it here immediately makes the effect
289 ;;; avaliable to IR1 optimization.
290 ;;;
291 (defun ir1-optimize (component)
292 (declare (type component component))
293 (setf (component-reoptimize component) nil)
294 (do-blocks (block component)
295 (cond
296 ((block-unreachable-p block)
297 (delete-block block))
298 (t
299 (loop
300 (let ((succ (block-succ block)))
301 (unless (and succ (null (rest succ)))
302 (return)))
303
304 (let ((last (block-last block)))
305 (typecase last
306 (cif
307 (let ((if-test (if-test last)))
308 ;; Don't flush an if-test if it requires a type check.
309 (unless (memq (continuation-type-check if-test) '(nil :deleted))
310 (return))
311 (flush-dest if-test)
312 (when (unlink-node last)
313 (return))))
314 (exit
315 (when (maybe-delete-exit last)
316 (return)))))
317
318 (unless (join-successor-if-possible block)
319 (return)))
320 ;;
321 ;; Block-Component is nil for deleted blocks.
322 (when (block-component block)
323 (cond ((block-unreachable-p block)
324 (delete-block block))
325 (t
326 (when (block-reoptimize block)
327 (ir1-optimize-block block))
328 (when (and (block-flush-p block)
329 (block-component block))
330 (flush-dead-code block))))))))
331 (values))
332
333 ;;; IR1-Optimize-Block -- Internal
334 ;;;
335 ;;; Loop over the nodes in Block, looking for stuff that needs to be
336 ;;; optimized. We dispatch off of the type of each node with its reoptimize
337 ;;; flag set:
338 ;;; -- With a combination, we call Propagate-Function-Change whenever the
339 ;;; function changes, and call IR1-Optimize-Combination if any argument
340 ;;; changes.
341 ;;; -- With an Exit, we derive the node's type from the Value's type. We don't
342 ;;; propagate Cont's assertion to the Value, since if we did, this would
343 ;;; move the checking of Cont's assertion to the exit. This wouldn't work
344 ;;; with Catch and UWP, where the Exit node is just a placeholder for the
345 ;;; actual unknown exit.
346 ;;;
347 ;;; Note that we clear the node & block reoptimize flags *before* doing the
348 ;;; optimization. This ensures that the node or block will be reoptimized if
349 ;;; necessary. We leave the NODE-OPTIMIZE flag set going into
350 ;;; IR1-OPTIMIZE-RETURN, since it wants to clear the flag itself.
351 ;;;
352 (defun ir1-optimize-block (block)
353 (declare (type cblock block))
354 (setf (block-reoptimize block) nil)
355 (do-nodes (node cont block :restart-p t)
356 (when (node-reoptimize node)
357 (setf (node-reoptimize node) nil)
358 (typecase node
359 (ref)
360 (combination
361 (ir1-optimize-combination node))
362 (cif
363 (ir1-optimize-if node))
364 (creturn
365 (setf (node-reoptimize node) t)
366 (ir1-optimize-return node))
367 (mv-combination
368 (ir1-optimize-mv-combination node))
369 (exit
370 (let ((value (exit-value node)))
371 (when value
372 (derive-node-type node (continuation-derived-type value)))))
373 (cset
374 (ir1-optimize-set node)))))
375 (undefined-value))
376
377
378 ;;; Join-Successor-If-Possible -- Internal
379 ;;;
380 ;;; We cannot combine with a successor block if:
381 ;;; 1] The successor has more than one predecessor.
382 ;;; 2] The last node's Cont is also used somewhere else.
383 ;;; 3] The successor is the current block (infinite loop).
384 ;;; 4] The next block has a different cleanup, and thus we may want to insert
385 ;;; cleanup code between the two blocks at some point.
386 ;;; 5] The next block has a different home lambda, and thus the control
387 ;;; transfer is a non-local exit.
388 ;;;
389 ;;; If we succeed, we return true, otherwise false.
390 ;;;
391 ;;; Joining is easy when the successor's Start continuation is the same from
392 ;;; our Last's Cont. If they differ, then we can still join when the last
393 ;;; continuation has no next and the next continuation has no uses. In this
394 ;;; case, we replace the next continuation with the last before joining the
395 ;;; blocks.
396 ;;;
397 (defun join-successor-if-possible (block)
398 (declare (type cblock block))
399 (let ((next (first (block-succ block))))
400 (when (block-start next)
401 (let* ((last (block-last block))
402 (last-cont (node-cont last))
403 (next-cont (block-start next)))
404 (cond ((or (rest (block-pred next))
405 (not (eq (continuation-use last-cont) last))
406 (eq next block)
407 (not (eq (block-end-cleanup block)
408 (block-start-cleanup next)))
409 (not (eq (block-home-lambda block)
410 (block-home-lambda next))))
411 nil)
412 ((eq last-cont next-cont)
413 (join-blocks block next)
414 t)
415 ((and (null (block-start-uses next))
416 (eq (continuation-kind last-cont) :inside-block))
417 (let ((next-node (continuation-next next-cont)))
418 ;;
419 ;; If next-cont does have a dest, it must be unreachable,
420 ;; since there are no uses. DELETE-CONTINUATION will mark the
421 ;; dest block as delete-p [and also this block, unless it is
422 ;; no longer backward reachable from the dest block.]
423 (delete-continuation next-cont)
424 (setf (node-prev next-node) last-cont)
425 (setf (continuation-next last-cont) next-node)
426 (setf (block-start next) last-cont)
427 (join-blocks block next))
428 t)
429 (t
430 nil))))))
431
432
433 ;;; Join-Blocks -- Internal
434 ;;;
435 ;;; Join together two blocks which have the same ending/starting
436 ;;; continuation. The code in Block2 is moved into Block1 and Block2 is
437 ;;; deleted from the DFO. We combine the optimize flags for the two blocks so
438 ;;; that any indicated optimization gets done.
439 ;;;
440 (defun join-blocks (block1 block2)
441 (declare (type cblock block1 block2))
442 (let* ((last (block-last block2))
443 (last-cont (node-cont last))
444 (succ (block-succ block2))
445 (start2 (block-start block2)))
446 (do ((cont start2 (node-cont (continuation-next cont))))
447 ((eq cont last-cont)
448 (when (eq (continuation-kind last-cont) :inside-block)
449 (setf (continuation-block last-cont) block1)))
450 (setf (continuation-block cont) block1))
451
452 (unlink-blocks block1 block2)
453 (dolist (block succ)
454 (unlink-blocks block2 block)
455 (link-blocks block1 block))
456
457 (setf (block-last block1) last)
458 (setf (continuation-kind start2) :inside-block))
459
460 (setf (block-flags block1)
461 (attributes-union (block-flags block1)
462 (block-flags block2)
463 (block-attributes type-asserted test-modified)))
464
465 (let ((next (block-next block2))
466 (prev (block-prev block2)))
467 (setf (block-next prev) next)
468 (setf (block-prev next) prev))
469
470 (undefined-value))
471
472 ;;; Flush-Dead-Code -- Internal
473 ;;;
474 ;;; Delete any nodes in Block whose value is unused and have no
475 ;;; side-effects. We can delete sets of lexical variables when the set
476 ;;; variable has no references.
477 ;;;
478 ;;; [### For now, don't delete potentially flushable calls when they have the
479 ;;; Call attribute. Someday we should look at the funcitonal args to determine
480 ;;; if they have any side-effects.]
481 ;;;
482 (defun flush-dead-code (block)
483 (declare (type cblock block))
484 (do-nodes-backwards (node cont block)
485 (unless (continuation-dest cont)
486 (typecase node
487 (ref
488 (delete-ref node)
489 (unlink-node node))
490 (combination
491 (let ((info (combination-kind node)))
492 (when (function-info-p info)
493 (let ((attr (function-info-attributes info)))
494 (when (and (ir1-attributep attr flushable)
495 (not (ir1-attributep attr call)))
496 (if (policy node (= safety 3))
497 ;; Don't flush calls to flushable functions if
498 ;; their value is unused in safe code, because
499 ;; this means something like (PROGN (FBOUNDP 42)
500 ;; T) won't signal an error. KLUDGE: The right
501 ;; thing to do here is probably teaching
502 ;; MAYBE-NEGATE-CHECK and friends to accept nil
503 ;; continuation-dests instead of faking one.
504 ;; Can't be bothered at present.
505 ;; Gerd, 2003-04-26.
506 (setf (continuation-dest cont)
507 (continuation-next cont))
508 (progn
509 (flush-dest (combination-fun node))
510 (dolist (arg (combination-args node))
511 (flush-dest arg))
512 (unlink-node node))))))))
513 (mv-combination
514 (when (eq (basic-combination-kind node) :local)
515 (let ((fun (combination-lambda node)))
516 (when (dolist (var (lambda-vars fun) t)
517 (when (or (leaf-refs var)
518 (lambda-var-sets var))
519 (return nil)))
520 (flush-dest (first (basic-combination-args node)))
521 (delete-let fun)))))
522 (exit
523 (let ((value (exit-value node)))
524 (when value
525 (flush-dest value)
526 (setf (exit-value node) nil))))
527 (cset
528 (let ((var (set-var node)))
529 (when (and (lambda-var-p var)
530 (null (leaf-refs var)))
531 (flush-dest (set-value node))
532 (setf (basic-var-sets var)
533 (delete node (basic-var-sets var)))
534 (unlink-node node)))))))
535
536 (setf (block-flush-p block) nil)
537 (undefined-value))
538
539 (declaim (end-block))
540
541
542 ;;;; Local call return type propagation:
543
544 ;;; Find-Result-Type -- Internal
545 ;;;
546 ;;; This function is called on RETURN nodes that have their REOPTIMIZE flag
547 ;;; set. It iterates over the uses of the RESULT, looking for interesting
548 ;;; stuff to update the TAIL-SET. If a use isn't a local call, then we union
549 ;;; its type together with the types of other such uses. We assign to the
550 ;;; RETURN-RESULT-TYPE the intersection of this type with the RESULT's asserted
551 ;;; type. We can make this intersection now (potentially before type checking)
552 ;;; because this assertion on the result will eventually be checked (if
553 ;;; appropriate.)
554 ;;;
555 ;;; We call MAYBE-CONVERT-TAIL-LOCAL-CALL on each local non-MV combination,
556 ;;; which may change the succesor of the call to be the called function, and if
557 ;;; so, checks if the call can become an assignment. If we convert to an
558 ;;; assignment, we abort, since the RETURN has been deleted.
559 ;;;
560 (defun find-result-type (node)
561 (declare (type creturn node))
562 (let ((result (return-result node)))
563 (collect ((use-union *empty-type* values-type-union))
564 (do-uses (use result)
565 (let ((use-home (node-home-lambda use)))
566 (cond ((or (eq (functional-kind use-home) :deleted)
567 (block-delete-p (node-block use))))
568 ((and (basic-combination-p use)
569 (eq (basic-combination-kind use) :local))
570 (assert (eq (lambda-tail-set use-home)
571 (lambda-tail-set (combination-lambda use))))
572 (when (combination-p use)
573 (when (nth-value 1 (maybe-convert-tail-local-call use))
574 (return-from find-result-type (values)))))
575 (t
576 (use-union (node-derived-type use))))))
577 (let ((int (values-type-intersection (continuation-asserted-type result)
578 (use-union))))
579 (setf (return-result-type node) int))))
580 (values))
581
582
583 ;;; IR1-Optimize-Return -- Internal
584 ;;;
585 ;;; Do stuff to realize that something has changed about the value delivered
586 ;;; to a return node. Since we consider the return values of all functions in
587 ;;; the tail set to be equivalent, this amounts to bringing the entire tail set
588 ;;; up to date. We iterate over the returns for all the functions in the tail
589 ;;; set, reanalyzing them all (not treating Node specially.)
590 ;;;
591 ;;; When we are done, we check if the new type is different from the old
592 ;;; TAIL-SET-TYPE. If so, we set the type and also reoptimize all the
593 ;;; continuations for references to functions in the tail set. This will
594 ;;; cause IR1-OPTIMIZE-COMBINATION to derive the new type as the results of the
595 ;;; calls.
596 ;;;
597 (defun ir1-optimize-return (node)
598 (declare (type creturn node))
599 (let* ((tails (lambda-tail-set (return-lambda node)))
600 (funs (tail-set-functions tails)))
601 (collect ((res *empty-type* values-type-union))
602 (dolist (fun funs)
603 (let ((return (lambda-return fun)))
604 (when return
605 (when (node-reoptimize return)
606 (setf (node-reoptimize return) nil)
607 (find-result-type return))
608 (res (return-result-type return)))))
609
610 (when (type/= (res) (tail-set-type tails))
611 (setf (tail-set-type tails) (res))
612 (dolist (fun (tail-set-functions tails))
613 (dolist (ref (leaf-refs fun))
614 (reoptimize-continuation (node-cont ref)))))))
615
616 (undefined-value))
617
618
619 ;;; IF optimization:
620
621 (declaim (start-block ir1-optimize-if))
622
623 ;;; IR1-Optimize-If -- Internal
624 ;;;
625 ;;; If the test has multiple uses, replicate the node when possible. Also
626 ;;; check if the predicate is known to be true or false, deleting the IF node
627 ;;; in favor of the appropriate branch when this is the case.
628 ;;;
629 (defun ir1-optimize-if (node)
630 (declare (type cif node))
631 (let ((test (if-test node))
632 (block (node-block node)))
633
634 (when (and (eq (block-start block) test)
635 (eq (continuation-next test) node)
636 (rest (block-start-uses block)))
637 (do-uses (use test)
638 (when (immediately-used-p test use)
639 (convert-if-if use node)
640 (when (continuation-use test) (return)))))
641 ;;
642 ;; Don't flush if-tests when they require a type check.
643 (when (memq (continuation-type-check test) '(nil :deleted))
644 (let* ((type (continuation-type test))
645 (victim
646 (cond ((constant-continuation-p test)
647 (if (continuation-value test)
648 (if-alternative node)
649 (if-consequent node)))
650 ((not (types-intersect type *null-type*))
651 (if-alternative node))
652 ((type= type *null-type*)
653 (if-consequent node)))))
654 (when victim
655 (flush-dest test)
656 (when (rest (block-succ block))
657 (unlink-blocks block victim))
658 (setf (component-reanalyze (block-component (node-block node))) t)
659 (unlink-node node)))))
660 (undefined-value))
661
662
663 ;;; Convert-If-If -- Internal
664 ;;;
665 ;;; Create a new copy of an IF Node that tests the value of the node Use.
666 ;;; The test must have >1 use, and must be immediately used by Use. Node must
667 ;;; be the only node in its block (implying that block-start = if-test).
668 ;;;
669 ;;; This optimization has an effect semantically similar to the
670 ;;; source-to-source transformation:
671 ;;; (IF (IF A B C) D E) ==>
672 ;;; (IF A (IF B D E) (IF C D E))
673 ;;;
674 ;;; We clobber the NODE-SOURCE-PATH of both the original and the new node so
675 ;;; that dead code deletion notes will definitely not consider either node to
676 ;;; be part of the original source. One node might become unreachable,
677 ;;; resulting in a spurious note.
678 ;;;
679 (defun convert-if-if (use node)
680 (declare (type node use) (type cif node))
681 (with-ir1-environment node
682 (let* ((block (node-block node))
683 (test (if-test node))
684 (cblock (if-consequent node))
685 (ablock (if-alternative node))
686 (use-block (node-block use))
687 (dummy-cont (make-continuation))
688 (new-cont (make-continuation))
689 (new-node (make-if :test new-cont
690 :consequent cblock :alternative ablock))
691 (new-block (continuation-starts-block new-cont)))
692 (prev-link new-node new-cont)
693 (setf (continuation-dest new-cont) new-node)
694 (add-continuation-use new-node dummy-cont)
695 (setf (block-last new-block) new-node)
696
697 (unlink-blocks use-block block)
698 (delete-continuation-use use)
699 (add-continuation-use use new-cont)
700 (link-blocks use-block new-block)
701
702 (link-blocks new-block cblock)
703 (link-blocks new-block ablock)
704
705 (push "<IF Duplication>" (node-source-path node))
706 (push "<IF Duplication>" (node-source-path new-node))
707
708 (reoptimize-continuation test)
709 (reoptimize-continuation new-cont)
710 (setf (component-reanalyze *current-component*) t)))
711 (undefined-value))
712
713 (declaim (end-block))
714
715
716 ;;;; Exit IR1 optimization:
717
718 ;;; Maybe-Delete-Exit -- Interface
719 ;;;
720 ;;; This function attempts to delete an exit node, returning true if it
721 ;;; deletes the block as a consequence:
722 ;;; -- If the exit is degenerate (has no Entry), then we don't do anything,
723 ;;; since there is nothing to be done.
724 ;;; -- If the exit node and its Entry have the same home lambda then we know
725 ;;; the exit is local, and can delete the exit. We change uses of the
726 ;;; Exit-Value to be uses of the original continuation, then unlink the
727 ;;; node. If the exit is to a TR context, then we must do MERGE-TAIL-SETS
728 ;;; on any local calls which delivered their value to this exit.
729 ;;; -- If there is no value (as in a GO), then we skip the value semantics.
730 ;;;
731 ;;; This function is also called by environment analysis, since it wants all
732 ;;; exits to be optimized even if normal optimization was omitted.
733 ;;;
734 (defun maybe-delete-exit (node)
735 (declare (type exit node))
736 (let ((value (exit-value node))
737 (entry (exit-entry node))
738 (cont (node-cont node)))
739 (when (and entry
740 (eq (node-home-lambda node) (node-home-lambda entry)))
741 (setf (entry-exits entry) (delete node (entry-exits entry)))
742 (prog1
743 (unlink-node node)
744 (when value
745 (collect ((merges))
746 (when (return-p (continuation-dest cont))
747 (do-uses (use value)
748 (when (and (basic-combination-p use)
749 (eq (basic-combination-kind use) :local))
750 (merges use))))
751 (when (null (continuation-dest cont))
752 (flush-dest value))
753 (substitute-continuation-uses cont value)
754 (dolist (merge (merges))
755 (merge-tail-sets merge))))))))
756
757
758 ;;;; Combination IR1 optimization:
759
760 (declaim (start-block ir1-optimize-combination maybe-terminate-block
761 validate-call-type))
762
763 ;;; Ir1-Optimize-Combination -- Internal
764 ;;;
765 ;;; Do IR1 optimizations on a Combination node.
766 ;;;
767 (defun ir1-optimize-combination (node)
768 (declare (type combination node))
769 (when (continuation-reoptimize (basic-combination-fun node))
770 (propagate-function-change node))
771 (let ((args (basic-combination-args node))
772 (kind (basic-combination-kind node)))
773 (case kind
774 (:local
775 (let ((fun (combination-lambda node)))
776 (if (eq (functional-kind fun) :let)
777 (propagate-let-args node fun)
778 (propagate-local-call-args node fun))))
779 ((:full :error)
780 (dolist (arg args)
781 (when arg
782 (setf (continuation-reoptimize arg) nil))))
783 (t
784 (dolist (arg args)
785 (when arg
786 (setf (continuation-reoptimize arg) nil)))
787
788 (let ((fun (function-info-result-not-used kind)))
789 (when fun
790 (let ((unused-result (funcall fun node)))
791 (when unused-result
792 (let ((*compiler-error-context* node))
793 (compiler-warning "The return value of ~A should not be discarded."
794 (continuation-function-name (basic-combination-fun node))))))))
795
796 (let ((fun (function-info-destroyed-constant-args kind)))
797 (when fun
798 (let ((destroyed-constant-args (funcall fun args)))
799 (when destroyed-constant-args
800 (let ((*compiler-error-context* node))
801 (warn 'kernel:constant-modified
802 :function-name (continuation-function-name
803 (basic-combination-fun node)))
804 (setf (basic-combination-kind node) :error)
805 (return-from ir1-optimize-combination))))))
806
807 (let ((attr (function-info-attributes kind)))
808 (when (and (ir1-attributep attr foldable)
809 (not (ir1-attributep attr call))
810 (every #'constant-continuation-p args)
811 (continuation-dest (node-cont node)))
812 (constant-fold-call node)
813 (return-from ir1-optimize-combination)))
814
815 (let ((fun (function-info-derive-type kind)))
816 (when fun
817 (let ((res (funcall fun node)))
818 (when res
819 (derive-node-type node res)
820 (maybe-terminate-block node nil)))))
821
822 (let ((fun (function-info-optimizer kind)))
823 (unless (and fun (funcall fun node))
824 (dolist (x (function-info-transforms kind))
825 (unless (ir1-transform node x)
826 (return))))))))
827
828 (undefined-value))
829
830
831 ;;; MAYBE-TERMINATE-BLOCK -- Interface
832 ;;;
833 ;;; If Call is to a function that doesn't return (type NIL), then terminate
834 ;;; the block there, and link it to the component tail. We also change the
835 ;;; call's CONT to be a dummy continuation to prevent the use from confusing
836 ;;; things.
837 ;;;
838 ;;; Except when called during IR1, we delete the continuation if it has no
839 ;;; other uses. (If it does have other uses, we reoptimize.)
840 ;;;
841 ;;; Termination on the basis of a continuation type assertion is inhibited
842 ;;; when:
843 ;;; -- The continuation is deleted (hence the assertion is spurious), or
844 ;;; -- We are in IR1 conversion (where THE assertions are subject to
845 ;;; weakening.)
846 ;;;
847 (defun maybe-terminate-block (call ir1-p)
848 (declare (type basic-combination call))
849 (let* ((block (node-block call))
850 (cont (node-cont call))
851 (tail (component-tail (block-component block)))
852 (succ (first (block-succ block))))
853 (unless (or (and (eq call (block-last block)) (eq succ tail))
854 (block-delete-p block)
855 *converting-for-interpreter*)
856 (when (or (and (eq (continuation-asserted-type cont) *empty-type*)
857 (not (or ir1-p (eq (continuation-kind cont) :deleted))))
858 (eq (node-derived-type call) *empty-type*))
859 (cond (ir1-p
860 (delete-continuation-use call)
861 (cond
862 ((block-last block)
863 (assert (and (eq (block-last block) call)
864 (eq (continuation-kind cont) :block-start))))
865 (t
866 (setf (block-last block) call)
867 (link-blocks block (continuation-starts-block cont)))))
868 (t
869 (node-ends-block call)
870 (delete-continuation-use call)
871 (if (eq (continuation-kind cont) :unused)
872 (delete-continuation cont)
873 (reoptimize-continuation cont))))
874
875 (unlink-blocks block (first (block-succ block)))
876 (setf (component-reanalyze (block-component block)) t)
877 (assert (not (block-succ block)))
878 (link-blocks block tail)
879 (add-continuation-use call (make-continuation))
880 t))))
881
882
883 ;;; Recognize-Known-Call -- Interface
884 ;;;
885 ;;; Called both by IR1 conversion and IR1 optimization when they have
886 ;;; verified the type signature for the call, and are wondering if something
887 ;;; should be done to special-case the call. If Call is a call to a global
888 ;;; function, then see if it defined or known:
889 ;;; -- If a DEFINED-FUNCTION should be inline expanded, then convert the
890 ;;; expansion and change the call to call it. Expansion is enabled if
891 ;;; :INLINE or if space=0. If the FUNCTIONAL slot is true, we never expand,
892 ;;; since this function has already been converted. Local call analysis
893 ;;; will duplicate the definition if necessary. We claim that the parent
894 ;;; form is LABELS for context declarations, since we don't want it to be
895 ;;; considered a real global function.
896 ;;; -- In addition to a direct check for the function name in the table, we
897 ;;; also must check for slot accessors. If the function is a slot accessor,
898 ;;; then we set the combination kind to the function info of %Slot-Setter or
899 ;;; %Slot-Accessor, as appropriate.
900 ;;; -- If it is a known function, mark it as such by setting the Kind.
901 ;;;
902 ;;; We return the leaf referenced (NIL if not a leaf) and the function-info
903 ;;; assigned.
904 ;;;
905 (defun recognize-known-call (call ir1-p)
906 (declare (type combination call))
907 (let* ((ref (continuation-use (basic-combination-fun call)))
908 (leaf (when (ref-p ref) (ref-leaf ref)))
909 (inlinep (if (defined-function-p leaf)
910 (defined-function-inlinep leaf)
911 :no-chance)))
912 (when (and (or (byte-compiling)
913 *converting-for-interpreter*)
914 (member inlinep '(:inline :maybe-inline)))
915 (setq inlinep :notinline))
916 (cond
917 ((eq inlinep :notinline) (values nil nil))
918 ((not (and (global-var-p leaf)
919 (eq (global-var-kind leaf) :global-function)))
920 (values leaf nil))
921 ((and (ecase inlinep
922 (:inline t)
923 (:no-chance nil)
924 ((nil :maybe-inline) (policy call (zerop space))))
925 (defined-function-inline-expansion leaf)
926 (let ((fun (defined-function-functional leaf)))
927 (or (not fun)
928 (and (eq inlinep :inline) (functional-kind fun))))
929 (inline-expansion-ok call))
930 (flet ((frob ()
931 (let ((res (ir1-convert-lambda-for-defun
932 (defined-function-inline-expansion leaf)
933 leaf t
934 #'ir1-convert-inline-lambda
935 'labels)))
936 (setf (defined-function-functional leaf) res)
937 (change-ref-leaf ref res))))
938 (if ir1-p
939 (frob)
940 (with-ir1-environment call
941 (frob)
942 (local-call-analyze *current-component*))))
943
944 (values (ref-leaf (continuation-use (basic-combination-fun call)))
945 nil))
946 (t
947 (let* ((name (leaf-name leaf))
948 (info (info function info
949 (if (slot-accessor-p leaf)
950 (if (consp name)
951 '%slot-setter
952 '%slot-accessor)
953 name))))
954 (if info
955 (values leaf (setf (basic-combination-kind call) info))
956 (values leaf nil)))))))
957
958
959 ;;; VALIDATE-CALL-TYPE -- Internal
960 ;;;
961 ;;; Check if Call satisfies Type. If so, apply the type to the call, and do
962 ;;; MAYBE-TERMINATE-BLOCK and return the values of RECOGNIZE-KNOWN-CALL. If an
963 ;;; error, set the combination kind and return NIL, NIL. If the type is just
964 ;;; FUNCTION, then skip the syntax check, arg/result type processing, but still
965 ;;; call RECOGNIZE-KNOWN-CALL, since the call might be to a known lambda, and
966 ;;; that checking is done by local call analysis.
967 ;;;
968 (defun validate-call-type (call type ir1-p)
969 (declare (type combination call) (type ctype type))
970 (cond ((not (function-type-p type))
971 (assert (multiple-value-bind
972 (val win)
973 (csubtypep type (specifier-type 'function))
974 (or val (not win))))
975 (recognize-known-call call ir1-p))
976 ((valid-function-use call type
977 :argument-test #'always-subtypep
978 :result-test #'always-subtypep
979 :error-function #'compiler-warning
980 :warning-function #'compiler-note)
981 (assert-call-type call type)
982 (maybe-terminate-block call ir1-p)
983 (recognize-known-call call ir1-p))
984 (t
985 (setf (combination-kind call) :error)
986 (values nil nil))))
987
988
989 ;;; Propagate-Function-Change -- Internal
990 ;;;
991 ;;; Called by Ir1-Optimize when the function for a call has changed.
992 ;;; If the call is local, we try to let-convert it, and derive the result type.
993 ;;; If it is a :FULL call, we validate it against the type, which recognizes
994 ;;; known calls, does inline expansion, etc. If a call to a predicate in a
995 ;;; non-conditional position or to a function with a source transform, then we
996 ;;; reconvert the form to give IR1 another chance.
997 ;;;
998 (defun propagate-function-change (call)
999 (declare (type combination call))
1000 (let ((*compiler-error-context* call)
1001 (fun-cont (basic-combination-fun call)))
1002 (setf (continuation-reoptimize fun-cont) nil)
1003 (case (combination-kind call)
1004 (:local
1005 (let ((fun (combination-lambda call)))
1006 (maybe-let-convert fun)
1007 (unless (member (functional-kind fun) '(:let :assignment :deleted))
1008 (derive-node-type call (tail-set-type (lambda-tail-set fun))))))
1009 (:full
1010 (multiple-value-bind
1011 (leaf info)
1012 (validate-call-type call (continuation-type fun-cont) nil)
1013 (cond ((functional-p leaf)
1014 (convert-call-if-possible
1015 (continuation-use (basic-combination-fun call))
1016 call))
1017 ((not leaf))
1018 ((or (info function source-transform (leaf-name leaf))
1019 (and info
1020 (ir1-attributep (function-info-attributes info)
1021 predicate)
1022 (let ((dest (continuation-dest (node-cont call))))
1023 (and dest (not (if-p dest))))))
1024 (let ((name (leaf-name leaf)))
1025 (when (symbolp name)
1026 (let ((dums (loop repeat (length (combination-args call))
1027 collect (gensym))))
1028 (transform-call call
1029 `(lambda ,dums
1030 (,name ,@dums))))))))))))
1031 (undefined-value))
1032
1033
1034 ;;;; Known function optimization:
1035
1036
1037 ;;; RECORD-OPTIMIZATION-FAILURE -- Internal
1038 ;;;
1039 ;;; Add a failed optimization note to FAILED-OPTIMZATIONS for Node, Fun
1040 ;;; and Args. If there is already a note for Node and Transform, replace it,
1041 ;;; otherwise add a new one.
1042 ;;;
1043 (defun record-optimization-failure (node transform args)
1044 (declare (type combination node) (type transform transform)
1045 (type (or function-type list) args))
1046 (let* ((table (component-failed-optimizations *compile-component*))
1047 (found (assoc transform (gethash node table))))
1048 (if found
1049 (setf (cdr found) args)
1050 (push (cons transform args) (gethash node table))))
1051 (undefined-value))
1052
1053
1054 ;;; IR1-Transform -- Internal
1055 ;;;
1056 ;;; Attempt to transform Node using Function, subject to the call type
1057 ;;; constraint Type. If we are inhibited from doing the transform for some
1058 ;;; reason and Flame is true, then we make a note of the message in
1059 ;;; FAILED-OPTIMIZATIONS for IR1 finalize to pick up. We return true if
1060 ;;; the transform failed, and thus further transformation should be
1061 ;;; attempted. We return false if either the transform suceeded or was
1062 ;;; aborted.
1063 ;;;
1064 (defun ir1-transform (node transform)
1065 (declare (type combination node) (type transform transform))
1066 (let* ((type (transform-type transform))
1067 (fun (transform-function transform))
1068 (constrained (function-type-p type))
1069 (table (component-failed-optimizations *compile-component*))
1070 (flame
1071 (if (transform-important transform)
1072 (policy node (>= speed brevity))
1073 (policy node (> speed brevity))))
1074 (*compiler-error-context* node))
1075 (cond ((let ((when (transform-when transform)))
1076 (not (or (eq when :both)
1077 (eq when (if *byte-compiling* :byte :native)))))
1078 t)
1079 ((or (not constrained)
1080 (valid-function-use node type :strict-result t))
1081 (multiple-value-bind
1082 (severity args)
1083 (catch 'give-up
1084 (transform-call node (funcall fun node))
1085 (values :none nil))
1086 (ecase severity
1087 (:none
1088 (remhash node table)
1089 nil)
1090 (:aborted
1091 (setf (combination-kind node) :error)
1092 (when args
1093 (apply #'compiler-warning args))
1094 (remhash node table)
1095 nil)
1096 (:failure
1097 (if args
1098 (when flame
1099 (record-optimization-failure node transform args))
1100 (setf (gethash node table)
1101 (remove transform (gethash node table) :key #'car)))
1102 t)
1103 (:delayed
1104 (remhash node table)
1105 nil))))
1106 ((and flame
1107 (valid-function-use node type
1108 :argument-test #'types-intersect
1109 :result-test #'values-types-intersect))
1110 (record-optimization-failure node transform type)
1111 t)
1112 (t
1113 t))))
1114
1115 (declaim (end-block))
1116
1117 ;;; give-up, abort-transform -- Interface
1118 ;;;
1119 ;;; Just throw the severity and args...
1120 ;;;
1121 (defun give-up (&rest args)
1122 "This function is used to throw out of an IR1 transform, aborting this
1123 attempt to transform the call, but admitting the possibility that this or
1124 some other transform will later suceed. If arguments are supplied, they are
1125 format arguments for an efficiency note."
1126 (values nil)
1127 (throw 'give-up (values :failure args)))
1128 ;;;
1129 (defun abort-transform (&rest args)
1130 "This function is used to throw out of an IR1 transform and force a normal
1131 call to the function at run time. No further optimizations will be
1132 attempted."
1133 (throw 'give-up (values :aborted args)))
1134
1135 (defvar *delayed-transforms*)
1136
1137 ;;; delay-transform -- Interface
1138 ;;;
1139 (defun delay-transform (node &rest reasons)
1140 "This function is used to throw out of an IR1 transform, and delay the
1141 transform on the node until later. The reasons specifies when the transform
1142 will be later retried. The :optimize reason causes the transform to be
1143 delayed until after the current IR1 optimization pass. The :constraint
1144 reason causes the transform to be delayed until after constraint
1145 propagation."
1146 (let ((assoc (assoc node *delayed-transforms*)))
1147 (cond ((not assoc)
1148 (setf *delayed-transforms*
1149 (acons node reasons *delayed-transforms*))
1150 (throw 'give-up :delayed))
1151 ((cdr assoc)
1152 (dolist (reason reasons)
1153 (pushnew reason (cdr assoc)))
1154 (throw 'give-up :delayed)))))
1155
1156 ;;; retry-delayed-transforms -- Interface.
1157 ;;;
1158 ;;; Clear any delayed transform with no reasons - these should have been tried
1159 ;;; in the last pass. Then remove the reason from the delayed transform
1160 ;;; reasons, and if any become empty then set reoptimize flags for the
1161 ;;; node. Returns true if any transforms are to be retried.
1162 ;;;
1163 (defun retry-delayed-transforms (reason)
1164 (setf *delayed-transforms* (remove-if-not #'cdr *delayed-transforms*))
1165 (let ((reoptimize nil))
1166 (dolist (assoc *delayed-transforms*)
1167 (let ((reasons (remove reason (cdr assoc))))
1168 (setf (cdr assoc) reasons)
1169 (unless reasons
1170 (let ((node (car assoc)))
1171 (unless (node-deleted node)
1172 (setf reoptimize t)
1173 (setf (node-reoptimize node) t)
1174 (let ((block (node-block node)))
1175 (setf (block-reoptimize block) t)
1176 (setf (component-reoptimize (block-component block)) t)))))))
1177 reoptimize))
1178
1179
1180 ;;; Transform-Call -- Internal
1181 ;;;
1182 ;;; Take the lambda-expression Res, IR1 convert it in the proper
1183 ;;; environment, and then install it as the function for the call Node. We do
1184 ;;; local call analysis so that the new function is integrated into the control
1185 ;;; flow.
1186 ;;;
1187 (defun transform-call (node res)
1188 (declare (type combination node) (list res))
1189 (with-ir1-environment node
1190 (let ((new-fun (ir1-convert-inline-lambda res))
1191 (ref (continuation-use (combination-fun node))))
1192 (change-ref-leaf ref new-fun)
1193 (setf (combination-kind node) :full)
1194 (local-call-analyze *current-component*)))
1195 (undefined-value))
1196
1197 ;;; Constant-Fold-Call -- Internal
1198 ;;;
1199 ;;; Replace a call to a foldable function of constant arguments with the
1200 ;;; result of evaluating the form. We insert the resulting constant node after
1201 ;;; the call, stealing the call's continuation. We give the call a
1202 ;;; continuation with no Dest, which should cause it and its arguments to go
1203 ;;; away. If there is an error during the evaluation, we give a warning and
1204 ;;; leave the call alone, making the call a :ERROR call.
1205 ;;;
1206 ;;; If there is more than one value, then we transform the call into a
1207 ;;; values form.
1208 ;;;
1209 (defun constant-fold-call (call)
1210 (declare (type combination call))
1211 (let* ((args (mapcar #'continuation-value (combination-args call)))
1212 (ref (continuation-use (combination-fun call)))
1213 (fun (leaf-name (ref-leaf ref))))
1214
1215 (multiple-value-bind (values win)
1216 (careful-call fun args call "constant folding")
1217 (cond ((not win)
1218 (setf (combination-kind call) :error))
1219 ;;
1220 ;; Don't constand-fold a call if one of its arguments
1221 ;; requires a type check.
1222 ((or (policy call (< safety 3))
1223 (loop for arg in (basic-combination-args call)
1224 as check = (continuation-type-check arg)
1225 always (member check '(nil :deleted))))
1226 (let ((dummies (loop repeat (length args) collect (gensym))))
1227 (transform-call
1228 call
1229 `(lambda ,dummies
1230 (declare (ignore ,@dummies))
1231 (values ,@(mapcar (lambda (x) `',x) values)))))))))
1232 (values))
1233
1234
1235 ;;;; Local call optimization:
1236
1237 (declaim (start-block ir1-optimize-set constant-reference-p delete-let
1238 propagate-let-args propagate-local-call-args
1239 propagate-to-refs propagate-from-sets
1240 ir1-optimize-mv-combination))
1241
1242 ;;; Propagate-To-Refs -- Internal
1243 ;;;
1244 ;;; Propagate Type to Leaf and its Refs, marking things changed. If the
1245 ;;; leaf type is a function type, then just leave it alone, since TYPE is never
1246 ;;; going to be more specific than that (and TYPE-INTERSECTION would choke.)
1247 ;;;
1248 (defun propagate-to-refs (leaf type)
1249 (declare (type leaf leaf) (type ctype type))
1250 (let ((var-type (leaf-type leaf)))
1251 (unless (function-type-p var-type)
1252 (let ((int (type-intersection var-type type)))
1253 (when (type/= int var-type)
1254 (setf (leaf-type leaf) int)
1255 (dolist (ref (leaf-refs leaf))
1256 (derive-node-type ref int))))
1257 (undefined-value))))
1258
1259
1260 ;;; PROPAGATE-FROM-SETS -- Internal
1261 ;;;
1262 ;;; Figure out the type of a LET variable that has sets. We compute the
1263 ;;; union of the initial value Type and the types of all the set values and to
1264 ;;; a PROPAGATE-TO-REFS with this type.
1265 ;;;
1266 (defun propagate-from-sets (var type)
1267 (collect ((res type type-union))
1268 (dolist (set (basic-var-sets var))
1269 (res (continuation-type (set-value set)))
1270 (setf (node-reoptimize set) nil))
1271 (propagate-to-refs var (res)))
1272 (undefined-value))
1273
1274
1275 ;;; IR1-OPTIMIZE-SET -- Internal
1276 ;;;
1277 ;;; If a let variable, find the initial value's type and do
1278 ;;; PROPAGATE-FROM-SETS. We also derive the VALUE's type as the node's type.
1279 ;;;
1280 (defun ir1-optimize-set (node)
1281 (declare (type cset node))
1282 (let ((var (set-var node)))
1283 (when (and (lambda-var-p var) (leaf-refs var))
1284 (let ((home (lambda-var-home var)))
1285 (when (eq (functional-kind home) :let)
1286 (let ((iv (let-var-initial-value var)))
1287 (setf (continuation-reoptimize iv) nil)
1288 (propagate-from-sets var (continuation-type iv)))))))
1289
1290 (derive-node-type node (continuation-type (set-value node)))
1291 (undefined-value))
1292
1293
1294 ;;; CONSTANT-REFERENCE-P -- Interface
1295 ;;;
1296 ;;; Return true if the value of Ref will always be the same (and is thus
1297 ;;; legal to substitute.)
1298 ;;;
1299 (defun constant-reference-p (ref)
1300 (declare (type ref ref))
1301 (let ((leaf (ref-leaf ref)))
1302 (typecase leaf
1303 ((or constant functional) t)
1304 (lambda-var
1305 (null (lambda-var-sets leaf)))
1306 (defined-function
1307 (not (eq (defined-function-inlinep leaf) :notinline)))
1308 (global-var
1309 (case (global-var-kind leaf)
1310 (:global-function t)
1311 (:constant t))))))
1312
1313
1314 ;;; SUBSTITUTE-SINGLE-USE-CONTINUATION -- Internal
1315 ;;;
1316 ;;; If we have a non-set let var with a single use, then (if possible)
1317 ;;; replace the variable reference's CONT with the arg continuation. This is
1318 ;;; inhibited when:
1319 ;;; -- CONT has other uses, or
1320 ;;; -- CONT receives multiple values, or
1321 ;;; -- the reference is in a different environment from the variable, or
1322 ;;; -- either continuation has a funky TYPE-CHECK annotation.
1323 ;;; -- the continuations have incompatible assertions, so the new asserted type
1324 ;;; would be NIL.
1325 ;;; -- CONT's assertion is incompatbile with the proven type of ARG's, such as
1326 ;;; when ARG returns multiple values and CONT has a single value assertion.
1327 ;;; -- the var's DEST has a different policy than the ARG's (think safety).
1328 ;;;
1329 ;;; We change the Ref to be a reference to NIL with unused value, and let it
1330 ;;; be flushed as dead code. A side-effect of this substitution is to delete
1331 ;;; the variable.
1332 ;;;
1333 (defun substitute-single-use-continuation (arg var)
1334 (declare (type continuation arg) (type lambda-var var))
1335 (let* ((ref (first (leaf-refs var)))
1336 (cont (node-cont ref))
1337 (cont-atype (continuation-asserted-type cont))
1338 (dest (continuation-dest cont)))
1339 (when (and (eq (continuation-use cont) ref)
1340 dest
1341 (not (typep dest '(or creturn exit mv-combination)))
1342 (eq (node-home-lambda ref)
1343 (lambda-home (lambda-var-home var)))
1344 (member (continuation-type-check arg) '(t nil))
1345 (member (continuation-type-check cont) '(t nil))
1346 (not (eq (values-type-intersection
1347 cont-atype (continuation-asserted-type arg))
1348 *empty-type*))
1349 (not (eq (values-type-intersection
1350 cont-atype (continuation-proven-type arg))
1351 *empty-type*))
1352 (eq (lexenv-cookie (node-lexenv dest))
1353 (lexenv-cookie (node-lexenv (continuation-dest arg)))))
1354 (assert (member (continuation-kind arg)
1355 '(:block-start :deleted-block-start :inside-block)))
1356 (assert-continuation-type arg cont-atype)
1357 (setf (node-derived-type ref) *wild-type*)
1358 (change-ref-leaf ref (find-constant nil))
1359 (substitute-continuation arg cont)
1360 (reoptimize-continuation arg)
1361 t)))
1362
1363
1364 ;;; DELETE-LET -- Interface
1365 ;;;
1366 ;;; Delete a Let, removing the call and bind nodes, and warning about any
1367 ;;; unreferenced variables. Note that FLUSH-DEAD-CODE will come along right
1368 ;;; away and delete the REF and then the lambda, since we flush the FUN
1369 ;;; continuation.
1370 ;;;
1371 (defun delete-let (fun)
1372 (declare (type clambda fun))
1373 (assert (member (functional-kind fun) '(:let :mv-let)))
1374 (note-unreferenced-vars fun)
1375 (let ((call (let-combination fun)))
1376 (flush-dest (basic-combination-fun call))
1377 (unlink-node call)
1378 (unlink-node (lambda-bind fun))
1379 (setf (lambda-bind fun) nil))
1380 (undefined-value))
1381
1382
1383 ;;; Propagate-Let-Args -- Internal
1384 ;;;
1385 ;;; This function is called when one of the arguments to a LET changes. We
1386 ;;; look at each changed argument. If the corresponding variable is set, then
1387 ;;; we call PROPAGATE-FROM-SETS. Otherwise, we consider substituting for the
1388 ;;; variable, and also propagate derived-type information for the arg to all
1389 ;;; the Var's refs.
1390 ;;;
1391 ;;; Substitution is inhibited when the arg leaf's derived type isn't a
1392 ;;; subtype of the argument's asserted type. This prevents type checking from
1393 ;;; being defeated, and also ensures that the best representation for the
1394 ;;; variable can be used.
1395 ;;;
1396 ;;; Substitution of individual references is inhibited if the reference is
1397 ;;; in a different component from the home. This can only happen with closures
1398 ;;; over top-level lambda vars. In such cases, the references may have already
1399 ;;; been compiled, and thus can't be retroactively modified.
1400 ;;;
1401 ;;; If all of the variables are deleted (have no references) when we are
1402 ;;; done, then we delete the let.
1403 ;;;
1404 ;;; Note that we are responsible for clearing the Continuation-Reoptimize
1405 ;;; flags.
1406 ;;;
1407 (defun propagate-let-args (call fun)
1408 (declare (type combination call) (type clambda fun))
1409 (loop for arg in (combination-args call)
1410 and var in (lambda-vars fun) do
1411 (when (and arg (continuation-reoptimize arg))
1412 (setf (continuation-reoptimize arg) nil)
1413 (cond
1414 ((lambda-var-sets var)
1415 (propagate-from-sets var (continuation-type arg)))
1416 ((let ((use (continuation-use arg)))
1417 (when (ref-p use)
1418 (let ((leaf (ref-leaf use)))
1419 (when (and (constant-reference-p use)
1420 (values-subtypep (leaf-type leaf)
1421 (continuation-asserted-type arg)))
1422 (propagate-to-refs var (continuation-type arg))
1423 (let ((this-comp (block-component (node-block use))))
1424 (substitute-leaf-if
1425 #'(lambda (ref)
1426 (cond ((eq (block-component (node-block ref))
1427 this-comp)
1428 t)
1429 (t
1430 (assert (eq (functional-kind (lambda-home fun))
1431 :top-level))
1432 nil)))
1433 leaf var))
1434 t)))))
1435 ((and (null (rest (leaf-refs var)))
1436 (not *byte-compiling*)
1437 (substitute-single-use-continuation arg var)))
1438 (t
1439 (propagate-to-refs var (continuation-type arg))))))
1440
1441 (when (every #'null (combination-args call))
1442 (delete-let fun))
1443
1444 (undefined-value))
1445
1446
1447 ;;; Propagate-Local-Call-Args -- Internal
1448 ;;;
1449 ;;; This function is called when one of the args to a non-let local call
1450 ;;; changes. For each changed argument corresponding to an unset variable, we
1451 ;;; compute the union of the types across all calls and propagate this type
1452 ;;; information to the var's refs.
1453 ;;;
1454 ;;; If the function has an XEP, then we don't do anything, since we won't
1455 ;;; discover anything.
1456 ;;;
1457 ;;; We can clear the Continuation-Reoptimize flags for arguments in all calls
1458 ;;; corresponding to changed arguments in Call, since the only use in IR1
1459 ;;; optimization of the Reoptimize flag for local call args is right here.
1460 ;;;
1461 (defun propagate-local-call-args (call fun)
1462 (declare (type combination call) (type clambda fun))
1463
1464 (unless (or (functional-entry-function fun)
1465 (lambda-optional-dispatch fun))
1466 (let* ((vars (lambda-vars fun))
1467 (union (mapcar #'(lambda (arg var)
1468 (when (and arg
1469 (continuation-reoptimize arg)
1470 (null (basic-var-sets var)))
1471 (continuation-type arg)))
1472 (basic-combination-args call)
1473 vars))
1474 (this-ref (continuation-use (basic-combination-fun call))))
1475
1476 (dolist (arg (basic-combination-args call))
1477 (when arg
1478 (setf (continuation-reoptimize arg) nil)))
1479
1480 (dolist (ref (leaf-refs fun))
1481 (let ((dest (continuation-dest (node-cont ref))))
1482 (unless (or (eq ref this-ref) (not dest))
1483 (setq union
1484 (mapcar #'(lambda (this-arg old)
1485 (when old
1486 (setf (continuation-reoptimize this-arg) nil)
1487 (type-union (continuation-type this-arg) old)))
1488 (basic-combination-args dest)
1489 union)))))
1490
1491 (mapc #'(lambda (var type)
1492 (when type
1493 (propagate-to-refs var type)))
1494 vars union)))
1495
1496 (undefined-value))
1497
1498 (declaim (end-block))
1499
1500
1501 ;;;; Multiple values optimization:
1502
1503 ;;; IR1-OPTIMIZE-MV-COMBINATION -- Internal
1504 ;;;
1505 ;;; Do stuff to notice a change to a MV combination node. There are two
1506 ;;; main branches here:
1507 ;;; -- If the call is local, then it is already a MV let, or should become one.
1508 ;;; Note that although all :LOCAL MV calls must eventually be converted to
1509 ;;; :MV-LETs, there can be a window when the call is local, but has not
1510 ;;; been let converted yet. This is because the entry-point lambdas may
1511 ;;; have stray references (in other entry points) that have not been
1512 ;;; deleted yet.
1513 ;;; -- The call is full. This case is somewhat similar to the non-MV
1514 ;;; combination optimization: we propagate return type information and
1515 ;;; notice non-returning calls. We also have an optimization
1516 ;;; which tries to convert MV-CALLs into MV-binds.
1517 ;;;
1518 (defun ir1-optimize-mv-combination (node)
1519 (ecase (basic-combination-kind node)
1520 (:local
1521 (let ((fun-cont (basic-combination-fun node)))
1522 (when (continuation-reoptimize fun-cont)
1523 (setf (continuation-reoptimize fun-cont) nil)
1524 (maybe-let-convert (combination-lambda node))))
1525 (setf (continuation-reoptimize (first (basic-combination-args node))) nil)
1526 (when (eq (functional-kind (combination-lambda node)) :mv-let)
1527 (unless (convert-mv-bind-to-let node)
1528 (ir1-optimize-mv-bind node))))
1529 (:full
1530 (let* ((fun (basic-combination-fun node))
1531 (fun-changed (continuation-reoptimize fun))
1532 (args (basic-combination-args node)))
1533 (when fun-changed
1534 (setf (continuation-reoptimize fun) nil)
1535 (let ((type (continuation-type fun)))
1536 (when (function-type-p type)
1537 (derive-node-type node (function-type-returns type))))
1538 (maybe-terminate-block node nil)
1539 (let ((use (continuation-use fun)))
1540 (when (and (ref-p use) (functional-p (ref-leaf use)))
1541 (convert-call-if-possible use node)
1542 (when (eq (basic-combination-kind node) :local)
1543 (maybe-let-convert (ref-leaf use))))))
1544 (unless (or (eq (basic-combination-kind node) :local)
1545 (eq (continuation-function-name fun) '%throw))
1546 (ir1-optimize-mv-call node))
1547 (dolist (arg args)
1548 (setf (continuation-reoptimize arg) nil))))
1549 (:error))
1550 (undefined-value))
1551
1552
1553 ;;; Values-types-defaulted -- Internal
1554 ;;;
1555 ;;; Like values-types, but returns the types of the given number of
1556 ;;; arguments. If optional of rest values must be used then the union
1557 ;;; with the null type is computed in case of defaulting, and if no
1558 ;;; values are available then they are defaulted to the null type.
1559 ;;;
1560 (defun values-types-defaulted (type count)
1561 (declare (type ctype type) (type index count))
1562 (cond ((eq type *wild-type*)
1563 (let ((types nil))
1564 (dotimes (i count types)
1565 (push *universal-type* types))))
1566 ((not (values-type-p type))
1567 (let ((types nil))
1568 (dotimes (i (1- count))
1569 (push *null-type* types))
1570 (push type types)))
1571 (t
1572 (let ((required (args-type-required type))
1573 (optional (args-type-optional type))
1574 (keyp-allowp (or (args-type-keyp type) (args-type-allowp type)))
1575 (rest (args-type-rest type)))
1576 (collect ((types))
1577 (dotimes (i count)
1578 (types (cond (required (single-value-type (pop required)))
1579 (optional (values-type-union
1580 (single-value-type (pop optional))
1581 *null-type*))
1582 (keyp-allowp *universal-type*)
1583 (rest (values-type-union (single-value-type rest)
1584 *null-type*))
1585 (t *null-type*))))
1586 (types))))))
1587
1588
1589 ;;; IR1-OPTIMIZE-MV-BIND -- Internal
1590 ;;;
1591 ;;; Propagate derived type info from the values continuation to the vars.
1592 ;;;
1593 (defun ir1-optimize-mv-bind (node)
1594 (declare (type mv-combination node))
1595 (let ((arg (first (basic-combination-args node)))
1596 (vars (lambda-vars (combination-lambda node))))
1597 (let ((types (values-types-defaulted (continuation-derived-type arg)
1598 (length vars))))
1599 (mapc #'(lambda (var type)
1600 (if (basic-var-sets var)
1601 (propagate-from-sets var type)
1602 (propagate-to-refs var type)))
1603 vars types))
1604
1605 (setf (continuation-reoptimize arg) nil))
1606 (undefined-value))
1607
1608
1609 ;;; IR1-OPTIMIZE-MV-CALL -- Internal
1610 ;;;
1611 ;;; If possible, convert a general MV call to an MV-BIND. We can do this
1612 ;;; if:
1613 ;;; -- The call has only one argument, and
1614 ;;; -- The function has a known fixed number of arguments, or
1615 ;;; -- The argument yields a known fixed number of values.
1616 ;;;
1617 ;;; What we do is change the function in the MV-CALL to be a lambda that "looks
1618 ;;; like an MV bind", which allows IR1-OPTIMIZE-MV-COMBINATION to notice that
1619 ;;; this call can be converted (the next time around.) This new lambda just
1620 ;;; calls the actual function with the MV-BIND variables as arguments. Note
1621 ;;; that this new MV bind is not let-converted immediately, as there are going
1622 ;;; to be stray references from the entry-point functions until they get
1623 ;;; deleted.
1624 ;;;
1625 ;;; In order to avoid loss of argument count checking, we only do the
1626 ;;; transformation according to a known number of expected argument if safety
1627 ;;; is unimportant. We can always convert if we know the number of actual
1628 ;;; values, since the normal call that we build will still do any appropriate
1629 ;;; argument count checking.
1630 ;;;
1631 ;;; We only attempt the transformation if the called function is a constant
1632 ;;; reference. This allows us to just splice the leaf into the new function,
1633 ;;; instead of trying to somehow bind the function expression. The leaf must
1634 ;;; be constant because we are evaluating it again in a different place. This
1635 ;;; also has the effect of squelching multiple warnings when there is an
1636 ;;; argument count error.
1637 ;;;
1638 (defun ir1-optimize-mv-call (node)
1639 (let ((fun (basic-combination-fun node))
1640 (*compiler-error-context* node)
1641 (ref (continuation-use (basic-combination-fun node)))
1642 (args (basic-combination-args node)))
1643
1644 (unless (and (ref-p ref) (constant-reference-p ref)
1645 args (null (rest args)))
1646 (return-from ir1-optimize-mv-call))
1647
1648 (multiple-value-bind (min max)
1649 (function-type-nargs (continuation-type fun))
1650 (let ((total-nvals
1651 (multiple-value-bind
1652 (types nvals)
1653 (values-types (continuation-derived-type (first args)))
1654 (declare (ignore types))
1655 (if (eq nvals :unknown) nil nvals))))
1656
1657 (when total-nvals
1658 (when (and min (< total-nvals min))
1659 (compiler-warning
1660 "MULTIPLE-VALUE-CALL with ~R values when the function expects ~
1661 at least ~R."
1662 total-nvals min)
1663 (setf (basic-combination-kind node) :error)
1664 (return-from ir1-optimize-mv-call))
1665 (when (and max (> total-nvals max))
1666 (compiler-warning
1667 "MULTIPLE-VALUE-CALL with ~R values when the function expects ~
1668 at most ~R."
1669 total-nvals max)
1670 (setf (basic-combination-kind node) :error)
1671 (return-from ir1-optimize-mv-call)))
1672
1673 (let ((count (cond (total-nvals)
1674 ((and (policy node (zerop safety)) (eql min max))
1675 min)
1676 (t nil))))
1677 (when count
1678 (with-ir1-environment node
1679 (let* ((dums (loop repeat count collect (gensym)))
1680 (ignore (gensym))
1681 (fun (ir1-convert-lambda
1682 `(lambda (&optional ,@dums &rest ,ignore)
1683 (declare (ignore ,ignore))
1684 (funcall ,(ref-leaf ref) ,@dums))
1685 nil ; name
1686 nil ; parent-form
1687 nil ; allow-debug-catch-tag
1688 'ir1-optimize-mv-call ; caller
1689 )))
1690 (change-ref-leaf ref fun)
1691 (assert (eq (basic-combination-kind node) :full))
1692 (local-call-analyze *current-component*)
1693 (assert (eq (basic-combination-kind node) :local)))))))))
1694 (undefined-value))
1695
1696
1697 ;;; CONVERT-MV-BIND-TO-LET -- Internal
1698 ;;;
1699 ;;; If we see:
1700 ;;; (multiple-value-bind (x y)
1701 ;;; (values xx yy)
1702 ;;; ...)
1703 ;;; Convert to:
1704 ;;; (let ((x xx)
1705 ;;; (y yy))
1706 ;;; ...)
1707 ;;;
1708 ;;; What we actually do is convert the VALUES combination into a normal let
1709 ;;; combination calling the original :MV-LET lambda. If there are extra args to
1710 ;;; VALUES, discard the corresponding continuations. If there are insufficient
1711 ;;; args, insert references to NIL.
1712 ;;;
1713 (defun convert-mv-bind-to-let (call)
1714 (declare (type mv-combination call))
1715 (let* ((arg (first (basic-combination-args call)))
1716 (use (continuation-use arg)))
1717 (when (and (combination-p use)
1718 (eq (continuation-function-name (combination-fun use))
1719 'values))
1720 (let* ((fun (combination-lambda call))
1721 (vars (lambda-vars fun))
1722 (vals (combination-args use))
1723 (nvars (length vars))
1724 (nvals (length vals)))
1725 (cond ((> nvals nvars)
1726 (mapc #'flush-dest (subseq vals nvars))
1727 (setq vals (subseq vals 0 nvars)))
1728 ((< nvals nvars)
1729 (with-ir1-environment use
1730 (let ((node-prev (node-prev use)))
1731 (setf (node-prev use) nil)
1732 (setf (continuation-next node-prev) nil)
1733 (collect ((res vals))
1734 (loop as cont = (make-continuation use)
1735 and prev = node-prev then cont
1736 repeat (- nvars nvals)
1737 do (reference-constant prev cont nil)
1738 (res cont))
1739 (setq vals (res)))
1740 (prev-link use (car (last vals)))))))
1741 (setf (combination-args use) vals)
1742 (flush-dest (combination-fun use))
1743 (let ((fun-cont (basic-combination-fun call)))
1744 (setf (continuation-dest fun-cont) use)
1745 (setf (combination-fun use) fun-cont))
1746 (setf (combination-kind use) :local)
1747 (setf (functional-kind fun) :let)
1748 (flush-dest (first (basic-combination-args call)))
1749 (unlink-node call)
1750 (when vals
1751 (reoptimize-continuation (first vals)))
1752 (propagate-to-args use fun))
1753 t)))
1754
1755
1756 ;;; VALUES-LIST IR1 optimizer -- Internal
1757 ;;;
1758 ;;; If we see:
1759 ;;; (values-list (list x y z))
1760 ;;;
1761 ;;; Convert to:
1762 ;;; (values x y z)
1763 ;;;
1764 ;;; In implementation, this is somewhat similar to CONVERT-MV-BIND-TO-LET. We
1765 ;;; grab the args of LIST and make them args of the VALUES-LIST call, flushing
1766 ;;; the old argument continuation (allowing the LIST to be flushed.)
1767 ;;;
1768 (defoptimizer (values-list optimizer) ((list) node)
1769 (let ((use (continuation-use list)))
1770 (when (and (combination-p use)
1771 (eq (continuation-function-name (combination-fun use))
1772 'list))
1773 (change-ref-leaf (continuation-use (combination-fun node))
1774 (find-free-function 'values "in a strange place"))
1775 (setf (combination-kind node) :full)
1776 (let ((args (combination-args use)))
1777 (dolist (arg args)
1778 (setf (continuation-dest arg) node))
1779 (setf (combination-args use) nil)
1780 (flush-dest list)
1781 (setf (combination-args node) args))
1782 t)))
1783
1784
1785 ;;; VALUES IR1 transform -- Internal
1786 ;;;
1787 ;;; If VALUES appears in a non-MV context, then effectively convert it to a
1788 ;;; PROG1. This allows the computation of the additional values to become dead
1789 ;;; code. Some attempt is made to correct the node derived type, setting it to
1790 ;;; the received single-value-type. The node continuation asserted type must
1791 ;;; also be adjusted, taking care when the continuation has multiple uses.
1792 ;;;
1793 (deftransform values ((&rest vals) * * :node node)
1794 (let ((cont (node-cont node)))
1795 (when (typep (continuation-dest cont) '(or creturn exit mv-combination))
1796 (give-up))
1797 (flet ((first-value-type (type)
1798 (declare (type ctype type))
1799 (cond ((values-type-p type)
1800 (let ((required (args-type-required type)))
1801 (if required
1802 (first required)
1803 (let ((otype (args-type-optional type)))
1804 (cond (otype (first otype))
1805 ((or (args-type-keyp type)
1806 (args-type-allowp type))
1807 *universal-type*)
1808 ((args-type-rest type))
1809 (t *null-type*))))))
1810 ((eq type *wild-type*)
1811 *universal-type*)
1812 (t
1813 type))))
1814 (cond ((= (length (find-uses cont)) 1)
1815 (setf (node-derived-type node)
1816 (single-value-type (node-derived-type node)))
1817 (setf (continuation-asserted-type cont)
1818 (first-value-type (continuation-asserted-type cont))))
1819 (t
1820 (setf (node-derived-type node)
1821 (single-value-type (node-derived-type node)))
1822 (setf (continuation-asserted-type cont)
1823 (values-type-union (continuation-asserted-type cont)
1824 (first-value-type
1825 (continuation-asserted-type cont)))))))
1826 (reoptimize-continuation cont)
1827 (if vals
1828 (let ((dummies (loop repeat (1- (length vals))
1829 collect (gensym))))
1830 `(lambda (val ,@dummies)
1831 (declare (ignore ,@dummies))
1832 val))
1833 'nil)))

  ViewVC Help
Powered by ViewVC 1.1.5