aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2010-06-25 16:27:47 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2010-06-25 16:27:47 +0200
commit062c604fc558cd31410ffe0273ff0264fc4ee7c8 (patch)
treea60ec3339f5eb1694260afebbffe15e123fcb971 /gcc/ipa-cp.c
parent212580ffb8305e6da025fd873f1732879b835de1 (diff)
downloadgcc-062c604fc558cd31410ffe0273ff0264fc4ee7c8.zip
gcc-062c604fc558cd31410ffe0273ff0264fc4ee7c8.tar.gz
gcc-062c604fc558cd31410ffe0273ff0264fc4ee7c8.tar.bz2
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag.
2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 1c1809b..78dccf8 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -177,18 +177,6 @@ ipcp_init_cloned_node (struct cgraph_node *orig_node,
IPA_NODE_REF (new_node)->ipcp_orig_node = orig_node;
}
-/* Perform intraprocedrual analysis needed for ipcp. */
-static void
-ipcp_analyze_node (struct cgraph_node *node)
-{
- /* Unreachable nodes should have been eliminated before ipcp. */
- gcc_assert (node->needed || node->reachable);
-
- node->local.versionable = tree_versionable_function_p (node->decl);
- ipa_initialize_node_params (node);
- ipa_detect_param_modifications (node);
-}
-
/* Return scale for NODE. */
static inline gcov_type
ipcp_get_node_scale (struct cgraph_node *node)
@@ -611,6 +599,7 @@ ipcp_compute_node_scale (struct cgraph_node *node)
/* Initialization and computation of IPCP data structures. This is the initial
intraprocedural analysis of functions, which gathers information to be
propagated later on. */
+
static void
ipcp_init_stage (void)
{
@@ -618,16 +607,13 @@ ipcp_init_stage (void)
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed)
- ipcp_analyze_node (node);
- for (node = cgraph_nodes; node; node = node->next)
- {
- if (!node->analyzed)
- continue;
+ {
+ /* Unreachable nodes should have been eliminated before ipcp. */
+ gcc_assert (node->needed || node->reachable);
- ipa_analyze_params_uses (node);
- /* building jump functions */
- ipa_compute_jump_functions (node);
- }
+ node->local.versionable = tree_versionable_function_p (node->decl);
+ ipa_analyze_node (node);
+ }
}
/* Return true if there are some formal parameters whose value is IPA_TOP (in