diff options
author | Martin Jambor <mjambor@suse.cz> | 2010-08-05 15:23:07 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2010-08-05 15:23:07 +0200 |
commit | 3949c4a710360edb924d4c88a8974ed0bbfa9f20 (patch) | |
tree | d7635a83c603a76ecd0568209e0c2e2385f551c2 /gcc/ipa-prop.c | |
parent | 4caa21a13b14b333714d1f8dcce3adefe6fe910e (diff) | |
download | gcc-3949c4a710360edb924d4c88a8974ed0bbfa9f20.zip gcc-3949c4a710360edb924d4c88a8974ed0bbfa9f20.tar.gz gcc-3949c4a710360edb924d4c88a8974ed0bbfa9f20.tar.bz2 |
ipa-prop.h (enum ipa_lattice_type): Changed comments.
2010-08-05 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (enum ipa_lattice_type): Changed comments.
(struct ipa_param_descriptor): New fields types and
cannot_devirtualize.
(ipa_param_cannot_devirtualize_p): New function.
(ipa_param_types_vec_empty): Likewise.
(ipa_make_edge_direct_to_target): Declare.
* ipa-cp.c: Fixed first stage driver name in initial comment,
described devirtualization there too.
(ipcp_analyze_node): Call ipa_analyze_params_uses.
(ipcp_print_all_lattices): Print devirtualization info.
(ipa_set_param_cannot_devirtualize): New function.
(ipcp_initialize_node_lattices): Set cannot_devirtualize when setting
lattice to BOTTOM.
(ipcp_init_stage): Merged into...
(ipcp_generate_summary): ...its caller.
(ipcp_change_tops_to_bottom): Also process type lists.
(ipcp_add_param_type): New function.
(ipcp_copy_types): Likewise.
(ipcp_propagate_types): Likewise.
(ipcp_propagate_stage): Also propagate types.
(ipcp_need_redirect_p): Variable jump_func moved to its scope block.
Also return true if propagated types require it.
(ipcp_update_callgraph): Dump redirection info.
(ipcp_process_devirtualization_opportunities): New function.
(ipcp_const_param_count): Include known type information.
(ipcp_insert_stage): Call ipcp_process_devirtualization_opportunities
on new node. Fixed formatting.
* ipa-prop.c (make_edge_direct_to_target): Renamed to
ipa_make_edge_direct_to_target and changed all callers. Made
externally visible.
(ipa_node_duplication_hook): Duplicate types vector.
* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Also try to
redirect outgoing calls for which we can't get a decl from the
statement. Check that we can get a decl from the call statement.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_analyze_params_uses only when ipa-cp is disabled.
* tree-inline.c (get_indirect_callee_fndecl): Removed.
(expand_call_inline): Do not call get_indirect_callee_fndecl.
* params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): New parameter.
* Makefile.in (ipa-cp.o): Add gimple.h to dependencies.
* testsuite/g++.dg/ipa/devirt-1.C: New test.
* testsuite/g++.dg/ipa/devirt-2.C: Likewise.
* testsuite/g++.dg/ipa/devirt-3.C: Likewise.
* testsuite/g++.dg/ipa/devirt-4.C: Likewise.
* testsuite/g++.dg/ipa/devirt-5.C: Likewise.
* testsuite/gcc.dg/ipa/iinline-3.c: Likewise.
From-SVN: r162911
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index c5da8f8..9d7df07 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -1430,8 +1430,8 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, /* If TARGET is an addr_expr of a function declaration, make it the destination of an indirect edge IE and return the edge. Otherwise, return NULL. */ -static struct cgraph_edge * -make_edge_direct_to_target (struct cgraph_edge *ie, tree target) +struct cgraph_edge * +ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target) { struct cgraph_node *callee; @@ -1484,7 +1484,7 @@ try_make_edge_direct_simple_call (struct cgraph_edge *ie, else return NULL; - return make_edge_direct_to_target (ie, target); + return ipa_make_edge_direct_to_target (ie, target); } /* Try to find a destination for indirect edge IE that corresponds to a @@ -1525,7 +1525,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie, return NULL; if (target) - return make_edge_direct_to_target (ie, target); + return ipa_make_edge_direct_to_target (ie, target); else return NULL; } @@ -1794,7 +1794,7 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, __attribute__((unused)) void *data) { struct ipa_node_params *old_info, *new_info; - int param_count; + int param_count, i; ipa_check_create_node_params (); old_info = IPA_NODE_REF (src); @@ -1805,8 +1805,15 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, new_info->params = (struct ipa_param_descriptor *) duplicate_array (old_info->params, sizeof (struct ipa_param_descriptor) * param_count); + for (i = 0; i < param_count; i++) + new_info->params[i].types = VEC_copy (tree, heap, + old_info->params[i].types); new_info->ipcp_orig_node = old_info->ipcp_orig_node; new_info->count_scale = old_info->count_scale; + + new_info->called_with_var_arguments = old_info->called_with_var_arguments; + new_info->uses_analysis_done = old_info->uses_analysis_done; + new_info->node_enqueued = old_info->node_enqueued; } /* Register our cgraph hooks if they are not already there. */ |