2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
[official-gcc.git] / gcc / params.h
blob296db6141f55ce07911016c282eee263b13b437a
1 /* params.h - Run-time parameters.
2 Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Written by Mark Mitchell <mark@codesourcery.com>.
5 This file is part of GCC.
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
9 Software Foundation; either version 2, or (at your option) any later
10 version.
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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA.
24 /* This module provides a means for setting integral parameters
25 dynamically. Instead of encoding magic numbers in various places,
26 use this module to organize all the magic numbers in a single
27 place. The values of the parameters can be set on the
28 command-line, thereby providing a way to control the amount of
29 effort spent on particular optimization passes, or otherwise tune
30 the behavior of the compiler.
32 Since their values can be set on the command-line, these parameters
33 should not be used for non-dynamic memory allocation. */
35 #ifndef GCC_PARAMS_H
36 #define GCC_PARAMS_H
38 /* No parameter shall have this value. */
40 #define INVALID_PARAM_VAL (-1)
42 /* The information associated with each parameter. */
44 typedef struct param_info
46 /* The name used with the `--param <name>=<value>' switch to set this
47 value. */
48 const char *const option;
49 /* The associated value. */
50 int value;
52 /* True if the parameter was explicitly set. */
53 bool set;
55 /* Minimum acceptable value. */
56 int min_value;
58 /* Maximum acceptable value, if greater than minimum */
59 int max_value;
61 /* A short description of the option. */
62 const char *const help;
63 } param_info;
65 /* An array containing the compiler parameters and their current
66 values. */
68 extern param_info *compiler_params;
70 /* Add the N PARAMS to the current list of compiler parameters. */
72 extern void add_params (const param_info params[], size_t n);
74 /* Set the VALUE associated with the parameter given by NAME. */
76 extern void set_param_value (const char *name, int value);
79 /* The parameters in use by language-independent code. */
81 typedef enum compiler_param
83 #define DEFPARAM(enumerator, option, msgid, default, min, max) \
84 enumerator,
85 #include "params.def"
86 #undef DEFPARAM
87 LAST_PARAM
88 } compiler_param;
90 /* The value of the parameter given by ENUM. */
91 #define PARAM_VALUE(ENUM) \
92 (compiler_params[(int) ENUM].value)
94 /* True if the value of the parameter was explicitly changed. */
95 #define PARAM_SET_P(ENUM) \
96 (compiler_params[(int) ENUM].set)
98 /* Macros for the various parameters. */
99 #define SALIAS_MAX_IMPLICIT_FIELDS \
100 PARAM_VALUE (PARAM_SALIAS_MAX_IMPLICIT_FIELDS)
101 #define SALIAS_MAX_ARRAY_ELEMENTS \
102 PARAM_VALUE (PARAM_SALIAS_MAX_ARRAY_ELEMENTS)
103 #define SRA_MAX_STRUCTURE_SIZE \
104 PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_SIZE)
105 #define SRA_MAX_STRUCTURE_COUNT \
106 PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_COUNT)
107 #define SRA_FIELD_STRUCTURE_RATIO \
108 PARAM_VALUE (PARAM_SRA_FIELD_STRUCTURE_RATIO)
109 #define MAX_INLINE_INSNS_SINGLE \
110 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SINGLE)
111 #define MAX_INLINE_INSNS \
112 PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
113 #define MAX_INLINE_SLOPE \
114 PARAM_VALUE (PARAM_MAX_INLINE_SLOPE)
115 #define MIN_INLINE_INSNS \
116 PARAM_VALUE (PARAM_MIN_INLINE_INSNS)
117 #define MAX_INLINE_INSNS_AUTO \
118 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO)
119 #define MAX_VARIABLE_EXPANSIONS \
120 PARAM_VALUE (PARAM_MAX_VARIABLE_EXPANSIONS)
121 #define MIN_VECT_LOOP_BOUND \
122 PARAM_VALUE (PARAM_MIN_VECT_LOOP_BOUND)
123 #define MAX_DELAY_SLOT_INSN_SEARCH \
124 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
125 #define MAX_DELAY_SLOT_LIVE_SEARCH \
126 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
127 #define MAX_PENDING_LIST_LENGTH \
128 PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH)
129 #define MAX_GCSE_MEMORY \
130 ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
131 #define MAX_GCSE_PASSES \
132 PARAM_VALUE (PARAM_MAX_GCSE_PASSES)
133 #define GCSE_AFTER_RELOAD_PARTIAL_FRACTION \
134 PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION)
135 #define GCSE_AFTER_RELOAD_CRITICAL_FRACTION \
136 PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION)
137 #define MAX_UNROLLED_INSNS \
138 PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS)
139 #define MAX_SMS_LOOP_NUMBER \
140 PARAM_VALUE (PARAM_MAX_SMS_LOOP_NUMBER)
141 #define SMS_MAX_II_FACTOR \
142 PARAM_VALUE (PARAM_SMS_MAX_II_FACTOR)
143 #define SMS_DFA_HISTORY \
144 PARAM_VALUE (PARAM_SMS_DFA_HISTORY)
145 #define SMS_LOOP_AVERAGE_COUNT_THRESHOLD \
146 PARAM_VALUE (PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD)
147 #define MAX_ALIASED_VOPS \
148 PARAM_VALUE (PARAM_MAX_ALIASED_VOPS)
149 #define INTEGER_SHARE_LIMIT \
150 PARAM_VALUE (PARAM_INTEGER_SHARE_LIMIT)
151 #define MAX_LAST_VALUE_RTL \
152 PARAM_VALUE (PARAM_MAX_LAST_VALUE_RTL)
153 #define MIN_VIRTUAL_MAPPINGS \
154 PARAM_VALUE (PARAM_MIN_VIRTUAL_MAPPINGS)
155 #define VIRTUAL_MAPPINGS_TO_SYMS_RATIO \
156 PARAM_VALUE (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO)
157 #define MAX_FIELDS_FOR_FIELD_SENSITIVE \
158 ((size_t) PARAM_VALUE (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE))
159 #define MAX_SCHED_READY_INSNS \
160 PARAM_VALUE (PARAM_MAX_SCHED_READY_INSNS)
161 #define PREFETCH_LATENCY \
162 PARAM_VALUE (PARAM_PREFETCH_LATENCY)
163 #define SIMULTANEOUS_PREFETCHES \
164 PARAM_VALUE (PARAM_SIMULTANEOUS_PREFETCHES)
165 #define L1_CACHE_SIZE \
166 PARAM_VALUE (PARAM_L1_CACHE_SIZE)
167 #define L1_CACHE_LINE_SIZE \
168 PARAM_VALUE (PARAM_L1_CACHE_LINE_SIZE)
169 #define VERIFY_CANONICAL_TYPES \
170 PARAM_VALUE (PARAM_VERIFY_CANONICAL_TYPES)
171 #endif /* ! GCC_PARAMS_H */