Commit 3f84bf08 by Martin Jambor Committed by Martin Jambor

ipa-prop.c (count_formal_params_1): New function.

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.

From-SVN: r150551
parent 26ba353e
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.
2009-08-06 Thomas Schwinge <tschwinge@gnu.org>
* gcc/doc/extend.texi (__builtin_extract_return_address)
......
......@@ -2887,8 +2887,8 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
$(TREE_DUMP_H) $(BASIC_BLOCK_H) $(TREE_PASS_H) langhooks.h \
tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(TOPLEV_H)
tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \
$(TM_H) $(TREE_H) $(GIMPLE_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) statistics.h \
$(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) $(TARGET_H) $(FLAGS_H)
$(TM_H) $(TREE_H) $(GIMPLE_H) $(TREE_FLOW_H) $(IPA_PROP_H) $(DIAGNOSTIC_H) \
statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) $(TARGET_H) $(FLAGS_H)
tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
$(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_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 */
......@@ -79,6 +79,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "gimple.h"
#include "tree-flow.h"
#include "ipa-prop.h"
#include "diagnostic.h"
#include "statistics.h"
#include "tree-dump.h"
......@@ -1119,7 +1120,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
minor rewrite of fold_stmt.
*/
static bool
bool
build_ref_for_offset (tree *expr, tree type, HOST_WIDE_INT offset,
tree exp_type, bool allow_ptr)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment