From: Nathan Froyd Date: Fri, 6 Apr 2007 12:55:58 +0000 (+0000) Subject: 1.0.4.32: De-pessimize >= and <= transforms X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=4fb49bd07d1737a450249cea98fc825687d3bbf7;p=sbcl.git 1.0.4.32: De-pessimize >= and <= transforms Wait until we've computed type information for all the code we've introduced in this optimization pass before making the transform. We once again produce decent code for: (defun foo (x y) (declare (simple-vector x y)) (do ((i 0 (1+ i)) (end (length x))) ((>= i end) y) (setf (aref y i) (aref x i)))) --- diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index c49fe94..c1a1042 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3414,17 +3414,20 @@ (neq *empty-type* (type-intersection (specifier-type 'float) (lvar-type lvar)))) -(flet ((maybe-invert (op inverted x y) +(flet ((maybe-invert (node op inverted x y) ;; Don't invert if either argument can be a float (NaNs) - (if (or (maybe-float-lvar-p x) (maybe-float-lvar-p y)) - `(or (,op x y) (= x y)) - `(if (,inverted x y) nil t)))) - (deftransform >= ((x y) (number number) *) + (cond + ((or (maybe-float-lvar-p x) (maybe-float-lvar-p y)) + (delay-ir1-transform node :constraint) + `(or (,op x y) (= x y))) + (t + `(if (,inverted x y) nil t))))) + (deftransform >= ((x y) (number number) * :node node) "invert or open code" - (maybe-invert '> '< x y)) - (deftransform <= ((x y) (number number) *) + (maybe-invert node '> '< x y)) + (deftransform <= ((x y) (number number) * :node node) "invert or open code" - (maybe-invert '< '> x y))) + (maybe-invert node '< '> x y))) ;;; See whether we can statically determine (< X Y) using type ;;; information. If X's high bound is < Y's low, then X < Y. diff --git a/version.lisp-expr b/version.lisp-expr index 54d78eb..dda0012 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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.4.31" +"1.0.4.32"