> Hi,
> this patch makes ipa-prop to free edge summaries (jump functions) for
> calls which has been inlined because they are no longer useful.
> The main change is to change IPA_EDGE_REF from get_create to get
> and thus we need to watch for missing summaires at some places so
> combining -O0 and -O2 code works.
> 
> Bootstrapped/regtested x86_64-linux, comitted.
> 
>       * 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.
Sadly this patch breaks lto bootstrap with

0xd8193d ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*, 
ipa_edge_args*, ipa_edge_args*)
        ../../gcc/ipa-prop.c:3883
0xd8a113 call_summary<ipa_edge_args*>::symtab_duplication(cgraph_edge*, 
cgraph_edge*, void*)
        ../../gcc/symbol-summary.h:771
0x9ecbc9 symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
        ../../gcc/cgraph.c:453
0xa0a57a cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count, 
profile_count, bool)
        ../../gcc/cgraphclones.c:141
0xa0b5b9 cgraph_node::create_clone(tree_node*, profile_count, bool, 
vec<cgraph_edge*, va_heap, vl_ptr>, bool, cgraph_node*, ipa_param_adjustments*, 
char const*)
        ../../gcc/cgraphclones.c:391
0x1f78f3f clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
        ../../gcc/ipa-inline-transform.c:221
0x1f78ff4 clone_inlined_nodes(cgraph_edge*, bool, bool, int*)
        ../../gcc/ipa-inline-transform.c:236
0x1f79c6c inline_call(cgraph_edge*, bool, vec<cgraph_edge*, va_heap, vl_ptr>*, 
int*, bool, bool*)
        ../../gcc/ipa-inline-transform.c:479
0x1f6ae28 inline_small_functions
        ../../gcc/ipa-inline.c:2151
0x1f6c8e6 ipa_inline
        ../../gcc/ipa-inline.c:2615
0x1f6d792 execute
        ../../gcc/ipa-inline.c:3023

So I suppose that the reference counting still makes use of the jump
functions at inlined edges (even though it does not make much sense).
This patch removes the code releasing them until this is sorted out.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 277485)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2019-10-27  Jan Hubicka  <hubi...@ucw.cz>
+
+       * ipa-prop.c (ipa_propagate_indirect_call_infos): Do not remove
+       jump functions.
+
 2019-10-27  Eric Botcazou <ebotca...@adacore.com>
 
        * cgraph.c (cgraph_node::rtl_info): Fix cut&pasto in comment.
Index: ipa-prop.c
===================================================================
--- ipa-prop.c  (revision 277484)
+++ ipa-prop.c  (working copy)
@@ -3706,7 +3706,6 @@ ipa_propagate_indirect_call_infos (struc
 
   propagate_controlled_uses (cs);
   changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
-  ipa_edge_args_sum->remove (cs);
 
   return changed;
 }

Reply via email to