[e7b2c5]: src / compiler / policies.lisp Maximize Restore History

Download this file

policies.lisp    151 lines (126 with data), 5.3 kB

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