aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-06-10 13:07:24 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-06-10 11:07:24 +0000
commit97e59627567757759b047479c75be2f238ea45c3 (patch)
tree6ab525ca7d4657f2ef09734d2df43aa84ed4caf4 /gcc/ipa-reference.c
parent54e2d83caf591eb1ca3e6e8df44d67a4ac44d8fe (diff)
downloadgcc-97e59627567757759b047479c75be2f238ea45c3.zip
gcc-97e59627567757759b047479c75be2f238ea45c3.tar.gz
gcc-97e59627567757759b047479c75be2f238ea45c3.tar.bz2
Reduce SCCs in IPA postorder.
2019-06-10 Martin Liska <mliska@suse.cz> * 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
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c17
1 files changed, 12 insertions, 5 deletions
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