From 97e59627567757759b047479c75be2f238ea45c3 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 10 Jun 2019 13:07:24 +0200 Subject: Reduce SCCs in IPA postorder. 2019-06-10 Martin Liska * ipa-cp.c (ignore_edge_p): New function. (build_toporder_info): Use it. * ipa-inline.c (ignore_edge_p): New function/ (inline_small_functions): Use it. * ipa-pure-const.c (ignore_edge_for_nothrow): Verify opt_for_fn for caller and callee. (ignore_edge_for_pure_const): Likewise. * ipa-reference.c (ignore_edge_p): Extend to check for opt_for_fn. * ipa-utils.c (searchc): Refactor. * ipa-utils.h: Fix coding style. From-SVN: r272115 --- gcc/ipa-reference.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gcc/ipa-reference.c') diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 9ef03c2..7b2614f 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -676,16 +676,23 @@ get_read_write_all_from_node (struct cgraph_node *node, } } -/* Skip edges from and to nodes without ipa_reference enables. This leave - them out of strongy connected coponents and makes them easyto skip in the +/* Skip edges from and to nodes without ipa_reference enabled. + Ignore not available symbols. This leave + them out of strongly connected components and makes them easy to skip in the propagation loop bellow. */ static bool ignore_edge_p (cgraph_edge *e) { - return (!opt_for_fn (e->caller->decl, flag_ipa_reference) - || !opt_for_fn (e->callee->function_symbol ()->decl, - flag_ipa_reference)); + enum availability avail; + cgraph_node *ultimate_target + = e->callee->function_or_virtual_thunk_symbol (&avail, e->caller); + + return (avail < AVAIL_INTERPOSABLE + || (avail == AVAIL_INTERPOSABLE + && !(flags_from_decl_or_type (e->callee->decl) & ECF_LEAF)) + || !opt_for_fn (e->caller->decl, flag_ipa_reference) + || !opt_for_fn (ultimate_target->decl, flag_ipa_reference)); } /* Produce the global information by preforming a transitive closure -- cgit v1.1