1 ;;;; aimed optimization qualities
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
14 (define-optimization-quality check-constant-modification
16 ("no" "maybe" "yes" "yes")
17 "Control whether the compiler should check for constant
18 modification. Defaults to SAFETY.")
20 (define-optimization-quality type-check
21 ;; FIXME: grepping the tree for "policy.*safety" yields some
22 ;; places which might want to use this instead -- or
23 ;; some other derived policy.
24 (cond ((= safety 0) 0)
25 ((and (< safety 2) (< safety speed)) 2)
27 ("no" "maybe" "weak" "full")
28 "Control the way to perform runtime type checking:
29 0: declared types are simply trusted; no runtime checks are performed;
30 2: fast checks are performed: declared types are weakened to
31 FIXNUM/SINGLE-FLOAT/FLOAT/NUMBER/structure/specialized array etc.;
32 3: declared types are fully checked (several exceptions exist;
33 see \"SBCL User Manual\", Compiler->Handling of Types->
34 Implementation Limitations for details).")
36 (define-optimization-quality check-tag-existence
37 (cond ((= safety 0) 0)
39 ("no" "maybe" "yes" "yes")
40 "Control whether GO and RETURN-FROM check liveness of the destination tag.
41 Enabling this option can increase heap consing of closures.")
43 (define-optimization-quality let-conversion
44 (if (<= debug speed) 3 0)
45 ("off" "maybe" "on" "on")
46 "Control inline-substitution of used-once local functions.")
48 (define-optimization-quality rest-conversion
50 ("off" "maybe" "on" "on")
51 "Control conversion of &REST argments to &MORE arguments when
52 only used as the final argument to APPLY.")
54 (define-optimization-quality alien-funcall-saves-fp-and-pc
55 (if (<= speed debug) 3 0)
56 ("no" "maybe" "yes" "yes")
57 "Control ALIEN-FUNCALL saving frame-pointer and program counter for
58 more reliable bactracing across foreign calls.")
60 (define-optimization-quality verify-arg-count
61 (if (zerop safety) 0 3)
62 ("no" "maybe" "yes" "yes"))
64 (define-optimization-quality merge-tail-calls
66 "Deprecated: has no effect on compiled code. (Never really did.)")
68 (define-optimization-quality insert-debug-catch
69 (if (> debug (max speed space))
72 ("no" "maybe" "yes" "yes")
73 "Enables possibility of returning from stack frames with the debugger.
74 Enabling this option causes apparent tail calls to no longer be in a tail
75 position -- effectively disabling tail-merging, hence causing apparently tail
76 recursive functions to no longer execute in constant stack space")
78 (define-optimization-quality recognize-self-calls
79 (if (> (max speed space) debug)
82 ("no" "maybe" "yes" "yes")
83 "When enabled, reference to a function FOO inside the body of (DEFUN
84 FOO ...) is considered to be the reference to the function being
85 defined. Calls to FOO are compiled as local. This allows better
86 optimization and type checking, but TRACE will not show recursive
87 calls. If the function object is bound to another name BAR, and FOO is
88 bound to another function, calls to FOO inside BAR will remain to be
91 When disabled, internal references to a function FOO will be
92 considered ti be a call of a function, bound to the symbol at
93 run-time, which is less efficient. TRACE will show recursive calls. In
94 case of renaming described above, calls to FOO will not be recursive
95 and will refer to the new function, bound to FOO.")
97 (define-optimization-quality float-accuracy
99 ("degraded" "full" "full" "full"))
101 (define-optimization-quality insert-step-conditions
102 (if (> debug (max speed space compilation-speed))
105 ("no" "no" "partial" "full")
106 "Control instrumentation of code, enabling single-stepping through
109 This option has no effect without COMPUTE-DEBUG-FUN.")
111 (define-optimization-quality compute-debug-fun
113 ("no" "minimal" "yes" "yes"))
115 (define-optimization-quality preserve-single-use-debug-variables
116 (if (and (>= debug 2)
120 ("no" "no" "no" "yes")
121 "When disabled, LET variable, which is never set and is referenced
122 exactly once, is eliminated and the reference is substituted with the
123 initial value. This allows better type inference and some algebraic
126 When enabled, the variable is preserved and can be seen in the
129 (define-optimization-quality insert-array-bounds-checks
130 (if (= safety 0) 0 3)
131 ("no" "yes" "yes" "yes"))
133 (define-optimization-quality store-xref-data
137 ("no" "yes" "yes" "yes"))
139 (define-optimization-quality store-coverage-data
141 ("no" "no" "yes" "yes"))