2014-01-20 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / ipa-prop.h
blob299627b1394440db67d5d001d57910023e8107f0
1 /* Interprocedural analyses.
2 Copyright (C) 2005-2014 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef IPA_PROP_H
21 #define IPA_PROP_H
23 #include "vec.h"
24 #include "cgraph.h"
25 #include "alloc-pool.h"
27 /* The following definitions and interfaces are used by
28 interprocedural analyses or parameters. */
30 #define IPA_UNDESCRIBED_USE -1
32 /* ipa-prop.c stuff (ipa-cp, indirect inlining): */
34 /* A jump function for a callsite represents the values passed as actual
35 arguments of the callsite. They were originally proposed in a paper called
36 "Interprocedural Constant Propagation", by David Callahan, Keith D Cooper,
37 Ken Kennedy, Linda Torczon in Comp86, pg 152-161. There are three main
38 types of values :
40 Pass-through - the caller's formal parameter is passed as an actual
41 argument, possibly one simple operation performed on it.
42 Constant - a constant (is_gimple_ip_invariant)is passed as an actual
43 argument.
44 Unknown - neither of the above.
46 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
48 parameter to which the function refers. It is mainly intended to represent
49 getting addresses of of ancestor fields in C++
50 (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.
53 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
55 functions are called polynomial).
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.
62 Jump functions are computed in ipa-prop.c by function
63 update_call_notes_after_inlining. Some information can be lost and jump
64 functions degraded accordingly when inlining, see
65 update_call_notes_after_inlining in the same file. */
67 enum jump_func_type
69 IPA_JF_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
70 IPA_JF_KNOWN_TYPE, /* represented by field known_type */
71 IPA_JF_CONST, /* represented by field costant */
72 IPA_JF_PASS_THROUGH, /* represented by field pass_through */
73 IPA_JF_ANCESTOR /* represented by field ancestor */
76 /* Structure holding data required to describe a known type jump function. */
77 struct GTY(()) ipa_known_type_data
79 /* Offset of the component of the base_type being described. */
80 HOST_WIDE_INT offset;
81 /* Type of the whole object. */
82 tree base_type;
83 /* Type of the component of the object that is being described. */
84 tree component_type;
87 struct ipa_cst_ref_desc;
89 /* Structure holding data required to describe a constant jump function. */
90 struct GTY(()) ipa_constant_data
92 /* THe value of the constant. */
93 tree value;
94 /* Pointer to the structure that describes the reference. */
95 struct ipa_cst_ref_desc GTY((skip)) *rdesc;
98 /* Structure holding data required to describe a pass-through jump function. */
100 struct GTY(()) ipa_pass_through_data
102 /* If an operation is to be performed on the original parameter, this is the
103 second (constant) operand. */
104 tree operand;
105 /* Number of the caller's formal parameter being passed. */
106 int formal_id;
107 /* Operation that is performed on the argument before it is passed on.
108 NOP_EXPR means no operation. Otherwise oper must be a simple binary
109 arithmetic operation where the caller's parameter is the first operand and
110 operand field from this structure is the second one. */
111 enum tree_code operation;
112 /* When the passed value is a pointer, it is set to true only when we are
113 certain that no write to the object it points to has occurred since the
114 caller functions started execution, except for changes noted in the
115 aggregate part of the jump function (see description of
116 ipa_agg_jump_function). The flag is used only when the operation is
117 NOP_EXPR. */
118 unsigned agg_preserved : 1;
120 /* When set to true, we guarantee that, if there is a C++ object pointed to
121 by this object, it does not undergo dynamic type change in the course of
122 functions decribed by this jump function. */
123 unsigned type_preserved : 1;
126 /* Structure holding data required to describe an ancestor pass-through
127 jump function. */
129 struct GTY(()) ipa_ancestor_jf_data
131 /* Offset of the field representing the ancestor. */
132 HOST_WIDE_INT offset;
133 /* Type of the result. */
134 tree type;
135 /* Number of the caller's formal parameter being passed. */
136 int formal_id;
137 /* Flag with the same meaning like agg_preserve in ipa_pass_through_data. */
138 unsigned agg_preserved : 1;
139 /* When set to true, we guarantee that, if there is a C++ object pointed to
140 by this object, it does not undergo dynamic type change in the course of
141 functions decribed by this jump function. */
142 unsigned type_preserved : 1;
145 /* An element in an aggegate part of a jump function describing a known value
146 at a given offset. When it is part of a pass-through jump function with
147 agg_preserved set or an ancestor jump function with agg_preserved set, all
148 unlisted positions are assumed to be preserved but the value can be a type
149 node, which means that the particular piece (starting at offset and having
150 the size of the type) is clobbered with an unknown value. When
151 agg_preserved is false or the type of the containing jump function is
152 different, all unlisted parts are assumed to be unknown and all values must
153 fulfill is_gimple_ip_invariant. */
155 struct GTY(()) ipa_agg_jf_item
157 /* The offset at which the known value is located within the aggregate. */
158 HOST_WIDE_INT offset;
160 /* The known constant or type if this is a clobber. */
161 tree value;
165 /* Aggregate jump function - i.e. description of contents of aggregates passed
166 either by reference or value. */
168 struct GTY(()) ipa_agg_jump_function
170 /* Description of the individual items. */
171 vec<ipa_agg_jf_item, va_gc> *items;
172 /* True if the data was passed by reference (as opposed to by value). */
173 bool by_ref;
176 typedef struct ipa_agg_jump_function *ipa_agg_jump_function_p;
178 /* A jump function for a callsite represents the values passed as actual
179 arguments of the callsite. See enum jump_func_type for the various
180 types of jump functions supported. */
181 struct GTY (()) ipa_jump_func
183 /* Aggregate contants description. See struct ipa_agg_jump_function and its
184 description. */
185 struct ipa_agg_jump_function agg;
187 enum jump_func_type type;
188 /* Represents a value of a jump function. pass_through is used only in jump
189 function context. constant represents the actual constant in constant jump
190 functions and member_cst holds constant c++ member functions. */
191 union jump_func_value
193 struct ipa_known_type_data GTY ((tag ("IPA_JF_KNOWN_TYPE"))) known_type;
194 struct ipa_constant_data GTY ((tag ("IPA_JF_CONST"))) constant;
195 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
196 struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
197 } GTY ((desc ("%1.type"))) value;
201 /* Return the offset of the component that is described by a known type jump
202 function JFUNC. */
204 static inline HOST_WIDE_INT
205 ipa_get_jf_known_type_offset (struct ipa_jump_func *jfunc)
207 gcc_checking_assert (jfunc->type == IPA_JF_KNOWN_TYPE);
208 return jfunc->value.known_type.offset;
211 /* Return the base type of a known type jump function JFUNC. */
213 static inline tree
214 ipa_get_jf_known_type_base_type (struct ipa_jump_func *jfunc)
216 gcc_checking_assert (jfunc->type == IPA_JF_KNOWN_TYPE);
217 return jfunc->value.known_type.base_type;
220 /* Return the component type of a known type jump function JFUNC. */
222 static inline tree
223 ipa_get_jf_known_type_component_type (struct ipa_jump_func *jfunc)
225 gcc_checking_assert (jfunc->type == IPA_JF_KNOWN_TYPE);
226 return jfunc->value.known_type.component_type;
229 /* Return the constant stored in a constant jump functin JFUNC. */
231 static inline tree
232 ipa_get_jf_constant (struct ipa_jump_func *jfunc)
234 gcc_checking_assert (jfunc->type == IPA_JF_CONST);
235 return jfunc->value.constant.value;
238 static inline struct ipa_cst_ref_desc *
239 ipa_get_jf_constant_rdesc (struct ipa_jump_func *jfunc)
241 gcc_checking_assert (jfunc->type == IPA_JF_CONST);
242 return jfunc->value.constant.rdesc;
245 /* Return the operand of a pass through jmp function JFUNC. */
247 static inline tree
248 ipa_get_jf_pass_through_operand (struct ipa_jump_func *jfunc)
250 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
251 return jfunc->value.pass_through.operand;
254 /* Return the number of the caller's formal parameter that a pass through jump
255 function JFUNC refers to. */
257 static inline int
258 ipa_get_jf_pass_through_formal_id (struct ipa_jump_func *jfunc)
260 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
261 return jfunc->value.pass_through.formal_id;
264 /* Return operation of a pass through jump function JFUNC. */
266 static inline enum tree_code
267 ipa_get_jf_pass_through_operation (struct ipa_jump_func *jfunc)
269 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
270 return jfunc->value.pass_through.operation;
273 /* Return the agg_preserved flag of a pass through jump function JFUNC. */
275 static inline bool
276 ipa_get_jf_pass_through_agg_preserved (struct ipa_jump_func *jfunc)
278 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
279 return jfunc->value.pass_through.agg_preserved;
282 /* Return the type_preserved flag of a pass through jump function JFUNC. */
284 static inline bool
285 ipa_get_jf_pass_through_type_preserved (struct ipa_jump_func *jfunc)
287 gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
288 return jfunc->value.pass_through.type_preserved;
291 /* Return the offset of an ancestor jump function JFUNC. */
293 static inline HOST_WIDE_INT
294 ipa_get_jf_ancestor_offset (struct ipa_jump_func *jfunc)
296 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
297 return jfunc->value.ancestor.offset;
300 /* Return the result type of an ancestor jump function JFUNC. */
302 static inline tree
303 ipa_get_jf_ancestor_type (struct ipa_jump_func *jfunc)
305 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
306 return jfunc->value.ancestor.type;
309 /* Return the number of the caller's formal parameter that an ancestor jump
310 function JFUNC refers to. */
312 static inline int
313 ipa_get_jf_ancestor_formal_id (struct ipa_jump_func *jfunc)
315 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
316 return jfunc->value.ancestor.formal_id;
319 /* Return the agg_preserved flag of an ancestor jump function JFUNC. */
321 static inline bool
322 ipa_get_jf_ancestor_agg_preserved (struct ipa_jump_func *jfunc)
324 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
325 return jfunc->value.ancestor.agg_preserved;
328 /* Return the type_preserved flag of an ancestor jump function JFUNC. */
330 static inline bool
331 ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc)
333 gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
334 return jfunc->value.ancestor.type_preserved;
337 /* Summary describing a single formal parameter. */
339 struct ipa_param_descriptor
341 /* PARAM_DECL of this parameter. */
342 tree decl;
343 /* If all uses of the parameter are described by ipa-prop structures, this
344 says how many there are. If any use could not be described by means of
345 ipa-prop structures, this is IPA_UNDESCRIBED_USE. */
346 int controlled_uses;
347 unsigned int move_cost : 31;
348 /* The parameter is used. */
349 unsigned used : 1;
352 struct ipcp_lattice;
354 /* ipa_node_params stores information related to formal parameters of functions
355 and some other information for interprocedural passes that operate on
356 parameters (such as ipa-cp). */
358 struct ipa_node_params
360 /* Information about individual formal parameters that are gathered when
361 summaries are generated. */
362 vec<ipa_param_descriptor> descriptors;
363 /* Pointer to an array of structures describing individual formal
364 parameters. */
365 struct ipcp_param_lattices *lattices;
366 /* Only for versioned nodes this field would not be NULL,
367 it points to the node that IPA cp cloned from. */
368 struct cgraph_node *ipcp_orig_node;
369 /* If this node is an ipa-cp clone, these are the known values that describe
370 what it has been specialized for. */
371 vec<tree> known_vals;
372 /* Whether the param uses analysis has already been performed. */
373 unsigned uses_analysis_done : 1;
374 /* Whether the function is enqueued in ipa-cp propagation stack. */
375 unsigned node_enqueued : 1;
376 /* Whether we should create a specialized version based on values that are
377 known to be constant in all contexts. */
378 unsigned do_clone_for_all_contexts : 1;
379 /* Set if this is an IPA-CP clone for all contexts. */
380 unsigned is_all_contexts_clone : 1;
381 /* Node has been completely replaced by clones and will be removed after
382 ipa-cp is finished. */
383 unsigned node_dead : 1;
386 /* ipa_node_params access functions. Please use these to access fields that
387 are or will be shared among various passes. */
389 /* Return the number of formal parameters. */
391 static inline int
392 ipa_get_param_count (struct ipa_node_params *info)
394 return info->descriptors.length ();
397 /* Return the declaration of Ith formal parameter of the function corresponding
398 to INFO. Note there is no setter function as this array is built just once
399 using ipa_initialize_node_params. */
401 static inline tree
402 ipa_get_param (struct ipa_node_params *info, int i)
404 gcc_checking_assert (!flag_wpa);
405 return info->descriptors[i].decl;
408 /* Return the move cost of Ith formal parameter of the function corresponding
409 to INFO. */
411 static inline int
412 ipa_get_param_move_cost (struct ipa_node_params *info, int i)
414 return info->descriptors[i].move_cost;
417 /* Set the used flag corresponding to the Ith formal parameter of the function
418 associated with INFO to VAL. */
420 static inline void
421 ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
423 info->descriptors[i].used = val;
426 /* Return how many uses described by ipa-prop a parameter has or
427 IPA_UNDESCRIBED_USE if there is a use that is not described by these
428 structures. */
429 static inline int
430 ipa_get_controlled_uses (struct ipa_node_params *info, int i)
432 return info->descriptors[i].controlled_uses;
435 /* Set the controlled counter of a given parameter. */
437 static inline void
438 ipa_set_controlled_uses (struct ipa_node_params *info, int i, int val)
440 info->descriptors[i].controlled_uses = val;
443 /* Return the used flag corresponding to the Ith formal parameter of the
444 function associated with INFO. */
446 static inline bool
447 ipa_is_param_used (struct ipa_node_params *info, int i)
449 return info->descriptors[i].used;
452 /* Information about replacements done in aggregates for a given node (each
453 node has its linked list). */
454 struct GTY(()) ipa_agg_replacement_value
456 /* Next item in the linked list. */
457 struct ipa_agg_replacement_value *next;
458 /* Offset within the aggregate. */
459 HOST_WIDE_INT offset;
460 /* The constant value. */
461 tree value;
462 /* The paramter index. */
463 int index;
464 /* Whether the value was passed by reference. */
465 bool by_ref;
468 typedef struct ipa_agg_replacement_value *ipa_agg_replacement_value_p;
470 void ipa_set_node_agg_value_chain (struct cgraph_node *node,
471 struct ipa_agg_replacement_value *aggvals);
473 /* ipa_edge_args stores information related to a callsite and particularly its
474 arguments. It can be accessed by the IPA_EDGE_REF macro. */
475 struct GTY(()) ipa_edge_args
477 /* Vector of the callsite's jump function of each parameter. */
478 vec<ipa_jump_func, va_gc> *jump_functions;
481 /* ipa_edge_args access functions. Please use these to access fields that
482 are or will be shared among various passes. */
484 /* Return the number of actual arguments. */
486 static inline int
487 ipa_get_cs_argument_count (struct ipa_edge_args *args)
489 return vec_safe_length (args->jump_functions);
492 /* Returns a pointer to the jump function for the ith argument. Please note
493 there is no setter function as jump functions are all set up in
494 ipa_compute_jump_functions. */
496 static inline struct ipa_jump_func *
497 ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
499 return &(*args->jump_functions)[i];
502 /* Types of vectors holding the infos. */
504 /* Vector where the parameter infos are actually stored. */
505 extern vec<ipa_node_params> ipa_node_params_vector;
506 /* Vector of known aggregate values in cloned nodes. */
507 extern GTY(()) vec<ipa_agg_replacement_value_p, va_gc> *ipa_node_agg_replacements;
508 /* Vector where the parameter infos are actually stored. */
509 extern GTY(()) vec<ipa_edge_args, va_gc> *ipa_edge_args_vector;
511 /* Return the associated parameter/argument info corresponding to the given
512 node/edge. */
513 #define IPA_NODE_REF(NODE) (&ipa_node_params_vector[(NODE)->uid])
514 #define IPA_EDGE_REF(EDGE) (&(*ipa_edge_args_vector)[(EDGE)->uid])
515 /* This macro checks validity of index returned by
516 ipa_get_param_decl_index function. */
517 #define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1)
519 /* Creating and freeing ipa_node_params and ipa_edge_args. */
520 void ipa_create_all_node_params (void);
521 void ipa_create_all_edge_args (void);
522 void ipa_free_edge_args_substructures (struct ipa_edge_args *);
523 void ipa_free_node_params_substructures (struct ipa_node_params *);
524 void ipa_free_all_node_params (void);
525 void ipa_free_all_edge_args (void);
526 void ipa_free_all_structures_after_ipa_cp (void);
527 void ipa_free_all_structures_after_iinln (void);
528 void ipa_register_cgraph_hooks (void);
530 /* This function ensures the array of node param infos is big enough to
531 accommodate a structure for all nodes and reallocates it if not. */
533 static inline void
534 ipa_check_create_node_params (void)
536 if (!ipa_node_params_vector.exists ())
537 ipa_node_params_vector.create (cgraph_max_uid);
539 if (ipa_node_params_vector.length () <= (unsigned) cgraph_max_uid)
540 ipa_node_params_vector.safe_grow_cleared (cgraph_max_uid + 1);
543 /* This function ensures the array of edge arguments infos is big enough to
544 accommodate a structure for all edges and reallocates it if not. */
546 static inline void
547 ipa_check_create_edge_args (void)
549 if (vec_safe_length (ipa_edge_args_vector) <= (unsigned) cgraph_edge_max_uid)
550 vec_safe_grow_cleared (ipa_edge_args_vector, cgraph_edge_max_uid + 1);
553 /* Returns true if the array of edge infos is large enough to accommodate an
554 info for EDGE. The main purpose of this function is that debug dumping
555 function can check info availability without causing reallocations. */
557 static inline bool
558 ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge)
560 return ((unsigned) edge->uid < vec_safe_length (ipa_edge_args_vector));
563 /* Return the aggregate replacements for NODE, if there are any. */
565 static inline struct ipa_agg_replacement_value *
566 ipa_get_agg_replacements_for_node (struct cgraph_node *node)
568 if ((unsigned) node->uid >= vec_safe_length (ipa_node_agg_replacements))
569 return NULL;
570 return (*ipa_node_agg_replacements)[node->uid];
573 /* Function formal parameters related computations. */
574 void ipa_initialize_node_params (struct cgraph_node *node);
575 bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
576 vec<cgraph_edge_p> *new_edges);
578 /* Indirect edge and binfo processing. */
579 tree ipa_get_indirect_edge_target (struct cgraph_edge *ie,
580 vec<tree> ,
581 vec<tree> ,
582 vec<ipa_agg_jump_function_p> );
583 struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree);
584 tree ipa_binfo_from_known_type_jfunc (struct ipa_jump_func *);
585 tree ipa_intraprocedural_devirtualization (gimple);
587 /* Functions related to both. */
588 void ipa_analyze_node (struct cgraph_node *);
590 /* Aggregate jump function related functions. */
591 tree ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *, HOST_WIDE_INT,
592 bool);
593 bool ipa_load_from_parm_agg (struct ipa_node_params *, gimple, tree, int *,
594 HOST_WIDE_INT *, bool *);
596 /* Debugging interface. */
597 void ipa_print_node_params (FILE *, struct cgraph_node *node);
598 void ipa_print_all_params (FILE *);
599 void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
600 void ipa_print_all_jump_functions (FILE * f);
601 void ipcp_verify_propagated_values (void);
603 extern alloc_pool ipcp_values_pool;
604 extern alloc_pool ipcp_sources_pool;
605 extern alloc_pool ipcp_agg_lattice_pool;
607 /* Operation to be performed for the parameter in ipa_parm_adjustment
608 below. */
609 enum ipa_parm_op {
610 IPA_PARM_OP_NONE,
612 /* This describes a brand new parameter.
614 The field `type' should be set to the new type, `arg_prefix'
615 should be set to the string prefix for the new DECL_NAME, and
616 `new_decl' will ultimately hold the newly created argument. */
617 IPA_PARM_OP_NEW,
619 /* This new parameter is an unmodified parameter at index base_index. */
620 IPA_PARM_OP_COPY,
622 /* This adjustment describes a parameter that is about to be removed
623 completely. Most users will probably need to book keep those so that they
624 don't leave behinfd any non default def ssa names belonging to them. */
625 IPA_PARM_OP_REMOVE
628 /* Structure to describe transformations of formal parameters and actual
629 arguments. Each instance describes one new parameter and they are meant to
630 be stored in a vector. Additionally, most users will probably want to store
631 adjustments about parameters that are being removed altogether so that SSA
632 names belonging to them can be replaced by SSA names of an artificial
633 variable. */
634 struct ipa_parm_adjustment
636 /* The original PARM_DECL itself, helpful for processing of the body of the
637 function itself. Intended for traversing function bodies.
638 ipa_modify_formal_parameters, ipa_modify_call_arguments and
639 ipa_combine_adjustments ignore this and use base_index.
640 ipa_modify_formal_parameters actually sets this. */
641 tree base;
643 /* Type of the new parameter. However, if by_ref is true, the real type will
644 be a pointer to this type. */
645 tree type;
647 /* Alias refrerence type to be used in MEM_REFs when adjusting caller
648 arguments. */
649 tree alias_ptr_type;
651 /* The new declaration when creating/replacing a parameter. Created
652 by ipa_modify_formal_parameters, useful for functions modifying
653 the body accordingly. For brand new arguments, this is the newly
654 created argument. */
655 tree new_decl;
657 /* New declaration of a substitute variable that we may use to replace all
658 non-default-def ssa names when a parm decl is going away. */
659 tree new_ssa_base;
661 /* If non-NULL and the original parameter is to be removed (copy_param below
662 is NULL), this is going to be its nonlocalized vars value. */
663 tree nonlocal_value;
665 /* This holds the prefix to be used for the new DECL_NAME. */
666 const char *arg_prefix;
668 /* Offset into the original parameter (for the cases when the new parameter
669 is a component of an original one). */
670 HOST_WIDE_INT offset;
672 /* Zero based index of the original parameter this one is based on. */
673 int base_index;
675 /* Whether this parameter is a new parameter, a copy of an old one,
676 or one about to be removed. */
677 enum ipa_parm_op op;
679 /* The parameter is to be passed by reference. */
680 unsigned by_ref : 1;
683 typedef vec<ipa_parm_adjustment> ipa_parm_adjustment_vec;
685 vec<tree> ipa_get_vector_of_formal_parms (tree fndecl);
686 vec<tree> ipa_get_vector_of_formal_parm_types (tree fntype);
687 void ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec);
688 void ipa_modify_call_arguments (struct cgraph_edge *, gimple,
689 ipa_parm_adjustment_vec);
690 ipa_parm_adjustment_vec ipa_combine_adjustments (ipa_parm_adjustment_vec,
691 ipa_parm_adjustment_vec);
692 void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree);
693 void ipa_dump_agg_replacement_values (FILE *f,
694 struct ipa_agg_replacement_value *av);
695 void ipa_prop_write_jump_functions (void);
696 void ipa_prop_read_jump_functions (void);
697 void ipa_prop_write_all_agg_replacement (void);
698 void ipa_prop_read_all_agg_replacement (void);
699 void ipa_update_after_lto_read (void);
700 int ipa_get_param_decl_index (struct ipa_node_params *, tree);
701 tree ipa_value_from_jfunc (struct ipa_node_params *info,
702 struct ipa_jump_func *jfunc);
703 unsigned int ipcp_transform_function (struct cgraph_node *node);
704 void ipa_dump_param (FILE *, struct ipa_node_params *info, int i);
705 bool ipa_modify_expr (tree *, bool, ipa_parm_adjustment_vec);
706 ipa_parm_adjustment *ipa_get_adjustment_candidate (tree **, bool *,
707 ipa_parm_adjustment_vec,
708 bool);
711 /* From tree-sra.c: */
712 tree build_ref_for_offset (location_t, tree, HOST_WIDE_INT, tree,
713 gimple_stmt_iterator *, bool);
715 #endif /* IPA_PROP_H */