Commit 7dc69ba8 authored by Karsten Poeck's avatar Karsten Poeck
Browse files

Update clasp definition for optimisation settings

parent bdda53d7
...@@ -66,7 +66,7 @@ This can help you produce more deterministic output for FASLs.")) ...@@ -66,7 +66,7 @@ This can help you produce more deterministic output for FASLs."))
#+clozure '(ccl::*nx-speed* ccl::*nx-space* ccl::*nx-safety* #+clozure '(ccl::*nx-speed* ccl::*nx-space* ccl::*nx-safety*
ccl::*nx-debug* ccl::*nx-cspeed*) ccl::*nx-debug* ccl::*nx-cspeed*)
#+(or cmucl scl) '(c::*default-cookie*) #+(or cmucl scl) '(c::*default-cookie*)
#+clasp '() #+clasp nil
#+ecl (unless (use-ecl-byte-compiler-p) '(c::*speed* c::*space* c::*safety* c::*debug*)) #+ecl (unless (use-ecl-byte-compiler-p) '(c::*speed* c::*space* c::*safety* c::*debug*))
#+gcl '(compiler::*speed* compiler::*space* compiler::*compiler-new-safety* compiler::*debug*) #+gcl '(compiler::*speed* compiler::*space* compiler::*compiler-new-safety* compiler::*debug*)
#+lispworks '(compiler::*optimization-level*) #+lispworks '(compiler::*optimization-level*)
...@@ -77,7 +77,8 @@ This can help you produce more deterministic output for FASLs.")) ...@@ -77,7 +77,8 @@ This can help you produce more deterministic output for FASLs."))
#-(or abcl allegro clasp clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl) #-(or abcl allegro clasp clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl)
(warn "~S does not support ~S. Please help me fix that." (warn "~S does not support ~S. Please help me fix that."
'get-optimization-settings (implementation-type)) 'get-optimization-settings (implementation-type))
#+(or abcl allegro clasp clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl) #+clasp (cleavir-env:optimize (cleavir-env:optimize-info CLASP-CLEAVIR:*CLASP-ENV*))
#+(or abcl allegro clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl)
(let ((settings '(speed space safety debug compilation-speed #+(or cmucl scl) c::brevity))) (let ((settings '(speed space safety debug compilation-speed #+(or cmucl scl) c::brevity)))
#.`(loop #+(or allegro clozure) #.`(loop #+(or allegro clozure)
,@'(:with info = #+allegro (sys:declaration-information 'optimize) ,@'(:with info = #+allegro (sys:declaration-information 'optimize)
...@@ -86,7 +87,7 @@ This can help you produce more deterministic output for FASLs.")) ...@@ -86,7 +87,7 @@ This can help you produce more deterministic output for FASLs."))
,@(or #+(or abcl clasp ecl gcl mkcl xcl) '(:for v :in +optimization-variables+)) ,@(or #+(or abcl clasp ecl gcl mkcl xcl) '(:for v :in +optimization-variables+))
:for y = (or #+(or allegro clozure) (second (assoc x info)) ; normalize order :for y = (or #+(or allegro clozure) (second (assoc x info)) ; normalize order
#+clisp (gethash x system::*optimize* 1) #+clisp (gethash x system::*optimize* 1)
#+(or abcl clasp ecl mkcl xcl) (symbol-value v) #+(or abcl ecl mkcl xcl) (symbol-value v)
#+(or cmucl scl) (slot-value c::*default-cookie* #+(or cmucl scl) (slot-value c::*default-cookie*
(case x (compilation-speed 'c::cspeed) (case x (compilation-speed 'c::cspeed)
(otherwise x))) (otherwise x)))
...@@ -100,13 +101,15 @@ This can help you produce more deterministic output for FASLs.")) ...@@ -100,13 +101,15 @@ This can help you produce more deterministic output for FASLs."))
(unless (equal *previous-optimization-settings* settings) (unless (equal *previous-optimization-settings* settings)
(setf *previous-optimization-settings* settings)))) (setf *previous-optimization-settings* settings))))
(defmacro with-optimization-settings ((&optional (settings *optimization-settings*)) &body body) (defmacro with-optimization-settings ((&optional (settings *optimization-settings*)) &body body)
#+(or allegro clisp) #+(or allegro clasp clisp)
(let ((previous-settings (gensym "PREVIOUS-SETTINGS"))) (let ((previous-settings (gensym "PREVIOUS-SETTINGS"))
`(let ((,previous-settings (get-optimization-settings))) (reset-settings (gensym "RESET-SETTINGS")))
`(let* ((,previous-settings (get-optimization-settings))
(,reset-settings #+clasp (reverse ,previous-settings) #-clasp ,previous-settings))
,@(when settings `((proclaim `(optimize ,@,settings)))) ,@(when settings `((proclaim `(optimize ,@,settings))))
(unwind-protect (progn ,@body) (unwind-protect (progn ,@body)
(proclaim `(optimize ,@,previous-settings))))) (proclaim `(optimize ,@,reset-settings)))))
#-(or allegro clisp) #-(or allegro clasp clisp)
`(let ,(loop :for v :in +optimization-variables+ :collect `(,v ,v)) `(let ,(loop :for v :in +optimization-variables+ :collect `(,v ,v))
,@(when settings `((proclaim `(optimize ,@,settings)))) ,@(when settings `((proclaim `(optimize ,@,settings))))
,@body))) ,@body)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment