1 /* params.h - Run-time parameters.
2 Copyright (C) 2001, 2003, 2004, 2005, 2007 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 3, or (at your option) any later
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
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
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
27 the behavior of the compiler.
29 Since their values can be set on the command-line, these parameters
30 should not be used for non-dynamic memory allocation. */
35 /* No parameter shall have this value. */
37 #define INVALID_PARAM_VAL (-1)
39 /* The information associated with each parameter. */
41 typedef struct param_info
43 /* The name used with the `--param <name>=<value>' switch to set this
45 const char *const option
;
46 /* The associated value. */
49 /* True if the parameter was explicitly set. */
52 /* Minimum acceptable value. */
55 /* Maximum acceptable value, if greater than minimum */
58 /* A short description of the option. */
59 const char *const help
;
62 /* An array containing the compiler parameters and their current
65 extern param_info
*compiler_params
;
67 /* Add the N PARAMS to the current list of compiler parameters. */
69 extern void add_params (const param_info params
[], size_t n
);
71 /* Set the VALUE associated with the parameter given by NAME. */
73 extern void set_param_value (const char *name
, int value
);
76 /* The parameters in use by language-independent code. */
78 typedef enum compiler_param
80 #define DEFPARAM(enumerator, option, msgid, default, min, max) \
87 /* The value of the parameter given by ENUM. */
88 #define PARAM_VALUE(ENUM) \
89 (compiler_params[(int) ENUM].value)
91 /* True if the value of the parameter was explicitly changed. */
92 #define PARAM_SET_P(ENUM) \
93 (compiler_params[(int) ENUM].set)
95 /* Macros for the various parameters. */
96 #define SRA_MAX_STRUCTURE_SIZE \
97 PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_SIZE)
98 #define SRA_MAX_STRUCTURE_COUNT \
99 PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_COUNT)
100 #define SRA_FIELD_STRUCTURE_RATIO \
101 PARAM_VALUE (PARAM_SRA_FIELD_STRUCTURE_RATIO)
102 #define STRUCT_REORG_COLD_STRUCT_RATIO \
103 PARAM_VALUE (PARAM_STRUCT_REORG_COLD_STRUCT_RATIO)
104 #define MAX_INLINE_INSNS_SINGLE \
105 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SINGLE)
106 #define MAX_INLINE_INSNS \
107 PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
108 #define MAX_INLINE_SLOPE \
109 PARAM_VALUE (PARAM_MAX_INLINE_SLOPE)
110 #define MIN_INLINE_INSNS \
111 PARAM_VALUE (PARAM_MIN_INLINE_INSNS)
112 #define MAX_INLINE_INSNS_AUTO \
113 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO)
114 #define MAX_VARIABLE_EXPANSIONS \
115 PARAM_VALUE (PARAM_MAX_VARIABLE_EXPANSIONS)
116 #define MIN_VECT_LOOP_BOUND \
117 PARAM_VALUE (PARAM_MIN_VECT_LOOP_BOUND)
118 #define MAX_DELAY_SLOT_INSN_SEARCH \
119 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
120 #define MAX_DELAY_SLOT_LIVE_SEARCH \
121 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
122 #define MAX_PENDING_LIST_LENGTH \
123 PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH)
124 #define MAX_GCSE_MEMORY \
125 ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
126 #define MAX_GCSE_PASSES \
127 PARAM_VALUE (PARAM_MAX_GCSE_PASSES)
128 #define GCSE_AFTER_RELOAD_PARTIAL_FRACTION \
129 PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION)
130 #define GCSE_AFTER_RELOAD_CRITICAL_FRACTION \
131 PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION)
132 #define MAX_UNROLLED_INSNS \
133 PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS)
134 #define MAX_SMS_LOOP_NUMBER \
135 PARAM_VALUE (PARAM_MAX_SMS_LOOP_NUMBER)
136 #define SMS_MAX_II_FACTOR \
137 PARAM_VALUE (PARAM_SMS_MAX_II_FACTOR)
138 #define SMS_DFA_HISTORY \
139 PARAM_VALUE (PARAM_SMS_DFA_HISTORY)
140 #define SMS_LOOP_AVERAGE_COUNT_THRESHOLD \
141 PARAM_VALUE (PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD)
142 #define MAX_ALIASED_VOPS \
143 PARAM_VALUE (PARAM_MAX_ALIASED_VOPS)
144 #define AVG_ALIASED_VOPS \
145 PARAM_VALUE (PARAM_AVG_ALIASED_VOPS)
146 #define INTEGER_SHARE_LIMIT \
147 PARAM_VALUE (PARAM_INTEGER_SHARE_LIMIT)
148 #define MAX_LAST_VALUE_RTL \
149 PARAM_VALUE (PARAM_MAX_LAST_VALUE_RTL)
150 #define MIN_VIRTUAL_MAPPINGS \
151 PARAM_VALUE (PARAM_MIN_VIRTUAL_MAPPINGS)
152 #define VIRTUAL_MAPPINGS_TO_SYMS_RATIO \
153 PARAM_VALUE (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO)
154 #define MAX_FIELDS_FOR_FIELD_SENSITIVE \
155 ((size_t) PARAM_VALUE (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE))
156 #define MAX_SCHED_READY_INSNS \
157 PARAM_VALUE (PARAM_MAX_SCHED_READY_INSNS)
158 #define PREFETCH_LATENCY \
159 PARAM_VALUE (PARAM_PREFETCH_LATENCY)
160 #define SIMULTANEOUS_PREFETCHES \
161 PARAM_VALUE (PARAM_SIMULTANEOUS_PREFETCHES)
162 #define L1_CACHE_SIZE \
163 PARAM_VALUE (PARAM_L1_CACHE_SIZE)
164 #define L1_CACHE_LINE_SIZE \
165 PARAM_VALUE (PARAM_L1_CACHE_LINE_SIZE)
166 #define L2_CACHE_SIZE \
167 PARAM_VALUE (PARAM_L2_CACHE_SIZE)
168 #define USE_CANONICAL_TYPES \
169 PARAM_VALUE (PARAM_USE_CANONICAL_TYPES)
170 #define IRA_MAX_LOOPS_NUM \
171 PARAM_VALUE (PARAM_IRA_MAX_LOOPS_NUM)
172 #define IRA_MAX_CONFLICT_TABLE_SIZE \
173 PARAM_VALUE (PARAM_IRA_MAX_CONFLICT_TABLE_SIZE)
174 #define SWITCH_CONVERSION_BRANCH_RATIO \
175 PARAM_VALUE (PARAM_SWITCH_CONVERSION_BRANCH_RATIO)
176 #endif /* ! GCC_PARAMS_H */