aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.h
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-07 00:51:34 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-07 00:51:34 +0000
commit547f1802a096a0b092de758d34cafd5c6d026857 (patch)
treee32de0fb2f6c7763918d428281ac22fa32a5626e /gcc/ipa-prop.h
parent673dad3fa772c6f11fce17e1493e21ab365ac5fe (diff)
2009-08-07 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (count_formal_params_1): New function. (ipa_get_vector_of_formal_parms): New function. (get_vector_of_formal_parm_types): New function. (ipa_modify_formal_parameters): New function. (ipa_modify_call_arguments): New function. (index_in_adjustments_multiple_times_p): New function. (ipa_combine_adjustments): New function. (ipa_dump_param_adjustments): New function. * ipa-prop.h (struct ipa_parm_adjustment): New type. (ipa_get_vector_of_formal_parms): Declare. (ipa_modify_formal_parameters): Declare. (ipa_modify_call_arguments): Declare. (ipa_combine_adjustments): Declare. (ipa_dump_param_adjustments): Declare. (build_ref_for_offset): Declare. * Makefile.in (tree-sra.o): Add ipa-prop.h to dependencies. * tree-sra.c: Include ipa-prop.c. (build_ref_for_offset): Make public. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r--gcc/ipa-prop.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index fafadaca247..4794f691fba 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -403,4 +403,75 @@ void ipa_print_all_params (FILE *);
void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
void ipa_print_all_jump_functions (FILE * f);
+/* Structure to describe transformations of formal parameters and actual
+ arguments. Each instance describes one new parameter and they are meant to
+ be stored in a vector. Additionally, most users will probably want to store
+ adjustments about parameters that are being removed altogether so that SSA
+ names belonging to them can be replaced by SSA names of an artificial
+ variable. */
+struct ipa_parm_adjustment
+{
+ /* The original PARM_DECL itself, helpful for processing of the body of the
+ function itself. Intended for traversing function bodies.
+ ipa_modify_formal_parameters, ipa_modify_call_arguments and
+ ipa_combine_adjustments ignore this and use base_index.
+ ipa_modify_formal_parameters actually sets this. */
+ tree base;
+
+ /* Type of the new parameter. However, if by_ref is true, the real type will
+ be a pointer to this type. */
+ tree type;
+
+ /* The new declaration when creating/replacing a parameter. Created by
+ ipa_modify_formal_parameters, useful for functions modifying the body
+ accordingly. */
+ tree reduction;
+
+ /* New declaration of a substitute variable that we may use to replace all
+ non-default-def ssa names when a parm decl is going away. */
+ tree new_ssa_base;
+
+ /* If non-NULL and the original parameter is to be removed (copy_param below
+ is NULL), this is going to be its nonlocalized vars value. */
+ tree nonlocal_value;
+
+ /* Offset into the original parameter (for the cases when the new parameter
+ is a component of an original one). */
+ HOST_WIDE_INT offset;
+
+ /* Zero based index of the original parameter this one is based on. (ATM
+ there is no way to insert a new parameter out of the blue because there is
+ no need but if it arises the code can be easily exteded to do so.) */
+ int base_index;
+
+ /* This new parameter is an unmodified parameter at index base_index. */
+ unsigned copy_param : 1;
+
+ /* This adjustment describes a parameter that is about to be removed
+ completely. Most users will probably need to book keep those so that they
+ don't leave behinfd any non default def ssa names belonging to them. */
+ unsigned remove_param : 1;
+
+ /* The parameter is to be passed by reference. */
+ unsigned by_ref : 1;
+};
+
+typedef struct ipa_parm_adjustment ipa_parm_adjustment_t;
+DEF_VEC_O (ipa_parm_adjustment_t);
+DEF_VEC_ALLOC_O (ipa_parm_adjustment_t, heap);
+
+typedef VEC (ipa_parm_adjustment_t, heap) *ipa_parm_adjustment_vec;
+
+VEC(tree, heap) *ipa_get_vector_of_formal_parms (tree fndecl);
+void ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec,
+ const char *);
+void ipa_modify_call_arguments (struct cgraph_edge *, gimple,
+ ipa_parm_adjustment_vec);
+ipa_parm_adjustment_vec ipa_combine_adjustments (ipa_parm_adjustment_vec,
+ ipa_parm_adjustment_vec);
+void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree);
+
+/* From tree-sra.c: */
+bool build_ref_for_offset (tree *, tree, HOST_WIDE_INT, tree, bool);
+
#endif /* IPA_PROP_H */