Enable recursive function versioning

Programming / Compilers / GCC - fxue [138bc75d-0d04-0410-961f-82ee72b054a4] - 2 December 2019 06:37 EST

2019-12-02 Feng Xue

PR ipa/92133
- doc/invoke.texi (ipa-cp-max-recursive-depth): Document new option. (ipa-cp-min-recursive-probability): Likewise.
- params.opt (ipa-cp-max-recursive-depth): New. (ipa-cp-min-recursive-probability): Likewise.
- ipa-cp.c (ipcp_lattice::add_value): Add two new parameters
val_p and unlimited. (self_recursively_generated_p): New function. (get_val_across_arith_op): Likewise. (propagate_vals_across_arith_jfunc): Add constant propagation for self-recursive function. (incorporate_penalties): Do not penalize pure self-recursive function. (good_cloning_opportunity_p): Dump node_is_self_scc flag. (propagate_constants_topo): Set node_is_self_scc flag for cgraph node. (get_info_about_necessary_edges): Relax hotness check for edge to self-recursive function.
- ipa-prop.h (ipa_node_params): Add new field node_is_self_scc.

2019-12-02 Feng Xue

PR ipa/92133
- gcc.dg/ipa/ipa-clone-2.c: New test.

a4c29c23bb8 Enable recursive function versioning
gcc/ChangeLog | 20 +++
gcc/doc/invoke.texi | 7 ++
gcc/ipa-cp.c | 221 +++++++++++++++++++++++++++++----
gcc/ipa-prop.h | 2 +
gcc/params.opt | 8 ++
gcc/testsuite/ChangeLog | 5 +
gcc/testsuite/gcc.dg/ipa/ipa-clone-2.c | 47 +++++++
7 files changed, 283 insertions(+), 27 deletions(-)

Upstream: gcc.gnu.org


  • Share