Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / params.h
blob1f57a0f91a02ced313ac296e67ed4050647f97b9
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, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, 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 /* Minimum acceptable value. */
53 int min_value;
55 /* Maximum acceptable value, if greater than minimum */
56 int max_value;
58 /* A short description of the option. */
59 const char *const help;
60 } param_info;
62 /* An array containing the compiler parameters and their current
63 values. */
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) \
81 enumerator,
82 #include "params.def"
83 #undef DEFPARAM
84 LAST_PARAM
85 } compiler_param;
87 /* The value of the parameter given by ENUM. */
88 #define PARAM_VALUE(ENUM) \
89 (compiler_params[(int) ENUM].value)
91 /* Macros for the various parameters. */
92 #define SRA_MAX_STRUCTURE_SIZE \
93 PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_SIZE)
94 #define SRA_FIELD_STRUCTURE_RATIO \
95 PARAM_VALUE (PARAM_SRA_FIELD_STRUCTURE_RATIO)
96 #define MAX_INLINE_INSNS_SINGLE \
97 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SINGLE)
98 #define MAX_INLINE_INSNS \
99 PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
100 #define MAX_INLINE_SLOPE \
101 PARAM_VALUE (PARAM_MAX_INLINE_SLOPE)
102 #define MIN_INLINE_INSNS \
103 PARAM_VALUE (PARAM_MIN_INLINE_INSNS)
104 #define MAX_INLINE_INSNS_AUTO \
105 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO)
106 #define MAX_VARIABLE_EXPANSIONS \
107 PARAM_VALUE (PARAM_MAX_VARIABLE_EXPANSIONS)
108 #define MAX_DELAY_SLOT_INSN_SEARCH \
109 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
110 #define MAX_DELAY_SLOT_LIVE_SEARCH \
111 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
112 #define MAX_PENDING_LIST_LENGTH \
113 PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH)
114 #define MAX_GCSE_MEMORY \
115 ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
116 #define MAX_GCSE_PASSES \
117 PARAM_VALUE (PARAM_MAX_GCSE_PASSES)
118 #define GCSE_AFTER_RELOAD_PARTIAL_FRACTION \
119 PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION)
120 #define GCSE_AFTER_RELOAD_CRITICAL_FRACTION \
121 PARAM_VALUE (PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION)
122 #define MAX_UNROLLED_INSNS \
123 PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS)
124 #define MAX_SMS_LOOP_NUMBER \
125 PARAM_VALUE (PARAM_MAX_SMS_LOOP_NUMBER)
126 #define SMS_MAX_II_FACTOR \
127 PARAM_VALUE (PARAM_SMS_MAX_II_FACTOR)
128 #define SMS_DFA_HISTORY \
129 PARAM_VALUE (PARAM_SMS_DFA_HISTORY)
130 #define SMS_LOOP_AVERAGE_COUNT_THRESHOLD \
131 PARAM_VALUE (PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD)
132 #define GLOBAL_VAR_THRESHOLD \
133 PARAM_VALUE (PARAM_GLOBAL_VAR_THRESHOLD)
134 #define MAX_ALIASED_VOPS \
135 PARAM_VALUE (PARAM_MAX_ALIASED_VOPS)
136 #define INTEGER_SHARE_LIMIT \
137 PARAM_VALUE (PARAM_INTEGER_SHARE_LIMIT)
138 #define MAX_LAST_VALUE_RTL \
139 PARAM_VALUE (PARAM_MAX_LAST_VALUE_RTL)
140 #endif /* ! GCC_PARAMS_H */