From: Paul Khuong Date: Mon, 20 May 2013 22:14:43 +0000 (-0400) Subject: Exploit specialised VOPs for EQL of anything/constant fixnum X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9ce27ba26f45c2d59e2f95b616bd5d8f3eaeffdc;p=sbcl.git Exploit specialised VOPs for EQL of anything/constant fixnum By swapping constant arguments to the right ourselves before strength reducing EQL into EQ, rather than erroneously using commutative-arg-swap. Spotted by Douglas Katzman. --- diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index d2b2246..0d22154 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3586,10 +3586,10 @@ ((and (csubtypep x-type char-type) (csubtypep y-type char-type)) '(char= x y)) - ((or (fixnum-type-p x-type) (fixnum-type-p y-type)) - (commutative-arg-swap node)) ((or (eq-comparable-type-p x-type) (eq-comparable-type-p y-type)) - '(eq x y)) + (if (and (constant-lvar-p x) (not (constant-lvar-p y))) + '(eq y x) + '(eq x y))) ((and (not (constant-lvar-p y)) (or (constant-lvar-p x) (and (csubtypep x-type y-type)