From aa2dc08707a56c954ba827b2344f48d6f76879c1 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 30 Jul 2009 11:37:12 +0000 Subject: [PATCH] 1.0.30.19: optimize (COERCE X 'VECTOR) as well --- NEWS | 2 +- src/compiler/typetran.lisp | 5 +++++ version.lisp-expr | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 9ee33af..3071cb2 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,7 @@ changes relative to sbcl-1.0.30: * new feature: experimental :EMIT-CFASL parameter to COMPILE-FILE can be used to output toplevel compile-time effects into a separate .CFASL file. - * optimization: COERCE to STRING, SIMPLE-STRING and recognizable + * optimization: COERCE to VECTOR, STRING, SIMPLE-STRING and recognizable one-dimenstional subtypes of ARRAY is upto 70% faster when the coercion is actually needed. * optimization: division of floating point numbers by constants uses diff --git a/src/compiler/typetran.lisp b/src/compiler/typetran.lisp index eb23711..06d7b07 100644 --- a/src/compiler/typetran.lisp +++ b/src/compiler/typetran.lisp @@ -621,6 +621,11 @@ `(if (typep x ',tval) x (replace (make-array (length x) :element-type 'character) x))) + ;; Special case VECTOR + ((eq tval 'vector) + `(if (vectorp x) + x + (replace (make-array (length x)) x))) ;; Handle specialized element types for 1D arrays. ((csubtypep tspec (specifier-type '(array * (*)))) ;; Can we avoid checking for dimension issues like (COERCE FOO diff --git a/version.lisp-expr b/version.lisp-expr index ff6c301..41de5f1 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.30.18" +"1.0.30.19" -- 1.7.10.4