X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1opt.lisp;h=314bb79b0932a72bc3e8d4b718d01024f92b7a4f;hb=085501b44cc1cbdd9e260139d30b383372ddd1b8;hp=2bdb4dedd65aaab3ac4456f6e19f88f3d3505304;hpb=68165e850aa0700741756fead44a53642194aa39;p=sbcl.git diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 2bdb4de..314bb79 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -451,7 +451,7 @@ ;;; appropriate.) ;;; ;;; We call MAYBE-CONVERT-TAIL-LOCAL-CALL on each local non-MV -;;; combination, which may change the succesor of the call to be the +;;; combination, which may change the successor of the call to be the ;;; called function, and if so, checks if the call can become an ;;; assignment. If we convert to an assignment, we abort, since the ;;; RETURN has been deleted. @@ -1830,6 +1830,17 @@ ;;; TODO: ;;; - CAST chains; +(defun delete-cast (cast) + (declare (type cast cast)) + (let ((value (cast-value cast)) + (lvar (node-lvar cast))) + (delete-filter cast lvar value) + (when lvar + (reoptimize-lvar lvar) + (when (lvar-single-value-p lvar) + (note-single-valuified-lvar lvar))) + (values))) + (defun ir1-optimize-cast (cast &optional do-not-optimize) (declare (type cast cast)) (let ((value (cast-value cast)) @@ -1838,11 +1849,7 @@ (let ((lvar (node-lvar cast))) (when (values-subtypep (lvar-derived-type value) (cast-asserted-type cast)) - (delete-filter cast lvar value) - (when lvar - (reoptimize-lvar lvar) - (when (lvar-single-value-p lvar) - (note-single-valuified-lvar lvar))) + (delete-cast cast) (return-from ir1-optimize-cast t)) (when (and (listp (lvar-uses value))