From d2d79e977aa4c1476cfb4b2fbe6e5749e74e26fb Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 15 Apr 2005 16:08:52 +0000 Subject: [PATCH] 0.8.21.43: "oops" -- that wasn't an optimization! * don't transform EQL to EQ if either argument is known to be a fixnum, as we have backend magic to deal with that. The effect of the previous "improvement" was rather horrible for bignums. Still apply the transform if the fixnumness is in question. --- src/compiler/srctran.lisp | 24 +++++++++++++++--------- version.lisp-expr | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index 4b1f05a..5e76032 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3071,7 +3071,9 @@ ;;; -- If both args are characters, convert to CHAR=. This is better than ;;; just converting to EQ, since CHAR= may have special compilation ;;; strategies for non-standard representations, etc. -;;; -- If either arg is definitely not a number, or a fixnum, then we +;;; -- If either arg is definitely a fixnum we punt and let the backend +;;; deal with it. +;;; -- If either arg is definitely not a number or a fixnum, then we ;;; can compare with EQ. ;;; -- Otherwise, we try to put the arg we know more about second. If X ;;; is constant then we put it second. If X is a subtype of Y, we put @@ -3083,16 +3085,20 @@ (y-type (lvar-type y)) (char-type (specifier-type 'character))) (flet ((simple-type-p (type) - (csubtypep type (specifier-type '(or fixnum (not number)))))) + (csubtypep type (specifier-type '(or fixnum (not number))))) + (fixnum-type-p (type) + (csubtypep type (specifier-type 'fixnum)))) (cond - ((same-leaf-ref-p x y) t) - ((not (types-equal-or-intersect x-type y-type)) - nil) - ((and (csubtypep x-type char-type) - (csubtypep y-type char-type)) + ((same-leaf-ref-p x y) t) + ((not (types-equal-or-intersect x-type y-type)) + nil) + ((and (csubtypep x-type char-type) + (csubtypep y-type char-type)) '(char= x y)) - ((or (simple-type-p x-type) (simple-type-p y-type)) - '(eq x y)) + ((or (fixnum-type-p x-type) (fixnum-type-p y-type)) + (give-up-ir1-transform)) + ((or (simple-type-p x-type) (simple-type-p y-type)) + '(eq x y)) ((and (not (constant-lvar-p y)) (or (constant-lvar-p x) (and (csubtypep x-type y-type) diff --git a/version.lisp-expr b/version.lisp-expr index 6fbb56f..af26ab4 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".) -"0.8.21.42" +"0.8.21.43" -- 1.7.10.4