Make default duplicate and insert methods of summaries abort; fix fallout
authorJan Hubicka <jh@suse.cz>
Mon, 26 Oct 2020 10:24:33 +0000 (11:24 +0100)
committerJan Hubicka <jh@suse.cz>
Mon, 26 Oct 2020 10:24:33 +0000 (11:24 +0100)
commit40e67ab8e59cf1c558f2818625c7e06dbf7a8e50
treea949d436af2b24b4dcf1d15dd96045e6ec8f7f9b
parentdc7824734e6589bac2ba0f8363d24d50da8cfeae
Make default duplicate and insert methods of summaries abort; fix fallout

the default duplicate and insert methods of sumaries produce empty
summary that is not useful for anything and makes it easy to introduce
bugs.

This patch makes the default hooks to abort and summaries that do not
need dupicaito/insertion disable the corresponding hooks. I also
implemented missing insertion hook for ipa-sra which forced me to move
analysis out of anonymous namespace.

2020-10-23  Jan Hubicka  <hubicka@ucw.cz>

* cgraph.h (struct cgraph_node): Make ipa_transforms_to_apply vl_ptr.
* ipa-inline-analysis.c (initialize_growth_caches): Disable insertion
and duplication hooks.
* ipa-inline-transform.c (clone_inlined_nodes): Clear
ipa_transforms_to_apply.
(save_inline_function_body): Disable insertion hoook for
ipa_saved_clone_sources.
* ipa-prop.c (ipcp_transformation_initialize): Disable insertion hook.
* ipa-prop.h (ipa_node_params_t): Disable insertion hook.
* ipa-reference.c (propagate): Disable insertion hoook.
* ipa-sra.c (ipa_sra_summarize_function): Move out of anonymous
namespace.
(ipa_sra_function_summaries::insert): New virtual function.
* passes.c (execute_one_pass): Do not add transforms to inline clones.
* symbol-summary.h (function_summary_base): Make insert and duplicate
hooks fail instead of silently producing empty summaries; add way to
disable duplication hooks
(call_summary_base): Likewise.
* tree-nested.c (nested_function_info::get_create): Disable insertion
hooks
(maybe_record_nested_function): Likewise.
gcc/cgraph.h
gcc/ipa-inline-analysis.c
gcc/ipa-inline-transform.c
gcc/ipa-prop.c
gcc/ipa-prop.h
gcc/ipa-reference.c
gcc/ipa-sra.c
gcc/passes.c
gcc/symbol-summary.h
gcc/tree-nested.c