From f211093b67b163fcd82f6f4a4cea32d8f8063bb3 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Tue, 6 Feb 2007 08:11:17 +0000 Subject: [PATCH] 1.0.2.17: Bypass the hairy AREF transform for simple arrays * To improve compilation speed for array-heavy code --- src/compiler/array-tran.lisp | 16 ++++++++++++++-- version.lisp-expr | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/compiler/array-tran.lisp b/src/compiler/array-tran.lisp index 05df30b..ffc9dda 100644 --- a/src/compiler/array-tran.lisp +++ b/src/compiler/array-tran.lisp @@ -209,8 +209,7 @@ ,@(mapcar (lambda (el) (once-only ((n-val el)) `(locally (declare (optimize (safety 0))) - (setf (svref ,n-vec ,(incf n)) - ,n-val)))) + (setf (svref ,n-vec ,(incf n)) ,n-val)))) elements) ,n-vec)))) @@ -748,11 +747,24 @@ (deftransform aref ((array &rest indices)) (with-row-major-index (array indices index) (hairy-data-vector-ref array index))) + (deftransform %aset ((array &rest stuff)) (let ((indices (butlast stuff))) (with-row-major-index (array indices index new-value) (hairy-data-vector-set array index new-value))))) +(deftransform aref ((array index) ((or simple-vector + simple-unboxed-array) + index)) + (let ((type (lvar-type array))) + (unless (array-type-p type) + ;; Not an exactly specified one-dimensional simple array -> punt + ;; to the complex version. + (give-up-ir1-transform))) + `(data-vector-ref array (%check-bound array + (array-dimension array 0) + index))) + ;;; Just convert into a HAIRY-DATA-VECTOR-REF (or ;;; HAIRY-DATA-VECTOR-SET) after checking that the index is inside the ;;; array total size. diff --git a/version.lisp-expr b/version.lisp-expr index 0338ba1..f189318 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.2.16" +"1.0.2.17" -- 1.7.10.4