]>
Commit | Line | Data |
---|---|---|
c6d9a88c | 1 | /* params.h - Run-time parameters. |
9dcd6f09 | 2 | Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. |
c6d9a88c MM |
3 | Written by Mark Mitchell <mark@codesourcery.com>. |
4 | ||
1322177d | 5 | This file is part of GCC. |
c6d9a88c | 6 | |
1322177d LB |
7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
9dcd6f09 | 9 | Software Foundation; either version 3, or (at your option) any later |
1322177d | 10 | version. |
c6d9a88c | 11 | |
1322177d LB |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
c6d9a88c MM |
16 | |
17 | You should have received a copy of the GNU General Public License | |
9dcd6f09 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
c6d9a88c MM |
20 | |
21 | /* This module provides a means for setting integral parameters | |
22 | dynamically. Instead of encoding magic numbers in various places, | |
23 | use this module to organize all the magic numbers in a single | |
24 | place. The values of the parameters can be set on the | |
25 | command-line, thereby providing a way to control the amount of | |
26 | effort spent on particular optimization passes, or otherwise tune | |
0443f602 JO |
27 | the behavior of the compiler. |
28 | ||
29 | Since their values can be set on the command-line, these parameters | |
30 | should not be used for non-dynamic memory allocation. */ | |
c6d9a88c | 31 | |
88657302 RH |
32 | #ifndef GCC_PARAMS_H |
33 | #define GCC_PARAMS_H | |
c6d9a88c MM |
34 | |
35 | /* No parameter shall have this value. */ | |
36 | ||
37 | #define INVALID_PARAM_VAL (-1) | |
38 | ||
39 | /* The information associated with each parameter. */ | |
40 | ||
41 | typedef struct param_info | |
42 | { | |
43 | /* The name used with the `--param <name>=<value>' switch to set this | |
44 | value. */ | |
8b60264b | 45 | const char *const option; |
c6d9a88c MM |
46 | /* The associated value. */ |
47 | int value; | |
e06c0feb | 48 | |
47eb5b32 ZD |
49 | /* True if the parameter was explicitly set. */ |
50 | bool set; | |
51 | ||
e06c0feb NS |
52 | /* Minimum acceptable value. */ |
53 | int min_value; | |
54 | ||
35fd3193 | 55 | /* Maximum acceptable value, if greater than minimum */ |
e06c0feb NS |
56 | int max_value; |
57 | ||
1c4c47db | 58 | /* A short description of the option. */ |
8b60264b | 59 | const char *const help; |
c6d9a88c MM |
60 | } param_info; |
61 | ||
62 | /* An array containing the compiler parameters and their current | |
63 | values. */ | |
64 | ||
65 | extern param_info *compiler_params; | |
66 | ||
67 | /* Add the N PARAMS to the current list of compiler parameters. */ | |
68 | ||
3d7aafde | 69 | extern void add_params (const param_info params[], size_t n); |
c6d9a88c MM |
70 | |
71 | /* Set the VALUE associated with the parameter given by NAME. */ | |
72 | ||
3d7aafde | 73 | extern void set_param_value (const char *name, int value); |
c6d9a88c MM |
74 | |
75 | \f | |
76 | /* The parameters in use by language-independent code. */ | |
77 | ||
78 | typedef enum compiler_param | |
79 | { | |
e06c0feb | 80 | #define DEFPARAM(enumerator, option, msgid, default, min, max) \ |
bd571ffc | 81 | enumerator, |
c6d9a88c | 82 | #include "params.def" |
6a4d6760 | 83 | #undef DEFPARAM |
c6d9a88c MM |
84 | LAST_PARAM |
85 | } compiler_param; | |
86 | ||
87 | /* The value of the parameter given by ENUM. */ | |
88 | #define PARAM_VALUE(ENUM) \ | |
89 | (compiler_params[(int) ENUM].value) | |
6a4d6760 | 90 | |
47eb5b32 ZD |
91 | /* True if the value of the parameter was explicitly changed. */ |
92 | #define PARAM_SET_P(ENUM) \ | |
93 | (compiler_params[(int) ENUM].set) | |
94 | ||
c6d9a88c | 95 | /* Macros for the various parameters. */ |
31617ef1 DB |
96 | #define SALIAS_MAX_IMPLICIT_FIELDS \ |
97 | PARAM_VALUE (PARAM_SALIAS_MAX_IMPLICIT_FIELDS) | |
a916f21d RG |
98 | #define SALIAS_MAX_ARRAY_ELEMENTS \ |
99 | PARAM_VALUE (PARAM_SALIAS_MAX_ARRAY_ELEMENTS) | |
61b58001 BE |
100 | #define SRA_MAX_STRUCTURE_SIZE \ |
101 | PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_SIZE) | |
460f84ed RH |
102 | #define SRA_MAX_STRUCTURE_COUNT \ |
103 | PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_COUNT) | |
61b58001 BE |
104 | #define SRA_FIELD_STRUCTURE_RATIO \ |
105 | PARAM_VALUE (PARAM_SRA_FIELD_STRUCTURE_RATIO) | |
a6227154 KG |
106 | #define MAX_INLINE_INSNS_SINGLE \ |
107 | PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SINGLE) | |
c6d9a88c MM |
108 | #define MAX_INLINE_INSNS \ |
109 | PARAM_VALUE (PARAM_MAX_INLINE_INSNS) | |
a6227154 KG |
110 | #define MAX_INLINE_SLOPE \ |
111 | PARAM_VALUE (PARAM_MAX_INLINE_SLOPE) | |
112 | #define MIN_INLINE_INSNS \ | |
113 | PARAM_VALUE (PARAM_MIN_INLINE_INSNS) | |
bc522472 KG |
114 | #define MAX_INLINE_INSNS_AUTO \ |
115 | PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO) | |
f37a4f14 RE |
116 | #define MAX_VARIABLE_EXPANSIONS \ |
117 | PARAM_VALUE (PARAM_MAX_VARIABLE_EXPANSIONS) | |
acdc40df DN |
118 | #define MIN_VECT_LOOP_BOUND \ |
119 | PARAM_VALUE (PARAM_MIN_VECT_LOOP_BOUND) | |
0443f602 JO |
120 | #define MAX_DELAY_SLOT_INSN_SEARCH \ |
121 | PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH) | |
d5d063d7 JO |
122 | #define MAX_DELAY_SLOT_LIVE_SEARCH \ |
123 | PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH) | |
4a121cc3 AM |
124 | #define MAX_PENDING_LIST_LENGTH \ |
125 | PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH) | |
f1fa37ff MM |
126 | #define MAX_GCSE_MEMORY \ |
127 | ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY)) | |
740f35a0 DB |
128 | #define MAX_GCSE_PASSES \ |
129 | PARAM_VALUE (PARAM_MAX_GCSE_PASSES) | |
f9957958 MH |
130 | #define GCSE_AFTER_RELOAD_PARTIAL_FRACTION \ |
131 | PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION) | |
132 | #define GCSE_AFTER_RELOAD_CRITICAL_FRACTION \ | |
133 | PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION) | |
03e9dbc9 MM |
134 | #define MAX_UNROLLED_INSNS \ |
135 | PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS) | |
e5626198 AZ |
136 | #define MAX_SMS_LOOP_NUMBER \ |
137 | PARAM_VALUE (PARAM_MAX_SMS_LOOP_NUMBER) | |
138 | #define SMS_MAX_II_FACTOR \ | |
139 | PARAM_VALUE (PARAM_SMS_MAX_II_FACTOR) | |
140 | #define SMS_DFA_HISTORY \ | |
141 | PARAM_VALUE (PARAM_SMS_DFA_HISTORY) | |
142 | #define SMS_LOOP_AVERAGE_COUNT_THRESHOLD \ | |
143 | PARAM_VALUE (PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD) | |
6de9cd9a DN |
144 | #define MAX_ALIASED_VOPS \ |
145 | PARAM_VALUE (PARAM_MAX_ALIASED_VOPS) | |
e9e0aa2c DN |
146 | #define AVG_ALIASED_VOPS \ |
147 | PARAM_VALUE (PARAM_AVG_ALIASED_VOPS) | |
89b0433e NS |
148 | #define INTEGER_SHARE_LIMIT \ |
149 | PARAM_VALUE (PARAM_INTEGER_SHARE_LIMIT) | |
49c3b9a8 JJ |
150 | #define MAX_LAST_VALUE_RTL \ |
151 | PARAM_VALUE (PARAM_MAX_LAST_VALUE_RTL) | |
84d65814 DN |
152 | #define MIN_VIRTUAL_MAPPINGS \ |
153 | PARAM_VALUE (PARAM_MIN_VIRTUAL_MAPPINGS) | |
154 | #define VIRTUAL_MAPPINGS_TO_SYMS_RATIO \ | |
155 | PARAM_VALUE (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO) | |
98035a75 DB |
156 | #define MAX_FIELDS_FOR_FIELD_SENSITIVE \ |
157 | ((size_t) PARAM_VALUE (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE)) | |
6f8dd94b EB |
158 | #define MAX_SCHED_READY_INSNS \ |
159 | PARAM_VALUE (PARAM_MAX_SCHED_READY_INSNS) | |
47eb5b32 ZD |
160 | #define PREFETCH_LATENCY \ |
161 | PARAM_VALUE (PARAM_PREFETCH_LATENCY) | |
162 | #define SIMULTANEOUS_PREFETCHES \ | |
163 | PARAM_VALUE (PARAM_SIMULTANEOUS_PREFETCHES) | |
164 | #define L1_CACHE_SIZE \ | |
165 | PARAM_VALUE (PARAM_L1_CACHE_SIZE) | |
166 | #define L1_CACHE_LINE_SIZE \ | |
167 | PARAM_VALUE (PARAM_L1_CACHE_LINE_SIZE) | |
7313518b DG |
168 | #define USE_CANONICAL_TYPES \ |
169 | PARAM_VALUE (PARAM_USE_CANONICAL_TYPES) | |
88657302 | 170 | #endif /* ! GCC_PARAMS_H */ |