1.0.43.26: propagate-local-call-args for lambdas with optional-dispatches too
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 6 Oct 2010 08:59:32 +0000 (08:59 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 6 Oct 2010 08:59:32 +0000 (08:59 +0000)
 Previously we elided the propagation if the lambda had an entry-fun
 or an optional-dispatch. The comment notes that we "If the function
 has an XEP, then we don't do anything".

 There are, however, lambdas with optional-dispatche that don't have
 XEPs. Doing propagation for these is required for proper &REST list
 type derivation.

 Fixes lp#655203.

src/compiler/ir1opt.lisp
tests/compiler.pure.lisp
version.lisp-expr

index d091f38..59b145a 100644 (file)
 ;;; variable, we compute the union of the types across all calls and
 ;;; propagate this type information to the var's refs.
 ;;;
-;;; If the function has an XEP, then we don't do anything, since we
-;;; won't discover anything.
+;;; If the function has an entry-fun, then we don't do anything: since
+;;; it has a XEP we would not discover anything.
 ;;;
 ;;; We can clear the LVAR-REOPTIMIZE flags for arguments in all calls
 ;;; corresponding to changed arguments in CALL, since the only use in
 ;;; right here.
 (defun propagate-local-call-args (call fun)
   (declare (type combination call) (type clambda fun))
-  (unless (or (functional-entry-fun fun)
-              (lambda-optional-dispatch fun))
+  (unless (functional-entry-fun fun)
     (let* ((vars (lambda-vars fun))
            (union (mapcar (lambda (arg var)
                             (when (and arg
index 439518e..5435c43 100644 (file)
     (assert (eq 'list type))
     (assert derivedp)))
 
+(with-test (:name :rest-list-type-derivation2)
+  (multiple-value-bind (type derivedp)
+      (funcall (funcall (compile nil `(lambda ()
+                                        (lambda (&rest args)
+                                          (ctu:compiler-derived-type args))))))
+    (assert (eq 'list type))
+    (assert derivedp)))
+
 (with-test (:name :base-char-typep-elimination)
   (assert (eq (funcall (lambda (ch)
                          (declare (type base-char ch) (optimize (speed 3) (safety 0)))
index f09282b..dd65459 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.43.25"
+"1.0.43.26"