1.0.13.20: added SB-EXT:*EXIT-HOOKS*
[sbcl.git] / src / compiler / policies.lisp
1 ;;;; aimed optimization qualities
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
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.
11
12 (in-package "SB!C")
13
14 (define-optimization-quality type-check
15     ;; FIXME: grepping the tree for "policy.*safety" yields some
16     ;; places which might want to use this instead -- or
17     ;; some other derived policy.
18     (cond ((= safety 0) 0)
19           ((and (< safety 2) (< safety speed)) 2)
20           (t 3))
21   ("no" "maybe" "weak" "full"))
22
23 (define-optimization-quality check-tag-existence
24     (cond ((= safety 0) 0)
25           (t 3))
26   ("no" "maybe" "yes" "yes"))
27
28 (define-optimization-quality let-conversion
29     (if (<= debug speed) 3 0)
30   ("off" "maybe" "on" "on"))
31
32 (define-optimization-quality verify-arg-count
33     (if (zerop safety) 0 3)
34   ("no" "maybe" "yes" "yes"))
35
36 (define-optimization-quality merge-tail-calls
37     (if (or (> space debug)
38             (> speed debug))
39         3
40         0)
41   ("no" "maybe" "yes" "yes"))
42
43 (define-optimization-quality insert-debug-catch
44     (if (> debug (max speed space))
45         3
46         0)
47   ("no" "maybe" "yes" "yes"))
48
49 (define-optimization-quality recognize-self-calls
50     (if (> (max speed space) debug)
51         3
52         0)
53   ("no" "maybe" "yes" "yes"))
54
55 (define-optimization-quality stack-allocate-dynamic-extent
56     (if (and (> (max speed space) (max debug safety))
57              (< safety 3))
58         3
59         0)
60   ("no" "maybe" "yes" "yes"))
61
62 (define-optimization-quality stack-allocate-vector
63     (cond ((= stack-allocate-dynamic-extent 0) 0)
64           ((= safety 0) 3)
65           (t 2))
66   ("no" "maybe" "one page" "yes"))
67
68 (define-optimization-quality float-accuracy
69     3
70   ("degraded" "full" "full" "full"))
71
72 (define-optimization-quality insert-step-conditions
73     (if (> debug (max speed space compilation-speed))
74         debug
75         0)
76   ("no" "no" "partial" "full"))
77
78 (define-optimization-quality compute-debug-fun
79     debug
80   ("no" "minimal" "yes" "yes"))
81
82 (define-optimization-quality preserve-single-use-debug-variables
83     (if (and (>= debug 2)
84              (< speed 3))
85         3
86         0)
87   ("no" "no" "no" "yes"))
88
89 (define-optimization-quality insert-array-bounds-checks
90     (if (= safety 0) 0 3)
91   ("no" "yes" "yes" "yes"))
92
93 (define-optimization-quality store-xref-data
94     (if (= space 3)
95         0
96         3)
97   ("no" "yes" "yes" "yes"))
98
99 (define-optimization-quality store-coverage-data
100     0
101   ("no" "no" "yes" "yes"))