0.9.10.26
[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     (cond ((= safety 0) 0)
16           ;; FIXME: It is duplicated in PROBABLE-TYPE-CHECK-P and in
17           ;; some other places.
18           ((and (<= speed safety)
19                 (<= space safety)
20                 (<= compilation-speed safety))
21            3)
22           (t 2))
23   ("no" "maybe" "fast" "full"))
24
25 (define-optimization-quality check-tag-existence
26     (cond ((= safety 0) 0)
27           (t 3))
28   ("no" "maybe" "yes" "yes"))
29
30 (define-optimization-quality let-conversion
31     (if (<= debug speed) 3 0)
32   ("off" "maybe" "on" "on"))
33
34 (define-optimization-quality verify-arg-count
35     (if (zerop safety) 0 3)
36   ("no" "maybe" "yes" "yes"))
37
38 (define-optimization-quality merge-tail-calls
39     (if (or (> space debug)
40             (> speed debug))
41         3
42         0)
43   ("no" "maybe" "yes" "yes"))
44
45 (define-optimization-quality insert-debug-catch
46     (if (> debug (max speed space))
47         3
48         0)
49   ("no" "maybe" "yes" "yes"))
50
51 (define-optimization-quality recognize-self-calls
52     (if (> (max speed space) debug)
53         3
54         0)
55   ("no" "maybe" "yes" "yes"))
56
57 (define-optimization-quality stack-allocate-dynamic-extent
58     (if (and (> (max speed space) (max debug safety))
59              (< safety 3))
60         3
61         0)
62   ("no" "maybe" "yes" "yes"))
63
64 (define-optimization-quality stack-allocate-vector
65     (cond ((= stack-allocate-dynamic-extent 0) 0)
66           ((= safety 0) 3)
67           (t 2))
68   ("no" "maybe" "one page" "yes"))
69
70 (define-optimization-quality float-accuracy
71     3
72   ("degraded" "full" "full" "full"))
73
74 (define-optimization-quality insert-step-conditions
75     (if (> debug (max speed space compilation-speed))
76         debug
77         0)
78   ("no" "no" "partial" "full"))
79
80 (define-optimization-quality compute-debug-fun
81     debug
82   ("no" "minimal" "yes" "yes"))