diff options
author | Martin Jambor <mjambor@suse.cz> | 2008-09-11 19:03:23 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2008-09-11 19:03:23 +0200 |
commit | f8e2a1ed3b746951a5d07e03f91d1f8209ebe775 (patch) | |
tree | 73228742f0647af60cdfe7e96540801e3f8ad3ef /gcc/ipa-prop.h | |
parent | 420da8caae151d84ef45e31cf058e9832d856b9e (diff) | |
download | gcc-f8e2a1ed3b746951a5d07e03f91d1f8209ebe775.zip gcc-f8e2a1ed3b746951a5d07e03f91d1f8209ebe775.tar.gz gcc-f8e2a1ed3b746951a5d07e03f91d1f8209ebe775.tar.bz2 |
ipa-prop.h (struct ipa_param_flags): Removed.
2008-09-11 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_param_flags): Removed.
(struct ipa_param_descriptor): New structure.
(struct ipa_node_params): ipcp_lattices, param_decls and
param_flags moved to ipa_param_description.
(ipa_get_ith_param): Renamed to ipa_get_param, changed to access
descriptors. Renamed all users.
(ipa_is_ith_param_modified): Renamed to ipa_is_param_modified,
changed to access descriptors. Renamed all users.
(ipa_is_ith_param_called): Renamed to ipa_is_param_called, changed
to access descriptors. Renamed all users.
* ipa-cp.c (ipcp_init_cloned_node): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
(ipcp_analyze_node): Likewise.
(ipcp_get_ith_lattice): Renamed to ipcp_get_lattice, changed to access
descriptors. Renamed all users.
(ipcp_initialize_node_lattices): Remove allocation.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
* ipa-prop.c (ipa_create_param_decls_array): Renamed to
ipa_populate_param_decls, made static, added parameter info,
renamed mt to node, removed allocation, changed to use
descriptors.
(ipa_count_formal_params): Made static, added parameter info,
renamed mt to node.
(ipa_initialize_node_params): New function.
(ipa_check_stmt_modifications): Changed to use descriptors.
(ipa_detect_param_modifications): Removed allocation, changed to
use descriptors.
(ipa_note_param_call): Changed to use descriptors.
(ipa_analyze_params_uses): Removed allocation.
(ipa_free_node_params_substructures): Changed to use descriptors.
(ipa_edge_duplication_hook): Use the unused attribute.
(ipa_node_duplication_hook): Use the unused attribute, changed to
use descriptors, changed to duplicate descriptors.
* ipa-inline.c (cgraph_mark_inline_edge): New parameter new_edges,
changed all callers. Call ipa_propagate_indirect_call_infos if doing
indirect inlining. Made static.
(cgraph_decide_inlining): Freeing ipa-prop structures after inlining
functions called only once.
(cgraph_decide_recursive_inlining): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining_of_small_functions): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining): Don't call
ipa_propagate_indirect_call_infos.
* ipa-prop.c: Check that vectors are allocated.
* ipa-inline.c (cgraph_mark_inline_edge): Returns boolean, true
iff a new cgraph edges have been created.
(cgraph_decide_inlining): New variable redo_always_inline.
Flattening and always_inlining loop until callgraph stabilizes.
* ipa-prop.c (update_call_notes_after_inlining): Returns boolean,
true iff new cgraph edges have been created.
(propagate_info_to_inlined_callees): Likewise.
(ipa_propagate_indirect_call_infos): Likewise.
From-SVN: r140293
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r-- | gcc/ipa-prop.h | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index c1bc1a2..47010e1 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -110,16 +110,6 @@ struct ipa_replace_map bool ref_p; }; -/* ipa_param_flags contains various flags that describe how the associated - parameter is treated within a function. */ -struct ipa_param_flags -{ - /* Whether the value parameter has been modified within the function. */ - unsigned modified : 1; - /* Whether the parameter has been used as a call destination. */ - unsigned called : 1; -}; - /* Each instance of the following structure describes a statement that calls a function parameter. Those referring to statements within the same function are linked in a list. */ @@ -144,6 +134,19 @@ struct ipa_param_call_note bool processed; }; +/* Structure describing a single formal parameter. */ +struct ipa_param_descriptor +{ + /* IPA-CP lattice. */ + struct ipcp_lattice ipcp_lattice; + /* PARAM_DECL of this parameter. */ + tree decl; + /* Whether the value parameter has been modified within the function. */ + unsigned modified : 1; + /* Whether the parameter has been used as a call destination. */ + unsigned called : 1; +}; + /* ipa_node_params stores information related to formal parameters of functions and some other information for interprocedural passes that operate on parameters (such as ipa-cp). */ @@ -153,12 +156,9 @@ struct ipa_node_params this function's parameters would not be analyzed by the different stages of IPA CP. */ int param_count; - /* Array of lattices. */ - struct ipcp_lattice *ipcp_lattices; - /* Mapping each parameter to its PARM_DECL tree. */ - tree *param_decls; - /* Various flags describing individual parameters. */ - struct ipa_param_flags *param_flags; + /* Pointer to an array of structures describing individual formal + parameters. */ + struct ipa_param_descriptor *params; /* List of structures enumerating calls to a formal parameter. */ struct ipa_param_call_note *param_calls; /* Only for versioned nodes this field would not be NULL, @@ -197,31 +197,33 @@ ipa_get_param_count (struct ipa_node_params *info) return info->param_count; } -/* Returns the declaration of ith param of the corresponding node. Note there - is no setter function as this array is built just once using - ipa_create_param_decls_array. */ +/* Return the declaration of Ith formal parameter of the function corresponding + to INFO. Note there is no setter function as this array is built just once + using ipa_initialize_node_params. */ static inline tree -ipa_get_ith_param (struct ipa_node_params *info, int i) +ipa_get_param (struct ipa_node_params *info, int i) { - return info->param_decls[i]; + return info->params[i].decl; } -/* Returns the modification flag corresponding to the ith parameter. Note - there is no setter method as the goal is to set all flags when building the - array in ipa_detect_param_modifications. */ +/* Return the modification flag corresponding to the Ith formal parameter of + the function associated with INFO. Note that there is no setter method as + the goal is to set all flags when building the array in + ipa_detect_param_modifications. */ static inline bool -ipa_is_ith_param_modified (struct ipa_node_params *info, int i) +ipa_is_param_modified (struct ipa_node_params *info, int i) { - return info->param_flags[i].modified; + return info->params[i].modified; } -/* Returns the called flag corresponding o the ith paramterer. Note there is - no setter method as the goal is to set all flags when building the array in +/* Return the called flag corresponding to the Ith formal parameter of the + function associated with INFO. Note that there is no setter method as the + goal is to set all flags when building the array in ipa_detect_called_params. */ static inline bool -ipa_is_ith_param_called (struct ipa_node_params *info, int i) +ipa_is_param_called (struct ipa_node_params *info, int i) { - return info->param_flags[i].called; + return info->params[i].called; } /* Flag this node as having callers with variable number of arguments. */ @@ -372,12 +374,11 @@ struct cgraph_node *ipa_pop_func_from_list (struct ipa_func_list **); void ipa_compute_jump_functions (struct cgraph_edge *); void ipa_count_arguments (struct cgraph_edge *); -/* Function parameters related computations. */ -void ipa_count_formal_params (struct cgraph_node *); -void ipa_create_param_decls_array (struct cgraph_node *); +/* Function formal parameters related computations. */ +void ipa_initialize_node_params (struct cgraph_node *node); void ipa_detect_param_modifications (struct cgraph_node *); void ipa_analyze_params_uses (struct cgraph_node *); -void ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, +bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, VEC (cgraph_edge_p, heap) **new_edges); /* Debugging interface. */ |