diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2019-10-27 09:11:57 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-10-27 08:11:57 +0000 |
commit | a33c028eb38268b5084ebc4cc17a1cb64b3a838b (patch) | |
tree | ec4950bbbb492e328ff374d375ea1b29cfecfcf3 /gcc/ipa-prop.c | |
parent | a088d7b10f296dbd57bccbac1bfcf8abb207b034 (diff) | |
download | gcc-a33c028eb38268b5084ebc4cc17a1cb64b3a838b.zip gcc-a33c028eb38268b5084ebc4cc17a1cb64b3a838b.tar.gz gcc-a33c028eb38268b5084ebc4cc17a1cb64b3a838b.tar.bz2 |
ipa-cp.c (propagate_constants_across_call): If args are not available just drop everything to varying.
* ipa-cp.c (propagate_constants_across_call): If args are not available
just drop everything to varying.
(find_aggregate_values_for_callers_subset): Watch for missing
edge summary.
(find_more_scalar_values_for_callers_subs): Likewise.
* ipa-prop.c (ipa_compute_jump_functions_for_edge,
update_jump_functions_after_inlining, propagate_controlled_uses):
Watch for missing summaries.
(ipa_propagate_indirect_call_infos): Remove summary after propagation
is finished.
(ipa_write_node_info): Watch for missing summaries.
(ipa_read_edge_info): Create new ref.
(ipa_edge_args_sum_t): Add remove.
(IPA_EDGE_REF_GET_CREATE): New macro.
* ipa-fnsummary.c (evaluate_properties_for_edge): Watch for missing
edge summary.
(remap_edge_change_prob): Likewise.
From-SVN: r277484
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 5020f4a..1290a2f 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -1854,7 +1854,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, struct cgraph_edge *cs) { class ipa_node_params *info = IPA_NODE_REF (cs->caller); - class ipa_edge_args *args = IPA_EDGE_REF (cs); + class ipa_edge_args *args = IPA_EDGE_REF_GET_CREATE (cs); gcall *call = cs->call_stmt; int n, arg_num = gimple_call_num_args (call); bool useful_context = false; @@ -2652,6 +2652,8 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, { class ipa_edge_args *top = IPA_EDGE_REF (cs); class ipa_edge_args *args = IPA_EDGE_REF (e); + if (!args) + return; int count = ipa_get_cs_argument_count (args); int i; @@ -3575,6 +3577,8 @@ static void propagate_controlled_uses (struct cgraph_edge *cs) { class ipa_edge_args *args = IPA_EDGE_REF (cs); + if (!args) + return; struct cgraph_node *new_root = cs->caller->global.inlined_to ? cs->caller->global.inlined_to : cs->caller; class ipa_node_params *new_root_info = IPA_NODE_REF (new_root); @@ -3702,6 +3706,7 @@ ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, propagate_controlled_uses (cs); changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges); + ipa_edge_args_sum->remove (cs); return changed; } @@ -4380,6 +4385,12 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) { class ipa_edge_args *args = IPA_EDGE_REF (e); + if (!args) + { + streamer_write_uhwi (ob, 0); + continue; + } + streamer_write_uhwi (ob, ipa_get_cs_argument_count (args) * 2 + (args->polymorphic_call_contexts != NULL)); @@ -4393,15 +4404,19 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) for (e = node->indirect_calls; e; e = e->next_callee) { class ipa_edge_args *args = IPA_EDGE_REF (e); - - streamer_write_uhwi (ob, - ipa_get_cs_argument_count (args) * 2 - + (args->polymorphic_call_contexts != NULL)); - for (j = 0; j < ipa_get_cs_argument_count (args); j++) + if (!args) + streamer_write_uhwi (ob, 0); + else { - ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j)); - if (args->polymorphic_call_contexts != NULL) - ipa_get_ith_polymorhic_call_context (args, j)->stream_out (ob); + streamer_write_uhwi (ob, + ipa_get_cs_argument_count (args) * 2 + + (args->polymorphic_call_contexts != NULL)); + for (j = 0; j < ipa_get_cs_argument_count (args); j++) + { + ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j)); + if (args->polymorphic_call_contexts != NULL) + ipa_get_ith_polymorhic_call_context (args, j)->stream_out (ob); + } } ipa_write_indirect_edge_info (ob, e); } @@ -4422,7 +4437,7 @@ ipa_read_edge_info (class lto_input_block *ib, return; if (prevails && e->possibly_call_in_translation_unit_p ()) { - class ipa_edge_args *args = IPA_EDGE_REF (e); + class ipa_edge_args *args = IPA_EDGE_REF_GET_CREATE (e); vec_safe_grow_cleared (args->jump_functions, count); if (contexts_computed) vec_safe_grow_cleared (args->polymorphic_call_contexts, count); |