Track arguments pointing to local or readonly memory in ipa-fnsummary
authorJan Hubicka <jh@suse.cz>
Sat, 26 Sep 2020 06:12:44 +0000 (08:12 +0200)
committerJan Hubicka <jh@suse.cz>
Sat, 26 Sep 2020 06:12:44 +0000 (08:12 +0200)
commitb89e4559950c79d8933013305c19d7014a39cdb1
treeb669a4d78420aed0632b161bf8ff2cb1cead65c8
parent5a90a18668fef8d51e5b3fe9f69123f53cbd8f25
Track arguments pointing to local or readonly memory in ipa-fnsummary

this patch implement tracking wehther argument points to readonly memory. This
is is useful for ipa-modref as well as for inline heuristics.  It is desirable
to inline functions that dereference pointers to local variables in order
to support SRA.  We always did the oposite heuristics (guessing that the
dereferences will be optimized out with 50% probability) but here we could
increase the probability for cases where we can track that argument is indeed
a local memory (or readonly which is also good)

* ipa-fnsummary.c (dump_ipa_call_summary): Dump
points_to_local_or_readonly_memory flag.
(analyze_function_body): Compute points_to_local_or_readonly_memory
flag.
(remap_edge_change_prob): Rename to ...
(remap_edge_params): ... this one; update
points_to_local_or_readonly_memory.
(remap_edge_summaries): Update.
(read_ipa_call_summary): Stream the new flag.
(write_ipa_call_summary): Likewise.
* ipa-predicate.h (struct inline_param_summary): Add
points_to_local_or_readonly_memory.
(inline_param_summary::equal_to): Update.
(inline_param_summary::useless_p): Update.
gcc/ipa-fnsummary.c
gcc/ipa-predicate.h