aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-09-22 13:57:43 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-09-22 11:57:43 +0000
commit5ee53a067403d9cccadb7f599652581c298088b3 (patch)
treeb8f1b5b279159d592c4f9d9ddd21e222f26b5fd4 /gcc/ipa-prop.c
parentaa0b3f8f8d4748aaaee4892ed0d5d85abb2e86f6 (diff)
downloadgcc-5ee53a067403d9cccadb7f599652581c298088b3.zip
gcc-5ee53a067403d9cccadb7f599652581c298088b3.tar.gz
gcc-5ee53a067403d9cccadb7f599652581c298088b3.tar.bz2
ipa-inline-transform.c (inline_call): Always update jump functions after inlining.
* ipa-inline-transform.c (inline_call): Always update jump functions after inlining. * ipa-inline.c (ipa_inline): Likewise; do not call ipa_create_all_structures_for_iinln. (ipa_inline): Always free jump functions. * ipa-inline-analysis.c (evaluate_conditions_for_edge): Remove hack. (remap_edge_predicates): Fix pasto. (inline_merge_summary): Remove nlined edge predicate; remove hack. (inline_analyze_function): Always initialize jump functions. (inline_generate_summary): Likewise. (inline_write_summary): Always write jump functions when ipa-cp is not doing that. (inline_read_summary): Always read jump functions when ipa-cp is not doing that. * ipa-prop.c (iinlining_processed_edges): Remove. (update_indirect_edges_after_inlining): Do not use iinlining_processed_edges; instead set param_index to -1. (propagate_info_to_inlined_callees): Only try to indirect inlining when asked to do so; update jump functions of indirect calls, too; remove jump functions of the inlined edge. (ipa_edge_duplication_hook): Do not copy iinlining_processed_edges. (ipa_create_all_structures_for_iinln): Remove. (ipa_free_all_structures_after_iinln): Do not free iinlining_processed_edges. * ipa-prop.h (ipa_create_all_structures_for_iinln): Remove. From-SVN: r179083
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 066bbdb..52f583a 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -56,10 +56,6 @@ VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
/* Vector where the parameter infos are actually stored. */
VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector;
-/* Bitmap with all UIDs of call graph edges that have been already processed
- by indirect inlining. */
-static bitmap iinlining_processed_edges;
-
/* Holders of ipa cgraph hooks: */
static struct cgraph_edge_hook_list *edge_removal_hook_holder;
static struct cgraph_node_hook_list *node_removal_hook_holder;
@@ -1699,18 +1695,14 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
struct ipa_jump_func *jfunc;
next_ie = ie->next_callee;
- if (bitmap_bit_p (iinlining_processed_edges, ie->uid))
- continue;
- /* If we ever use indirect edges for anything other than indirect
- inlining, we will need to skip those with negative param_indices. */
if (ici->param_index == -1)
continue;
/* We must check range due to calls with variable number of arguments: */
if (ici->param_index >= ipa_get_cs_argument_count (top))
{
- bitmap_set_bit (iinlining_processed_edges, ie->uid);
+ ici->param_index = -1;
continue;
}
@@ -1725,7 +1717,10 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
}
else
/* Either we can find a destination for this edge now or never. */
- bitmap_set_bit (iinlining_processed_edges, ie->uid);
+ ici->param_index = -1;
+
+ if (!flag_indirect_inlining)
+ continue;
if (ici->polymorphic)
new_direct_edge = try_make_edge_direct_virtual_call (ie, jfunc);
@@ -1771,6 +1766,8 @@ propagate_info_to_inlined_callees (struct cgraph_edge *cs,
res |= propagate_info_to_inlined_callees (cs, e->callee, new_edges);
else
update_jump_functions_after_inlining (cs, e);
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ update_jump_functions_after_inlining (cs, e);
return res;
}
@@ -1785,13 +1782,19 @@ bool
ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
VEC (cgraph_edge_p, heap) **new_edges)
{
+ bool changed;
/* Do nothing if the preparation phase has not been carried out yet
(i.e. during early inlining). */
if (!ipa_node_params_vector)
return false;
gcc_assert (ipa_edge_args_vector);
- return propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
+ changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
+
+ /* We do not keep jump functions of inlined edges up to date. Better to free
+ them so we do not access them accidentally. */
+ ipa_free_edge_args_substructures (IPA_EDGE_REF (cs));
+ return changed;
}
/* Frees all dynamically allocated structures that the argument info points
@@ -1889,10 +1892,6 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
new_args->jump_functions = VEC_copy (ipa_jump_func_t, gc,
old_args->jump_functions);
-
- if (iinlining_processed_edges
- && bitmap_bit_p (iinlining_processed_edges, src->uid))
- bitmap_set_bit (iinlining_processed_edges, dst->uid);
}
/* Hook that is called by cgraph.c when a node is duplicated. */
@@ -1963,21 +1962,13 @@ ipa_unregister_cgraph_hooks (void)
function_insertion_hook_holder = NULL;
}
-/* Allocate all necessary data structures necessary for indirect inlining. */
-
-void
-ipa_create_all_structures_for_iinln (void)
-{
- iinlining_processed_edges = BITMAP_ALLOC (NULL);
-}
-
/* Free all ipa_node_params and all ipa_edge_args structures if they are no
longer needed after ipa-cp. */
void
ipa_free_all_structures_after_ipa_cp (void)
{
- if (!flag_indirect_inlining)
+ if (!optimize)
{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
@@ -1993,8 +1984,6 @@ ipa_free_all_structures_after_ipa_cp (void)
void
ipa_free_all_structures_after_iinln (void)
{
- BITMAP_FREE (iinlining_processed_edges);
-
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipa_unregister_cgraph_hooks ();