Cleanup ipa-modref
this is largely mechanical patch fixing some suboptimal datastructure decision
in modref. It records three different things
1) optimization_summaries that are used by tree-ssa-alias to disambiguate
(computed by local passes or ipa execute)
2) summaries produced by local analysis and used by the ipa execute
3) summaries_lto produced by analysis when streaming is expected,
streamed, used by ipa execute
All three items are stored in "summaries" datastructure where 1 dn 2
are mixed and differentiated by "finished" flags.
This use extra memory and also makes it impossible to use modref while producing
other IPA summaries (by ipa-prop and ipa-devirt). This patch separates the
summaries into three special purpose datastructures.
There is one fix to propagation in ipa_merge_modref_summary_after_inlining
where check to ignore stores was placed incorrectly. This seems to lead
to increased clobber disambiguations:
Alias oracle query stats:
refs_may_alias_p:
64267006 disambiguations,
74475486 queries
ref_maybe_used_by_call_p: 142119 disambiguations,
65169365 queries
call_may_clobber_ref_p: 22975 disambiguations, 28762 queries
nonoverlapping_component_refs_p: 0 disambiguations, 36803 queries
nonoverlapping_refs_since_match_p: 19401 disambiguations, 55550 must overlaps, 75722 queries
aliasing_component_refs_p: 54714 disambiguations, 759027 queries
TBAA oracle:
23636760 disambiguations
56001742 queries
16112157 are in alias set 0
10614737 queries asked about the same object
125 queries asked about the same alias set
0 access volatile
3994423 are dependent in the DAG
1643540 are aritificially in conflict with void *
Modref stats:
modref use: 11667 disambiguations, 40207 queries
modref clobber:
1508990 disambiguations,
1829697 queries
3916688 tbaa queries (2.140621 per modref query)
623504 base compares (0.340769 per modref query)
PTA query stats:
pt_solution_includes: 967354 disambiguations,
13605701 queries
pt_solutions_intersect:
1032982 disambiguations,
13121107 queries
Bootstrapped/regtested x86_64-linux. I plan to commit it tomorrow if there are
no complains.
gcc/ChangeLog:
2020-10-11 Jan Hubicka <hubicka@ucw.cz>
* ipa-modref.c (modref_summaries): Remove field IPA.
(class modref_summary_lto): New global variable.
(class modref_summaries_lto): New.
(modref_summary::modref_summary): Remove loads_lto and stores_lto.
(modref_summary::~modref_summary): Remove loads_lto and stores_lto.
(modref_summary::useful_p): Do not use lto_useful.
(modref_records_lto): New typedef.
(struct modref_summary_lto): New type.
(modref_summary_lto::modref_summary_lto): New member function.
(modref_summary_lto::~modref_summary_lto): New member function.
(modref_summary_lto::useful_p): New member function.
(modref_summary::dump): Do not handle lto.
(modref_summary_lto::dump): New member function.
(get_modref_function_summary): Use optimization_summary.
(merge_call_side_effects): Use optimization_summary.
(analyze_call): Use optimization_summary.
(struct summary_ptrs): New struture.
(analyze_load): Update to handle separate lto and non-lto summaries.
(analyze_store): Likewise.
(analyze_stmt): Likewise.
(remove_summary): Break out from ...
(analyze_function): ... here; update to handle seprated summaries.
(modref_summaries::insert): Do not handle lto summary.
(modref_summaries_lto::insert): New member function.
(modref_summaries::duplicate): Do not handle lto summary.
(modref_summaries_lto::duplicate): New member function.
(read_modref_records): Expect nolto_ret or lto_ret to be NULL>
(modref_write): Write lto summary.
(read_section): Handle separated summaries.
(modref_read): Initialize separated summaries.
(modref_transform): Handle separated summaries.
(pass_modref::execute): Turn summary to optimization_summary; handle
separate summaries.
(ignore_edge): Handle separate summaries.
(ipa_merge_modref_summary_after_inlining): Likewise.
(collapse_loads): Likewise.
(modref_propagate_in_scc): Likewise.
(pass_ipa_modref::execute): Likewise.
(ipa_modref_c_finalize): Likewise.
* ipa-modref.h (modref_records_lto): Remove typedef.
(struct modref_summary): Remove stores_lto, loads_lto and finished
fields; remove lto_useful_p member function.