handle retslot in modref
authorJan Hubicka <hubicka@ucw.cz>
Fri, 29 Oct 2021 14:01:51 +0000 (16:01 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Fri, 29 Oct 2021 14:01:51 +0000 (16:01 +0200)
commitb8ef019ab938471f7f877a1eee3a6374fd8a6ae9
treed7bf60ed504c5a2116becd99e9c9f88d7a4ba63c
parent4045d5fa42f2ee7b284977c8f2f0edc300a63e43
handle retslot in modref

Extend modref and tree-ssa-structalias to handle retslot flags.
Since retslot it essentially a hidden argument that is known to be write-only
we can do pretty much the same stuff as we do for regular parameters.
I plan to add static chain handling similar way.

We do not handle IPA propagation of retslot flags (where return slot is
initialized via return slot of other function). For this ipa-prop needs
to be extended to understand retslot as well.

Bootstrapped/regtested x86_64-linux, OK for the gimple bits?

Honza

gcc/ChangeLog:

* gimple.c (gimple_call_retslot_flags): New function.
* gimple.h (gimple_call_retslot_flags): Declare.
* ipa-modref.c: Include tree-cfg.h.
(struct escape_entry): Turn parm_index to signed.
(modref_summary_lto::modref_summary_lto): Add retslot_flags.
(modref_summary::modref_summary): Initialize retslot_flags.
(struct modref_summary_lto): Likewise.
(modref_summary::useful_p): Check retslot_flags.
(modref_summary_lto::useful_p): Likewise.
(modref_summary::dump): Dump retslot_flags.
(modref_summary_lto::dump): Likewise.
(struct escape_point): Add hidden_args enum.
(analyze_ssa_name_flags): Ignore return slot return;
use gimple_call_retslot_flags.
(record_escape_points): Break out from ...
(analyze_parms): ... here; handle retslot_flags.
(modref_summaries::duplicate): Duplicate retslot_flags.
(modref_summaries_lto::duplicate): Likewise.
(modref_write_escape_summary): Stream parm_index as signed.
(modref_read_escape_summary): Likewise.
(modref_write): Stream retslot_flags.
(read_section): Likewise.
(struct escape_map): Fix typo in comment.
(update_escape_summary_1): Fix whitespace.
(ipa_merge_modref_summary_after_inlining): Drop retslot_flags.
(modref_merge_call_site_flags): Merge retslot_flags.
* ipa-modref.h (struct modref_summary): Add retslot_flags.
* tree-ssa-structalias.c (handle_rhs_call): Handle retslot_flags.
gcc/gimple.c
gcc/gimple.h
gcc/ipa-modref.c
gcc/ipa-modref.h
gcc/tree-ssa-structalias.c