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