X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1opt.lisp;h=2ffc3850318564710acea8063412b4b8a6425330;hb=65a01dae3d437a48e8dd0d051a446245f9e29929;hp=62b0b1f119b82a521f8658cac4e440fa40297253;hpb=b4ccc20df7644d7d3b601a22059d796e8f23c9af;p=sbcl.git diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 62b0b1f..2ffc385 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -214,6 +214,11 @@ ~% ~S~%*** possible internal error? Please report this." (type-specifier rtype) (type-specifier node-type)))) (setf (node-derived-type node) int) + (when (and (ref-p node) + (member-type-p int) + (null (rest (member-type-members int))) + (lambda-var-p (ref-leaf node))) + (change-ref-leaf node (find-constant (first (member-type-members int))))) (reoptimize-continuation (node-cont node)))))) (values)) @@ -312,9 +317,15 @@ (let ((last (block-last block))) (typecase last (cif - (flush-dest (if-test last)) - (when (unlink-node last) - (return))) + (if (memq (continuation-type-check (if-test last)) + '(nil :deleted)) + ;; FIXME: Remove the test above when the bug 203 + ;; will be fixed. + (progn + (flush-dest (if-test last)) + (when (unlink-node last) + (return))) + (return))) (exit (when (maybe-delete-exit last) (return))))) @@ -628,22 +639,25 @@ (convert-if-if use node) (when (continuation-use test) (return))))) - (let* ((type (continuation-type test)) - (victim - (cond ((constant-continuation-p test) - (if (continuation-value test) - (if-alternative node) - (if-consequent node))) - ((not (types-equal-or-intersect type (specifier-type 'null))) - (if-alternative node)) - ((type= type (specifier-type 'null)) - (if-consequent node))))) - (when victim - (flush-dest test) - (when (rest (block-succ block)) - (unlink-blocks block victim)) - (setf (component-reanalyze (node-component node)) t) - (unlink-node node)))) + (when (memq (continuation-type-check test) + '(nil :deleted)) + ;; FIXME: Remove the test above when the bug 203 will be fixed. + (let* ((type (continuation-type test)) + (victim + (cond ((constant-continuation-p test) + (if (continuation-value test) + (if-alternative node) + (if-consequent node))) + ((not (types-equal-or-intersect type (specifier-type 'null))) + (if-alternative node)) + ((type= type (specifier-type 'null)) + (if-consequent node))))) + (when victim + (flush-dest test) + (when (rest (block-succ block)) + (unlink-blocks block victim)) + (setf (component-reanalyze (node-component node)) t) + (unlink-node node))))) (values)) ;;; Create a new copy of an IF node that tests the value of the node @@ -1704,7 +1718,8 @@ (unlink-node call) (when vals (reoptimize-continuation (first vals))) - (propagate-to-args use fun)) + (propagate-to-args use fun) + (reoptimize-call use)) t))) ;;; If we see: