comparison gcc/ipa-prop.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Interprocedural analyses. 1 /* Interprocedural analyses.
2 Copyright (C) 2005, 2007, 2008, 2009, 2010 2 Copyright (C) 2005-2017 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 3
5 This file is part of GCC. 4 This file is part of GCC.
6 5
7 GCC is free software; you can redistribute it and/or modify it under 6 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 7 the terms of the GNU General Public License as published by the Free
19 <http://www.gnu.org/licenses/>. */ 18 <http://www.gnu.org/licenses/>. */
20 19
21 #ifndef IPA_PROP_H 20 #ifndef IPA_PROP_H
22 #define IPA_PROP_H 21 #define IPA_PROP_H
23 22
24 #include "tree.h"
25 #include "vec.h"
26 #include "cgraph.h"
27 #include "gimple.h"
28
29 /* The following definitions and interfaces are used by 23 /* The following definitions and interfaces are used by
30 interprocedural analyses or parameters. */ 24 interprocedural analyses or parameters. */
31 25
26 #define IPA_UNDESCRIBED_USE -1
27
32 /* ipa-prop.c stuff (ipa-cp, indirect inlining): */ 28 /* ipa-prop.c stuff (ipa-cp, indirect inlining): */
33 29
34 /* A jump function for a callsite represents the values passed as actual 30 /* A jump function for a callsite represents the values passed as actual
35 arguments of the callsite. There are three main types of values : 31 arguments of the callsite. They were originally proposed in a paper called
32 "Interprocedural Constant Propagation", by David Callahan, Keith D Cooper,
33 Ken Kennedy, Linda Torczon in Comp86, pg 152-161. There are three main
34 types of values :
36 35
37 Pass-through - the caller's formal parameter is passed as an actual 36 Pass-through - the caller's formal parameter is passed as an actual
38 argument, possibly one simple operation performed on it. 37 argument, possibly one simple operation performed on it.
39 Constant - a constant (is_gimple_ip_invariant)is passed as an actual 38 Constant - a constant (is_gimple_ip_invariant)is passed as an actual
40 argument. 39 argument.
41 Unknown - neither of the above. 40 Unknown - neither of the above.
42 41
43 IPA_JF_CONST_MEMBER_PTR stands for C++ member pointers, it is a special
44 constant in this regard. Other constants are represented with IPA_JF_CONST.
45
46 IPA_JF_ANCESTOR is a special pass-through jump function, which means that 42 IPA_JF_ANCESTOR is a special pass-through jump function, which means that
47 the result is an address of a part of the object pointed to by the formal 43 the result is an address of a part of the object pointed to by the formal
48 parameter to which the function refers. It is mainly intended to represent 44 parameter to which the function refers. It is mainly intended to represent
49 getting addresses of of ancestor fields in C++ 45 getting addresses of ancestor fields in C++
50 (e.g. &this_1(D)->D.1766.D.1756). Note that if the original pointer is 46 (e.g. &this_1(D)->D.1766.D.1756). Note that if the original pointer is
51 NULL, ancestor jump function must behave like a simple pass-through. 47 NULL, ancestor jump function must behave like a simple pass-through.
52 48
53 Other pass-through functions can either simply pass on an unchanged formal 49 Other pass-through functions can either simply pass on an unchanged formal
54 parameter or can apply one simple binary operation to it (such jump 50 parameter or can apply one simple binary operation to it (such jump
55 functions are called polynomial). 51 functions are called polynomial).
56
57 IPA_JF_KNOWN_TYPE is a special type of an "unknown" function that applies
58 only to pointer parameters. It means that even though we cannot prove that
59 the passed value is an interprocedural constant, we still know the exact
60 type of the containing object which may be valuable for devirtualization.
61 52
62 Jump functions are computed in ipa-prop.c by function 53 Jump functions are computed in ipa-prop.c by function
63 update_call_notes_after_inlining. Some information can be lost and jump 54 update_call_notes_after_inlining. Some information can be lost and jump
64 functions degraded accordingly when inlining, see 55 functions degraded accordingly when inlining, see
65 update_call_notes_after_inlining in the same file. */ 56 update_call_notes_after_inlining in the same file. */
66 57
67 enum jump_func_type 58 enum jump_func_type
68 { 59 {
69 IPA_JF_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */ 60 IPA_JF_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
70 IPA_JF_KNOWN_TYPE, /* represented by field base_binfo */
71 IPA_JF_CONST, /* represented by field costant */ 61 IPA_JF_CONST, /* represented by field costant */
72 IPA_JF_CONST_MEMBER_PTR, /* represented by field member_cst */
73 IPA_JF_PASS_THROUGH, /* represented by field pass_through */ 62 IPA_JF_PASS_THROUGH, /* represented by field pass_through */
74 IPA_JF_ANCESTOR /* represented by field ancestor */ 63 IPA_JF_ANCESTOR /* represented by field ancestor */
64 };
65
66 struct ipa_cst_ref_desc;
67
68 /* Structure holding data required to describe a constant jump function. */
69 struct GTY(()) ipa_constant_data
70 {
71 /* THe value of the constant. */
72 tree value;
73 /* Pointer to the structure that describes the reference. */
74 struct ipa_cst_ref_desc GTY((skip)) *rdesc;
75 }; 75 };
76 76
77 /* Structure holding data required to describe a pass-through jump function. */ 77 /* Structure holding data required to describe a pass-through jump function. */
78 78
79 struct GTY(()) ipa_pass_through_data 79 struct GTY(()) ipa_pass_through_data
86 /* Operation that is performed on the argument before it is passed on. 86 /* Operation that is performed on the argument before it is passed on.
87 NOP_EXPR means no operation. Otherwise oper must be a simple binary 87 NOP_EXPR means no operation. Otherwise oper must be a simple binary
88 arithmetic operation where the caller's parameter is the first operand and 88 arithmetic operation where the caller's parameter is the first operand and
89 operand field from this structure is the second one. */ 89 operand field from this structure is the second one. */
90 enum tree_code operation; 90 enum tree_code operation;
91 /* When the passed value is a pointer, it is set to true only when we are
92 certain that no write to the object it points to has occurred since the
93 caller functions started execution, except for changes noted in the
94 aggregate part of the jump function (see description of
95 ipa_agg_jump_function). The flag is used only when the operation is
96 NOP_EXPR. */
97 unsigned agg_preserved : 1;
91 }; 98 };
92 99
93 /* Structure holding data required to describe an ancestor pass-through 100 /* Structure holding data required to describe an ancestor pass-through
94 jump function. */ 101 jump function. */
95 102
96 struct GTY(()) ipa_ancestor_jf_data 103 struct GTY(()) ipa_ancestor_jf_data
97 { 104 {
98 /* Offset of the field representing the ancestor. */ 105 /* Offset of the field representing the ancestor. */
99 HOST_WIDE_INT offset; 106 HOST_WIDE_INT offset;
100 /* TYpe of the result. */
101 tree type;
102 /* Number of the caller's formal parameter being passed. */ 107 /* Number of the caller's formal parameter being passed. */
103 int formal_id; 108 int formal_id;
104 }; 109 /* Flag with the same meaning like agg_preserve in ipa_pass_through_data. */
105 110 unsigned agg_preserved : 1;
106 /* Structure holding a C++ member pointer constant. Holds a pointer to the 111 };
107 method and delta offset. */ 112
108 struct GTY(()) ipa_member_ptr_cst 113 /* An element in an aggegate part of a jump function describing a known value
109 { 114 at a given offset. When it is part of a pass-through jump function with
110 tree pfn; 115 agg_preserved set or an ancestor jump function with agg_preserved set, all
111 tree delta; 116 unlisted positions are assumed to be preserved but the value can be a type
117 node, which means that the particular piece (starting at offset and having
118 the size of the type) is clobbered with an unknown value. When
119 agg_preserved is false or the type of the containing jump function is
120 different, all unlisted parts are assumed to be unknown and all values must
121 fulfill is_gimple_ip_invariant. */
122
123 struct GTY(()) ipa_agg_jf_item
124 {
125 /* The offset at which the known value is located within the aggregate. */
126 HOST_WIDE_INT offset;
127
128 /* The known constant or type if this is a clobber. */
129 tree value;
130 };
131
132
133 /* Aggregate jump function - i.e. description of contents of aggregates passed
134 either by reference or value. */
135
136 struct GTY(()) ipa_agg_jump_function
137 {
138 /* Description of the individual items. */
139 vec<ipa_agg_jf_item, va_gc> *items;
140 /* True if the data was passed by reference (as opposed to by value). */
141 bool by_ref;
142 };
143
144 typedef struct ipa_agg_jump_function *ipa_agg_jump_function_p;
145
146 /* Information about zero/non-zero bits. */
147 struct GTY(()) ipa_bits
148 {
149 /* The propagated value. */
150 widest_int value;
151 /* Mask corresponding to the value.
152 Similar to ccp_lattice_t, if xth bit of mask is 0,
153 implies xth bit of value is constant. */
154 widest_int mask;
155 };
156
157 /* Info about value ranges. */
158
159 struct GTY(()) ipa_vr
160 {
161 /* The data fields below are valid only if known is true. */
162 bool known;
163 enum value_range_type type;
164 wide_int min;
165 wide_int max;
112 }; 166 };
113 167
114 /* A jump function for a callsite represents the values passed as actual 168 /* A jump function for a callsite represents the values passed as actual
115 arguments of the callsite. See enum jump_func_type for the various 169 arguments of the callsite. See enum jump_func_type for the various
116 types of jump functions supported. */ 170 types of jump functions supported. */
117 struct GTY (()) ipa_jump_func 171 struct GTY (()) ipa_jump_func
118 { 172 {
173 /* Aggregate contants description. See struct ipa_agg_jump_function and its
174 description. */
175 struct ipa_agg_jump_function agg;
176
177 /* Information about zero/non-zero bits. The pointed to structure is shared
178 betweed different jump functions. Use ipa_set_jfunc_bits to set this
179 field. */
180 struct ipa_bits *bits;
181
182 /* Information about value range, containing valid data only when vr_known is
183 true. The pointed to structure is shared betweed different jump
184 functions. Use ipa_set_jfunc_vr to set this field. */
185 struct value_range *m_vr;
186
119 enum jump_func_type type; 187 enum jump_func_type type;
120 /* Represents a value of a jump function. pass_through is used only in jump 188 /* Represents a value of a jump function. pass_through is used only in jump
121 function context. constant represents the actual constant in constant jump 189 function context. constant represents the actual constant in constant jump
122 functions and member_cst holds constant c++ member functions. */ 190 functions and member_cst holds constant c++ member functions. */
123 union jump_func_value 191 union jump_func_value
124 { 192 {
125 tree GTY ((tag ("IPA_JF_KNOWN_TYPE"))) base_binfo; 193 struct ipa_constant_data GTY ((tag ("IPA_JF_CONST"))) constant;
126 tree GTY ((tag ("IPA_JF_CONST"))) constant;
127 struct ipa_member_ptr_cst GTY ((tag ("IPA_JF_CONST_MEMBER_PTR"))) member_cst;
128 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through; 194 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
129 struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor; 195 struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
130 } GTY ((desc ("%1.type"))) value; 196 } GTY ((desc ("%1.type"))) value;
131 }; 197 };
132 198
133 /* All formal parameters in the program have a lattice associated with it 199
134 computed by the interprocedural stage of IPCP. 200 /* Return the constant stored in a constant jump functin JFUNC. */
135 There are three main values of the lattice: 201
136 IPA_TOP - unknown, 202 static inline tree
137 IPA_BOTTOM - variable, 203 ipa_get_jf_constant (struct ipa_jump_func *jfunc)
138 IPA_CONST_VALUE - simple scalar constant, 204 {
139 205 gcc_checking_assert (jfunc->type == IPA_JF_CONST);
140 We also use this type to propagate types accross the call graph for the 206 return jfunc->value.constant.value;
141 purpose of devirtualization. In that case, IPA_CONST_VALUE denotes a known 207 }
142 type, rather than a constant. */ 208
143 enum ipa_lattice_type 209 static inline struct ipa_cst_ref_desc *
144 { 210 ipa_get_jf_constant_rdesc (struct ipa_jump_func *jfunc)
145 IPA_BOTTOM, 211 {
146 IPA_CONST_VALUE, 212 gcc_checking_assert (jfunc->type == IPA_JF_CONST);
147 IPA_TOP 213 return jfunc->value.constant.rdesc;
148 }; 214 }
149 215
150 /* All formal parameters in the program have a cval computed by 216 /* Return the operand of a pass through jmp function JFUNC. */
151 the interprocedural stage of IPCP. See enum ipa_lattice_type for 217
152 the various types of lattices supported */ 218 static inline tree
153 struct ipcp_lattice 219 ipa_get_jf_pass_through_operand (struct ipa_jump_func *jfunc)
154 { 220 {
155 enum ipa_lattice_type type; 221 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
156 tree constant; 222 return jfunc->value.pass_through.operand;
157 }; 223 }
158 224
159 /* Structure describing a single formal parameter. */ 225 /* Return the number of the caller's formal parameter that a pass through jump
160 struct ipa_param_descriptor 226 function JFUNC refers to. */
161 { 227
162 /* IPA-CP lattice. */ 228 static inline int
163 struct ipcp_lattice ipcp_lattice; 229 ipa_get_jf_pass_through_formal_id (struct ipa_jump_func *jfunc)
164 /* PARAM_DECL of this parameter. */ 230 {
165 tree decl; 231 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
166 /* Vector of BINFOs of types that this argument might encounter. NULL 232 return jfunc->value.pass_through.formal_id;
167 basically means a top value, bottom is marked by the cannot_devirtualize 233 }
168 flag below.*/ 234
169 VEC (tree, heap) *types; 235 /* Return operation of a pass through jump function JFUNC. */
236
237 static inline enum tree_code
238 ipa_get_jf_pass_through_operation (struct ipa_jump_func *jfunc)
239 {
240 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
241 return jfunc->value.pass_through.operation;
242 }
243
244 /* Return the agg_preserved flag of a pass through jump function JFUNC. */
245
246 static inline bool
247 ipa_get_jf_pass_through_agg_preserved (struct ipa_jump_func *jfunc)
248 {
249 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
250 return jfunc->value.pass_through.agg_preserved;
251 }
252
253 /* Return true if pass through jump function JFUNC preserves type
254 information. */
255
256 static inline bool
257 ipa_get_jf_pass_through_type_preserved (struct ipa_jump_func *jfunc)
258 {
259 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
260 return jfunc->value.pass_through.agg_preserved;
261 }
262
263 /* Return the offset of an ancestor jump function JFUNC. */
264
265 static inline HOST_WIDE_INT
266 ipa_get_jf_ancestor_offset (struct ipa_jump_func *jfunc)
267 {
268 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
269 return jfunc->value.ancestor.offset;
270 }
271
272 /* Return the number of the caller's formal parameter that an ancestor jump
273 function JFUNC refers to. */
274
275 static inline int
276 ipa_get_jf_ancestor_formal_id (struct ipa_jump_func *jfunc)
277 {
278 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
279 return jfunc->value.ancestor.formal_id;
280 }
281
282 /* Return the agg_preserved flag of an ancestor jump function JFUNC. */
283
284 static inline bool
285 ipa_get_jf_ancestor_agg_preserved (struct ipa_jump_func *jfunc)
286 {
287 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
288 return jfunc->value.ancestor.agg_preserved;
289 }
290
291 /* Return true if ancestor jump function JFUNC presrves type information. */
292
293 static inline bool
294 ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc)
295 {
296 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
297 return jfunc->value.ancestor.agg_preserved;
298 }
299
300 /* Summary describing a single formal parameter. */
301
302 struct GTY(()) ipa_param_descriptor
303 {
304 /* In analysis and modification phase, this is the PARAM_DECL of this
305 parameter, in IPA LTO phase, this is the type of the the described
306 parameter or NULL if not known. Do not read this field directly but
307 through ipa_get_param and ipa_get_type as appropriate. */
308 tree decl_or_type;
309 /* If all uses of the parameter are described by ipa-prop structures, this
310 says how many there are. If any use could not be described by means of
311 ipa-prop structures, this is IPA_UNDESCRIBED_USE. */
312 int controlled_uses;
313 unsigned int move_cost : 31;
170 /* The parameter is used. */ 314 /* The parameter is used. */
171 unsigned used : 1; 315 unsigned used : 1;
172 /* Set when parameter type cannot be used for devirtualization. */
173 unsigned cannot_devirtualize : 1;
174 }; 316 };
175 317
176 /* ipa_node_params stores information related to formal parameters of functions 318 /* ipa_node_params stores information related to formal parameters of functions
177 and some other information for interprocedural passes that operate on 319 and some other information for interprocedural passes that operate on
178 parameters (such as ipa-cp). */ 320 parameters (such as ipa-cp). */
179 struct ipa_node_params 321
180 { 322 struct GTY((for_user)) ipa_node_params
181 /* Number of formal parameters of this function. When set to 0, this 323 {
182 function's parameters would not be analyzed by IPA CP. */ 324 /* Default constructor. */
183 int param_count; 325 ipa_node_params ();
184 /* Whether this function is called with variable number of actual 326
185 arguments. */ 327 /* Default destructor. */
186 unsigned called_with_var_arguments : 1; 328 ~ipa_node_params ();
187 /* Whether the param uses analysis has already been performed. */ 329
188 unsigned uses_analysis_done : 1; 330 /* Information about individual formal parameters that are gathered when
189 /* Whether the function is enqueued in an ipa_func_list. */ 331 summaries are generated. */
190 unsigned node_enqueued : 1; 332 vec<ipa_param_descriptor, va_gc> *descriptors;
191 /* Pointer to an array of structures describing individual formal 333 /* Pointer to an array of structures describing individual formal
192 parameters. */ 334 parameters. */
193 struct ipa_param_descriptor *params; 335 struct ipcp_param_lattices * GTY((skip)) lattices;
194 /* Only for versioned nodes this field would not be NULL, 336 /* Only for versioned nodes this field would not be NULL,
195 it points to the node that IPA cp cloned from. */ 337 it points to the node that IPA cp cloned from. */
196 struct cgraph_node *ipcp_orig_node; 338 struct cgraph_node * GTY((skip)) ipcp_orig_node;
197 /* Meaningful only for original functions. Expresses the 339 /* If this node is an ipa-cp clone, these are the known constants that
198 ratio between the direct calls and sum of all invocations of 340 describe what it has been specialized for. */
199 this function (given by profiling info). It is used to calculate 341 vec<tree> GTY((skip)) known_csts;
200 the profiling information of the original function and the versioned 342 /* If this node is an ipa-cp clone, these are the known polymorphic contexts
201 one. */ 343 that describe what it has been specialized for. */
202 gcov_type count_scale; 344 vec<ipa_polymorphic_call_context> GTY((skip)) known_contexts;
345 /* Whether the param uses analysis and jump function computation has already
346 been performed. */
347 unsigned analysis_done : 1;
348 /* Whether the function is enqueued in ipa-cp propagation stack. */
349 unsigned node_enqueued : 1;
350 /* Whether we should create a specialized version based on values that are
351 known to be constant in all contexts. */
352 unsigned do_clone_for_all_contexts : 1;
353 /* Set if this is an IPA-CP clone for all contexts. */
354 unsigned is_all_contexts_clone : 1;
355 /* Node has been completely replaced by clones and will be removed after
356 ipa-cp is finished. */
357 unsigned node_dead : 1;
358 /* Node is involved in a recursion, potentionally indirect. */
359 unsigned node_within_scc : 1;
360 /* Node is calling a private function called only once. */
361 unsigned node_calling_single_call : 1;
362 /* False when there is something makes versioning impossible. */
363 unsigned versionable : 1;
364 };
365
366 inline
367 ipa_node_params::ipa_node_params ()
368 : descriptors (NULL), lattices (NULL), ipcp_orig_node (NULL),
369 known_csts (vNULL), known_contexts (vNULL), analysis_done (0),
370 node_enqueued (0), do_clone_for_all_contexts (0), is_all_contexts_clone (0),
371 node_dead (0), node_within_scc (0), node_calling_single_call (0),
372 versionable (0)
373 {
374 }
375
376 inline
377 ipa_node_params::~ipa_node_params ()
378 {
379 free (lattices);
380 known_csts.release ();
381 known_contexts.release ();
382 }
383
384 /* Intermediate information that we get from alias analysis about a particular
385 parameter in a particular basic_block. When a parameter or the memory it
386 references is marked modified, we use that information in all dominated
387 blocks without consulting alias analysis oracle. */
388
389 struct ipa_param_aa_status
390 {
391 /* Set when this structure contains meaningful information. If not, the
392 structure describing a dominating BB should be used instead. */
393 bool valid;
394
395 /* Whether we have seen something which might have modified the data in
396 question. PARM is for the parameter itself, REF is for data it points to
397 but using the alias type of individual accesses and PT is the same thing
398 but for computing aggregate pass-through functions using a very inclusive
399 ao_ref. */
400 bool parm_modified, ref_modified, pt_modified;
401 };
402
403 /* Information related to a given BB that used only when looking at function
404 body. */
405
406 struct ipa_bb_info
407 {
408 /* Call graph edges going out of this BB. */
409 vec<cgraph_edge *> cg_edges;
410 /* Alias analysis statuses of each formal parameter at this bb. */
411 vec<ipa_param_aa_status> param_aa_statuses;
412 };
413
414 /* Structure with global information that is only used when looking at function
415 body. */
416
417 struct ipa_func_body_info
418 {
419 /* The node that is being analyzed. */
420 cgraph_node *node;
421
422 /* Its info. */
423 struct ipa_node_params *info;
424
425 /* Information about individual BBs. */
426 vec<ipa_bb_info> bb_infos;
427
428 /* Number of parameters. */
429 int param_count;
430
431 /* Number of statements already walked by when analyzing this function. */
432 unsigned int aa_walked;
203 }; 433 };
204 434
205 /* ipa_node_params access functions. Please use these to access fields that 435 /* ipa_node_params access functions. Please use these to access fields that
206 are or will be shared among various passes. */ 436 are or will be shared among various passes. */
207 437
208 /* Set the number of formal parameters. */
209
210 static inline void
211 ipa_set_param_count (struct ipa_node_params *info, int count)
212 {
213 info->param_count = count;
214 }
215
216 /* Return the number of formal parameters. */ 438 /* Return the number of formal parameters. */
217 439
218 static inline int 440 static inline int
219 ipa_get_param_count (struct ipa_node_params *info) 441 ipa_get_param_count (struct ipa_node_params *info)
220 { 442 {
221 return info->param_count; 443 return vec_safe_length (info->descriptors);
222 } 444 }
223 445
224 /* Return the declaration of Ith formal parameter of the function corresponding 446 /* Return the declaration of Ith formal parameter of the function corresponding
225 to INFO. Note there is no setter function as this array is built just once 447 to INFO. Note there is no setter function as this array is built just once
226 using ipa_initialize_node_params. */ 448 using ipa_initialize_node_params. This function should not be called in
449 WPA. */
227 450
228 static inline tree 451 static inline tree
229 ipa_get_param (struct ipa_node_params *info, int i) 452 ipa_get_param (struct ipa_node_params *info, int i)
230 { 453 {
231 return info->params[i].decl; 454 gcc_checking_assert (info->descriptors);
232 } 455 gcc_checking_assert (!flag_wpa);
233 456 tree t = (*info->descriptors)[i].decl_or_type;
234 /* Return the used flag corresponding to the Ith formal parameter of 457 gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
235 the function associated with INFO. */ 458 return t;
459 }
460
461 /* Return the type of Ith formal parameter of the function corresponding
462 to INFO if it is known or NULL if not. */
463
464 static inline tree
465 ipa_get_type (struct ipa_node_params *info, int i)
466 {
467 gcc_checking_assert (info->descriptors);
468 tree t = (*info->descriptors)[i].decl_or_type;
469 if (!t)
470 return NULL;
471 if (TYPE_P (t))
472 return t;
473 gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
474 return TREE_TYPE (t);
475 }
476
477 /* Return the move cost of Ith formal parameter of the function corresponding
478 to INFO. */
479
480 static inline int
481 ipa_get_param_move_cost (struct ipa_node_params *info, int i)
482 {
483 gcc_checking_assert (info->descriptors);
484 return (*info->descriptors)[i].move_cost;
485 }
486
487 /* Set the used flag corresponding to the Ith formal parameter of the function
488 associated with INFO to VAL. */
489
490 static inline void
491 ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
492 {
493 gcc_checking_assert (info->descriptors);
494 (*info->descriptors)[i].used = val;
495 }
496
497 /* Return how many uses described by ipa-prop a parameter has or
498 IPA_UNDESCRIBED_USE if there is a use that is not described by these
499 structures. */
500 static inline int
501 ipa_get_controlled_uses (struct ipa_node_params *info, int i)
502 {
503 /* FIXME: introducing speculation causes out of bounds access here. */
504 if (vec_safe_length (info->descriptors) > (unsigned)i)
505 return (*info->descriptors)[i].controlled_uses;
506 return IPA_UNDESCRIBED_USE;
507 }
508
509 /* Set the controlled counter of a given parameter. */
510
511 static inline void
512 ipa_set_controlled_uses (struct ipa_node_params *info, int i, int val)
513 {
514 gcc_checking_assert (info->descriptors);
515 (*info->descriptors)[i].controlled_uses = val;
516 }
517
518 /* Return the used flag corresponding to the Ith formal parameter of the
519 function associated with INFO. */
236 520
237 static inline bool 521 static inline bool
238 ipa_is_param_used (struct ipa_node_params *info, int i) 522 ipa_is_param_used (struct ipa_node_params *info, int i)
239 { 523 {
240 return info->params[i].used; 524 gcc_checking_assert (info->descriptors);
241 } 525 return (*info->descriptors)[i].used;
242 526 }
243 /* Return the cannot_devirtualize flag corresponding to the Ith formal 527
244 parameter of the function associated with INFO. The corresponding function 528 /* Information about replacements done in aggregates for a given node (each
245 to set the flag is ipa_set_param_cannot_devirtualize. */ 529 node has its linked list). */
246 530 struct GTY(()) ipa_agg_replacement_value
247 static inline bool 531 {
248 ipa_param_cannot_devirtualize_p (struct ipa_node_params *info, int i) 532 /* Next item in the linked list. */
249 { 533 struct ipa_agg_replacement_value *next;
250 return info->params[i].cannot_devirtualize; 534 /* Offset within the aggregate. */
251 } 535 HOST_WIDE_INT offset;
252 536 /* The constant value. */
253 /* Return true iff the vector of possible types of the Ith formal parameter of 537 tree value;
254 the function associated with INFO is empty. */ 538 /* The paramter index. */
255 539 int index;
256 static inline bool 540 /* Whether the value was passed by reference. */
257 ipa_param_types_vec_empty (struct ipa_node_params *info, int i) 541 bool by_ref;
258 { 542 };
259 return info->params[i].types == NULL; 543
260 } 544 /* Structure holding information for the transformation phase of IPA-CP. */
261 545
262 /* Flag this node as having callers with variable number of arguments. */ 546 struct GTY(()) ipcp_transformation_summary
263 547 {
264 static inline void 548 /* Linked list of known aggregate values. */
265 ipa_set_called_with_variable_arg (struct ipa_node_params *info) 549 ipa_agg_replacement_value *agg_values;
266 { 550 /* Known bits information. */
267 info->called_with_var_arguments = 1; 551 vec<ipa_bits *, va_gc> *bits;
268 } 552 /* Value range information. */
269 553 vec<ipa_vr, va_gc> *m_vr;
270 /* Have we detected this node was called with variable number of arguments? */ 554 };
271 555
272 static inline bool 556 void ipa_set_node_agg_value_chain (struct cgraph_node *node,
273 ipa_is_called_with_var_arguments (struct ipa_node_params *info) 557 struct ipa_agg_replacement_value *aggvals);
274 { 558 void ipcp_grow_transformations_if_necessary (void);
275 return info->called_with_var_arguments;
276 }
277
278
279 559
280 /* ipa_edge_args stores information related to a callsite and particularly its 560 /* ipa_edge_args stores information related to a callsite and particularly its
281 arguments. It can be accessed by the IPA_EDGE_REF macro. */ 561 arguments. It can be accessed by the IPA_EDGE_REF macro. */
282 typedef struct GTY(()) ipa_edge_args 562
283 { 563 class GTY((for_user)) ipa_edge_args
284 /* Number of actual arguments in this callsite. When set to 0, 564 {
285 this callsite's parameters would not be analyzed by the different 565 public:
286 stages of IPA CP. */ 566
287 int argument_count; 567 /* Default constructor. */
288 /* Array of the callsite's jump function of each parameter. */ 568 ipa_edge_args () : jump_functions (NULL), polymorphic_call_contexts (NULL)
289 struct ipa_jump_func GTY ((length ("%h.argument_count"))) *jump_functions; 569 {}
290 } ipa_edge_args_t; 570
571 /* Destructor. */
572 ~ipa_edge_args ()
573 {
574 vec_free (jump_functions);
575 vec_free (polymorphic_call_contexts);
576 }
577
578 /* Vectors of the callsite's jump function and polymorphic context
579 information of each parameter. */
580 vec<ipa_jump_func, va_gc> *jump_functions;
581 vec<ipa_polymorphic_call_context, va_gc> *polymorphic_call_contexts;
582 };
291 583
292 /* ipa_edge_args access functions. Please use these to access fields that 584 /* ipa_edge_args access functions. Please use these to access fields that
293 are or will be shared among various passes. */ 585 are or will be shared among various passes. */
294 586
295 /* Set the number of actual arguments. */
296
297 static inline void
298 ipa_set_cs_argument_count (struct ipa_edge_args *args, int count)
299 {
300 args->argument_count = count;
301 }
302
303 /* Return the number of actual arguments. */ 587 /* Return the number of actual arguments. */
304 588
305 static inline int 589 static inline int
306 ipa_get_cs_argument_count (struct ipa_edge_args *args) 590 ipa_get_cs_argument_count (struct ipa_edge_args *args)
307 { 591 {
308 return args->argument_count; 592 return vec_safe_length (args->jump_functions);
309 } 593 }
310 594
311 /* Returns a pointer to the jump function for the ith argument. Please note 595 /* Returns a pointer to the jump function for the ith argument. Please note
312 there is no setter function as jump functions are all set up in 596 there is no setter function as jump functions are all set up in
313 ipa_compute_jump_functions. */ 597 ipa_compute_jump_functions. */
314 598
315 static inline struct ipa_jump_func * 599 static inline struct ipa_jump_func *
316 ipa_get_ith_jump_func (struct ipa_edge_args *args, int i) 600 ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
317 { 601 {
318 return &args->jump_functions[i]; 602 return &(*args->jump_functions)[i];
319 } 603 }
320 604
321 /* Vectors need to have typedefs of structures. */ 605 /* Returns a pointer to the polymorphic call context for the ith argument.
322 typedef struct ipa_node_params ipa_node_params_t; 606 NULL if contexts are not computed. */
323 607 static inline struct ipa_polymorphic_call_context *
324 /* Types of vectors holding the infos. */ 608 ipa_get_ith_polymorhic_call_context (struct ipa_edge_args *args, int i)
325 DEF_VEC_O (ipa_node_params_t); 609 {
326 DEF_VEC_ALLOC_O (ipa_node_params_t, heap); 610 if (!args->polymorphic_call_contexts)
327 DEF_VEC_O (ipa_edge_args_t); 611 return NULL;
328 DEF_VEC_ALLOC_O (ipa_edge_args_t, gc); 612 return &(*args->polymorphic_call_contexts)[i];
329 613 }
330 /* Vector where the parameter infos are actually stored. */ 614
331 extern VEC (ipa_node_params_t, heap) *ipa_node_params_vector; 615 /* Function summary for ipa_node_params. */
332 /* Vector where the parameter infos are actually stored. */ 616 class GTY((user)) ipa_node_params_t: public function_summary <ipa_node_params *>
333 extern GTY(()) VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector; 617 {
618 public:
619 ipa_node_params_t (symbol_table *table, bool ggc):
620 function_summary<ipa_node_params *> (table, ggc) { }
621
622 /* Hook that is called by summary when a node is duplicated. */
623 virtual void duplicate (cgraph_node *node,
624 cgraph_node *node2,
625 ipa_node_params *data,
626 ipa_node_params *data2);
627 };
628
629 /* Summary to manange ipa_edge_args structures. */
630
631 class GTY((user)) ipa_edge_args_sum_t : public call_summary <ipa_edge_args *>
632 {
633 public:
634 ipa_edge_args_sum_t (symbol_table *table, bool ggc)
635 : call_summary<ipa_edge_args *> (table, ggc) { }
636
637 /* Hook that is called by summary when an edge is duplicated. */
638 virtual void remove (cgraph_edge *cs, ipa_edge_args *args);
639 /* Hook that is called by summary when an edge is duplicated. */
640 virtual void duplicate (cgraph_edge *src,
641 cgraph_edge *dst,
642 ipa_edge_args *old_args,
643 ipa_edge_args *new_args);
644 };
645
646 /* Function summary where the parameter infos are actually stored. */
647 extern GTY(()) ipa_node_params_t * ipa_node_params_sum;
648 /* Call summary to store information about edges such as jump functions. */
649 extern GTY(()) ipa_edge_args_sum_t *ipa_edge_args_sum;
650
651 /* Vector of IPA-CP transformation data for each clone. */
652 extern GTY(()) vec<ipcp_transformation_summary, va_gc> *ipcp_transformations;
334 653
335 /* Return the associated parameter/argument info corresponding to the given 654 /* Return the associated parameter/argument info corresponding to the given
336 node/edge. */ 655 node/edge. */
337 #define IPA_NODE_REF(NODE) (VEC_index (ipa_node_params_t, \ 656 #define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE))
338 ipa_node_params_vector, (NODE)->uid)) 657 #define IPA_EDGE_REF(EDGE) (ipa_edge_args_sum->get (EDGE))
339 #define IPA_EDGE_REF(EDGE) (VEC_index (ipa_edge_args_t, \
340 ipa_edge_args_vector, (EDGE)->uid))
341 /* This macro checks validity of index returned by 658 /* This macro checks validity of index returned by
342 ipa_get_param_decl_index function. */ 659 ipa_get_param_decl_index function. */
343 #define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1) 660 #define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1)
344 661
345 /* Creating and freeing ipa_node_params and ipa_edge_args. */ 662 /* Creating and freeing ipa_node_params and ipa_edge_args. */
346 void ipa_create_all_node_params (void); 663 void ipa_create_all_node_params (void);
347 void ipa_create_all_edge_args (void); 664 void ipa_create_all_edge_args (void);
665 void ipa_check_create_edge_args (void);
348 void ipa_free_edge_args_substructures (struct ipa_edge_args *); 666 void ipa_free_edge_args_substructures (struct ipa_edge_args *);
349 void ipa_free_node_params_substructures (struct ipa_node_params *);
350 void ipa_free_all_node_params (void); 667 void ipa_free_all_node_params (void);
351 void ipa_free_all_edge_args (void); 668 void ipa_free_all_edge_args (void);
352 void ipa_create_all_structures_for_iinln (void);
353 void ipa_free_all_structures_after_ipa_cp (void); 669 void ipa_free_all_structures_after_ipa_cp (void);
354 void ipa_free_all_structures_after_iinln (void); 670 void ipa_free_all_structures_after_iinln (void);
671
355 void ipa_register_cgraph_hooks (void); 672 void ipa_register_cgraph_hooks (void);
673 int count_formal_params (tree fndecl);
356 674
357 /* This function ensures the array of node param infos is big enough to 675 /* This function ensures the array of node param infos is big enough to
358 accommodate a structure for all nodes and reallocates it if not. */ 676 accommodate a structure for all nodes and reallocates it if not. */
359 677
360 static inline void 678 static inline void
361 ipa_check_create_node_params (void) 679 ipa_check_create_node_params (void)
362 { 680 {
363 if (!ipa_node_params_vector) 681 if (!ipa_node_params_sum)
364 ipa_node_params_vector = VEC_alloc (ipa_node_params_t, heap, 682 ipa_node_params_sum
365 cgraph_max_uid); 683 = (new (ggc_cleared_alloc <ipa_node_params_t> ())
366 684 ipa_node_params_t (symtab, true));
367 if (VEC_length (ipa_node_params_t, ipa_node_params_vector) 685 }
368 <= (unsigned) cgraph_max_uid) 686
369 VEC_safe_grow_cleared (ipa_node_params_t, heap, 687 /* Returns true if edge summary contains a record for EDGE. The main purpose
370 ipa_node_params_vector, cgraph_max_uid + 1); 688 of this function is that debug dumping function can check info availability
371 } 689 without causing allocations. */
372
373 /* This function ensures the array of edge arguments infos is big enough to
374 accommodate a structure for all edges and reallocates it if not. */
375
376 static inline void
377 ipa_check_create_edge_args (void)
378 {
379 if (!ipa_edge_args_vector)
380 ipa_edge_args_vector = VEC_alloc (ipa_edge_args_t, gc,
381 cgraph_edge_max_uid);
382
383 if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
384 <= (unsigned) cgraph_edge_max_uid)
385 VEC_safe_grow_cleared (ipa_edge_args_t, gc, ipa_edge_args_vector,
386 cgraph_edge_max_uid + 1);
387 }
388
389 /* Returns true if the array of edge infos is large enough to accommodate an
390 info for EDGE. The main purpose of this function is that debug dumping
391 function can check info availability without causing reallocations. */
392 690
393 static inline bool 691 static inline bool
394 ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge) 692 ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge)
395 { 693 {
396 return ((unsigned) edge->uid < VEC_length (ipa_edge_args_t, 694 return ipa_edge_args_sum->exists (edge);
397 ipa_edge_args_vector)); 695 }
398 } 696
399 697 static inline ipcp_transformation_summary *
400 /* A function list element. It is used to create a temporary worklist used in 698 ipcp_get_transformation_summary (cgraph_node *node)
401 the propagation stage of IPCP. (can be used for more IPA optimizations) */ 699 {
402 struct ipa_func_list 700 if ((unsigned) node->uid >= vec_safe_length (ipcp_transformations))
403 { 701 return NULL;
404 struct cgraph_node *node; 702 return &(*ipcp_transformations)[node->uid];
405 struct ipa_func_list *next; 703 }
406 }; 704
407 705 /* Return the aggregate replacements for NODE, if there are any. */
408 /* ipa_func_list interface. */ 706
409 struct ipa_func_list *ipa_init_func_list (void); 707 static inline struct ipa_agg_replacement_value *
410 void ipa_push_func_to_list_1 (struct ipa_func_list **, struct cgraph_node *, 708 ipa_get_agg_replacements_for_node (cgraph_node *node)
411 struct ipa_node_params *); 709 {
412 struct cgraph_node *ipa_pop_func_from_list (struct ipa_func_list **); 710 ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
413 711 return ts ? ts->agg_values : NULL;
414 /* Add cgraph NODE to the worklist WL if it is not already in one. */ 712 }
415
416 static inline void
417 ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *node)
418 {
419 struct ipa_node_params *info = IPA_NODE_REF (node);
420
421 if (!info->node_enqueued)
422 ipa_push_func_to_list_1 (wl, node, info);
423 }
424
425 void ipa_analyze_node (struct cgraph_node *);
426 713
427 /* Function formal parameters related computations. */ 714 /* Function formal parameters related computations. */
428 void ipa_initialize_node_params (struct cgraph_node *node); 715 void ipa_initialize_node_params (struct cgraph_node *node);
429 bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, 716 bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
430 VEC (cgraph_edge_p, heap) **new_edges); 717 vec<cgraph_edge *> *new_edges);
431 718
432 /* Indirect edge and binfo processing. */ 719 /* Indirect edge and binfo processing. */
720 tree ipa_get_indirect_edge_target (struct cgraph_edge *ie,
721 vec<tree> ,
722 vec<ipa_polymorphic_call_context>,
723 vec<ipa_agg_jump_function_p>,
724 bool *);
433 struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree, 725 struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree,
434 tree); 726 bool speculative = false);
435 727 tree ipa_impossible_devirt_target (struct cgraph_edge *, tree);
728 ipa_bits *ipa_get_ipa_bits_for_value (const widest_int &value,
729 const widest_int &mask);
730
731
732 /* Functions related to both. */
733 void ipa_analyze_node (struct cgraph_node *);
734
735 /* Aggregate jump function related functions. */
736 tree ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *agg, tree scalar,
737 HOST_WIDE_INT offset, bool by_ref,
738 bool *from_global_constant = NULL);
739 bool ipa_load_from_parm_agg (struct ipa_func_body_info *fbi,
740 vec<ipa_param_descriptor, va_gc> *descriptors,
741 gimple *stmt, tree op, int *index_p,
742 HOST_WIDE_INT *offset_p, HOST_WIDE_INT *size_p,
743 bool *by_ref, bool *guaranteed_unmodified = NULL);
436 744
437 /* Debugging interface. */ 745 /* Debugging interface. */
438 void ipa_print_node_params (FILE *, struct cgraph_node *node); 746 void ipa_print_node_params (FILE *, struct cgraph_node *node);
439 void ipa_print_all_params (FILE *); 747 void ipa_print_all_params (FILE *);
440 void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node); 748 void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
441 void ipa_print_all_jump_functions (FILE * f); 749 void ipa_print_all_jump_functions (FILE * f);
750 void ipcp_verify_propagated_values (void);
751
752 template <typename value>
753 class ipcp_value;
754
755 extern object_allocator<ipcp_value<tree> > ipcp_cst_values_pool;
756 extern object_allocator<ipcp_value<ipa_polymorphic_call_context> >
757 ipcp_poly_ctx_values_pool;
758
759 template <typename valtype>
760 class ipcp_value_source;
761
762 extern object_allocator<ipcp_value_source<tree> > ipcp_sources_pool;
763
764 class ipcp_agg_lattice;
765
766 extern object_allocator<ipcp_agg_lattice> ipcp_agg_lattice_pool;
767
768 /* Operation to be performed for the parameter in ipa_parm_adjustment
769 below. */
770 enum ipa_parm_op {
771 IPA_PARM_OP_NONE,
772
773 /* This describes a brand new parameter.
774
775 The field `type' should be set to the new type, `arg_prefix'
776 should be set to the string prefix for the new DECL_NAME, and
777 `new_decl' will ultimately hold the newly created argument. */
778 IPA_PARM_OP_NEW,
779
780 /* This new parameter is an unmodified parameter at index base_index. */
781 IPA_PARM_OP_COPY,
782
783 /* This adjustment describes a parameter that is about to be removed
784 completely. Most users will probably need to book keep those so that they
785 don't leave behinfd any non default def ssa names belonging to them. */
786 IPA_PARM_OP_REMOVE
787 };
442 788
443 /* Structure to describe transformations of formal parameters and actual 789 /* Structure to describe transformations of formal parameters and actual
444 arguments. Each instance describes one new parameter and they are meant to 790 arguments. Each instance describes one new parameter and they are meant to
445 be stored in a vector. Additionally, most users will probably want to store 791 be stored in a vector. Additionally, most users will probably want to store
446 adjustments about parameters that are being removed altogether so that SSA 792 adjustments about parameters that are being removed altogether so that SSA
461 807
462 /* Alias refrerence type to be used in MEM_REFs when adjusting caller 808 /* Alias refrerence type to be used in MEM_REFs when adjusting caller
463 arguments. */ 809 arguments. */
464 tree alias_ptr_type; 810 tree alias_ptr_type;
465 811
466 /* The new declaration when creating/replacing a parameter. Created by 812 /* The new declaration when creating/replacing a parameter. Created
467 ipa_modify_formal_parameters, useful for functions modifying the body 813 by ipa_modify_formal_parameters, useful for functions modifying
468 accordingly. */ 814 the body accordingly. For brand new arguments, this is the newly
469 tree reduction; 815 created argument. */
816 tree new_decl;
470 817
471 /* New declaration of a substitute variable that we may use to replace all 818 /* New declaration of a substitute variable that we may use to replace all
472 non-default-def ssa names when a parm decl is going away. */ 819 non-default-def ssa names when a parm decl is going away. */
473 tree new_ssa_base; 820 tree new_ssa_base;
474 821
475 /* If non-NULL and the original parameter is to be removed (copy_param below 822 /* If non-NULL and the original parameter is to be removed (copy_param below
476 is NULL), this is going to be its nonlocalized vars value. */ 823 is NULL), this is going to be its nonlocalized vars value. */
477 tree nonlocal_value; 824 tree nonlocal_value;
478 825
826 /* This holds the prefix to be used for the new DECL_NAME. */
827 const char *arg_prefix;
828
479 /* Offset into the original parameter (for the cases when the new parameter 829 /* Offset into the original parameter (for the cases when the new parameter
480 is a component of an original one). */ 830 is a component of an original one). */
481 HOST_WIDE_INT offset; 831 HOST_WIDE_INT offset;
482 832
483 /* Zero based index of the original parameter this one is based on. (ATM 833 /* Zero based index of the original parameter this one is based on. */
484 there is no way to insert a new parameter out of the blue because there is
485 no need but if it arises the code can be easily exteded to do so.) */
486 int base_index; 834 int base_index;
487 835
488 /* This new parameter is an unmodified parameter at index base_index. */ 836 /* Whether this parameter is a new parameter, a copy of an old one,
489 unsigned copy_param : 1; 837 or one about to be removed. */
490 838 enum ipa_parm_op op;
491 /* This adjustment describes a parameter that is about to be removed 839
492 completely. Most users will probably need to book keep those so that they 840 /* Storage order of the original parameter (for the cases when the new
493 don't leave behinfd any non default def ssa names belonging to them. */ 841 parameter is a component of an original one). */
494 unsigned remove_param : 1; 842 unsigned reverse : 1;
495 843
496 /* The parameter is to be passed by reference. */ 844 /* The parameter is to be passed by reference. */
497 unsigned by_ref : 1; 845 unsigned by_ref : 1;
498 }; 846 };
499 847
500 typedef struct ipa_parm_adjustment ipa_parm_adjustment_t; 848 typedef vec<ipa_parm_adjustment> ipa_parm_adjustment_vec;
501 DEF_VEC_O (ipa_parm_adjustment_t); 849
502 DEF_VEC_ALLOC_O (ipa_parm_adjustment_t, heap); 850 vec<tree> ipa_get_vector_of_formal_parms (tree fndecl);
503 851 vec<tree> ipa_get_vector_of_formal_parm_types (tree fntype);
504 typedef VEC (ipa_parm_adjustment_t, heap) *ipa_parm_adjustment_vec; 852 void ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec);
505 853 void ipa_modify_call_arguments (struct cgraph_edge *, gcall *,
506 VEC(tree, heap) *ipa_get_vector_of_formal_parms (tree fndecl);
507 void ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec,
508 const char *);
509 void ipa_modify_call_arguments (struct cgraph_edge *, gimple,
510 ipa_parm_adjustment_vec); 854 ipa_parm_adjustment_vec);
511 ipa_parm_adjustment_vec ipa_combine_adjustments (ipa_parm_adjustment_vec, 855 ipa_parm_adjustment_vec ipa_combine_adjustments (ipa_parm_adjustment_vec,
512 ipa_parm_adjustment_vec); 856 ipa_parm_adjustment_vec);
513 void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree); 857 void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree);
514 858 void ipa_dump_agg_replacement_values (FILE *f,
515 void ipa_prop_write_jump_functions (cgraph_node_set set); 859 struct ipa_agg_replacement_value *av);
860 void ipa_prop_write_jump_functions (void);
516 void ipa_prop_read_jump_functions (void); 861 void ipa_prop_read_jump_functions (void);
517 void ipa_update_after_lto_read (void); 862 void ipcp_write_transformation_summaries (void);
863 void ipcp_read_transformation_summaries (void);
864 int ipa_get_param_decl_index (struct ipa_node_params *, tree);
865 tree ipa_value_from_jfunc (struct ipa_node_params *info,
866 struct ipa_jump_func *jfunc);
867 unsigned int ipcp_transform_function (struct cgraph_node *node);
868 ipa_polymorphic_call_context ipa_context_from_jfunc (ipa_node_params *,
869 cgraph_edge *,
870 int,
871 ipa_jump_func *);
872 void ipa_dump_param (FILE *, struct ipa_node_params *info, int i);
873 bool ipa_modify_expr (tree *, bool, ipa_parm_adjustment_vec);
874 ipa_parm_adjustment *ipa_get_adjustment_candidate (tree **, bool *,
875 ipa_parm_adjustment_vec,
876 bool);
877 void ipa_release_body_info (struct ipa_func_body_info *);
878 tree ipa_get_callee_param_type (struct cgraph_edge *e, int i);
518 879
519 /* From tree-sra.c: */ 880 /* From tree-sra.c: */
520 tree build_ref_for_offset (location_t, tree, HOST_WIDE_INT, tree, 881 tree build_ref_for_offset (location_t, tree, HOST_WIDE_INT, bool, tree,
521 gimple_stmt_iterator *, bool); 882 gimple_stmt_iterator *, bool);
522 883
884 /* In ipa-cp.c */
885 void ipa_cp_c_finalize (void);
886
523 #endif /* IPA_PROP_H */ 887 #endif /* IPA_PROP_H */