X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fir1final.lisp;h=c78d83a49fba024337960adc6d457806c4df0d6d;hb=f8893c7c658bf9d9e0757c63e47af2fdea810f04;hp=b4a1dbbc570abe3861723280d347511436249a79;hpb=2d4a0df3457bcd50916b33d374da592d8776db0a;p=sbcl.git diff --git a/src/compiler/ir1final.lisp b/src/compiler/ir1final.lisp index b4a1dbb..c78d83a 100644 --- a/src/compiler/ir1final.lisp +++ b/src/compiler/ir1final.lisp @@ -27,8 +27,8 @@ (note (transform-note (car failure)))) (cond ((consp what) - (compiler-note "~@" - note (first what) (rest what))) + (compiler-notify "~@" + note (first what) (rest what))) ((valid-fun-use node what :argument-test #'types-equal-or-intersect :result-test #'values-types-equal-or-intersect) @@ -39,10 +39,10 @@ (valid-fun-use node what :unwinnage-fun #'give-grief :lossage-fun #'give-grief)) - (compiler-note "~@" + (compiler-notify "~@" note (messages)))) ;; As best I can guess, it's OK to fall off the end here ;; because if it's not a VALID-FUNCTION-USE, the user @@ -108,13 +108,27 @@ (eq (info :function :kind name) :function)) (let ((atype (info :function :assumed-type name))) (dolist (ref (leaf-refs var)) - (let ((dest (continuation-dest (node-cont ref)))) + (let ((dest (node-dest ref))) (when (and (eq (node-component ref) component) (combination-p dest) - (eq (continuation-use (basic-combination-fun dest)) ref)) + (eq (lvar-uses (basic-combination-fun dest)) ref)) (setq atype (note-fun-use dest atype))))) (setf (info :function :assumed-type name) atype)))) +;;; Merge CASTs with preceding/following nodes. +(defun ir1-merge-casts (component) + (do-blocks-backwards (block component) + (do-nodes-backwards (node lvar block) + (let ((dest (when lvar (lvar-dest lvar)))) + (cond ((and (cast-p dest) + (not (cast-type-check dest)) + (immediately-used-p lvar node)) + (derive-node-type node (cast-asserted-type dest))) + ((and (cast-p node) + (eq (cast-type-check node) :external)) + (aver (basic-combination-p dest)) + (delete-filter node lvar (cast-value node)))))))) + ;;; Do miscellaneous things that we want to do once all optimization ;;; has been done: ;;; -- Record the derived result type before the back-end trashes the @@ -136,4 +150,7 @@ (maphash (lambda (k v) (note-assumed-types component k v)) *free-funs*) + + (ir1-merge-casts component) + (values))