From: Christophe R. <cr...@us...> - 2003-06-07 11:02:01
|
Update of /cvsroot/sbcl/sbcl/src/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv4777/src/compiler Modified Files: array-tran.lisp Log Message: 0.8.0.42: Quieten the compiler slightly for (LENGTH <VECTOR>) ... one of the transforms wants to constant-fold the above when <VECTOR> is a 1d SIMPLE-ARRAY of known dimensions. However, the deftransform definition (with a simple-array type requirement) caused the compiler to complain when the argument was known to be a vector but not a simple-array. Instead, leave the type requirement for the transform open, and GIVE-UP-IR1-TRANSFORM (with no arguments => silence) if the argument isn't simple. ... write some tests for LENGTH on vectors Index: array-tran.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/array-tran.lisp,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- array-tran.lisp 26 May 2003 14:42:24 -0000 1.46 +++ array-tran.lisp 7 Jun 2003 11:01:58 -0000 1.47 @@ -509,9 +509,10 @@ ;;; If a simple array with known dimensions, then VECTOR-LENGTH is a ;;; compile-time constant. -(deftransform vector-length ((vector) ((simple-array * (*)))) +(deftransform vector-length ((vector)) (let ((vtype (continuation-type vector))) - (if (array-type-p vtype) + (if (and (array-type-p vtype) + (not (array-type-complexp vtype))) (let ((dim (first (array-type-dimensions vtype)))) (when (eq dim '*) (give-up-ir1-transform)) dim) |