X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fir1util.lisp;h=ea581fb5e4864d8c56f7455b913a04960cd0142a;hb=b7192afcef9bbfd3fe1a4e2bfe3c73f853d164d1;hp=74f5a20189abee8d29ac0364817bf690230b2e1a;hpb=85029815128ff53d16013d51ad0beb79b0eb3744;p=sbcl.git diff --git a/src/compiler/ir1util.lisp b/src/compiler/ir1util.lisp index 74f5a20..ea581fb 100644 --- a/src/compiler/ir1util.lisp +++ b/src/compiler/ir1util.lisp @@ -1081,9 +1081,12 @@ (when last (let ((cont (node-cont last))) (delete-continuation-use last) - (if (eq (continuation-kind cont) :unused) - (delete-continuation cont) - (reoptimize-continuation cont))))) + (acond ((eq (continuation-kind cont) :unused) + (delete-continuation cont)) + ((and (null (find-uses cont)) + (continuation-dest cont)) + (mark-for-deletion (node-block it))) + ((reoptimize-continuation cont)))))) (dolist (b (block-pred block)) (unlink-blocks b block) @@ -1143,7 +1146,7 @@ (cast (flush-dest (cast-value node)))) - (delete-continuation (node-prev node))) + (delete-continuation (node-prev node))) (remove-from-dfo block) (values)) @@ -1602,6 +1605,20 @@ *inline-expansion-limit*)) nil) (t t)))) + +;;; Make sure that FUNCTIONAL is not let-converted or deleted. +(defun assure-functional-live-p (functional) + (declare (type functional functional)) + (when (and (or + ;; looks LET-converted + (functional-somewhat-letlike-p functional) + ;; It's possible for a LET-converted function to end up + ;; deleted later. In that case, for the purposes of this + ;; analysis, it is LET-converted: LET-converted functionals + ;; are too badly trashed to expand them inline, and deleted + ;; LET-converted functionals are even worse. + (eql (functional-kind functional) :deleted))) + (throw 'locall-already-let-converted functional))) ;;;; careful call