diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-03-04 21:28:08 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-03-04 20:28:08 +0000 |
commit | a6a543bfa860d89ca4fb5734233ede5796b10103 (patch) | |
tree | 2724c9b62285c2c1dc7ecae0dea0d9cc465c8847 /gcc/ipa-inline-analysis.c | |
parent | d720e658eba57e78e8493d9126921bd4f07130b0 (diff) | |
download | gcc-a6a543bfa860d89ca4fb5734233ede5796b10103.zip gcc-a6a543bfa860d89ca4fb5734233ede5796b10103.tar.gz gcc-a6a543bfa860d89ca4fb5734233ede5796b10103.tar.bz2 |
cgraph.c (cgraph_node::can_remove_if_no_direct_calls_p): Rewrite for correct comdat handling.
* cgraph.c (cgraph_node::can_remove_if_no_direct_calls_p): Rewrite
for correct comdat handling.
(cgraph_node::will_be_removed_from_program_if_no_direct_calls_p):
Likewise.
* cgraph.h (call_for_symbol_and_aliases): Fix formating.
(used_from_object_file_p_worker): Remove.
(cgraph_node::only_called_directly_or_alised): Add
used_from_object_file_p.
* ipa-inline-analysis.c (growth_likely_positive): Optimie.
* ipa-inline-transform.c (can_remove_node_now_p_1): Use
can_remove_if_no_direct_calls_and_refs_p.
From-SVN: r221193
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r-- | gcc/ipa-inline-analysis.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 7a9c99c..d747163 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -4007,6 +4007,8 @@ growth_likely_positive (struct cgraph_node *node, struct cgraph_edge *e; gcc_checking_assert (edge_growth > 0); + if (DECL_EXTERNAL (node->decl)) + return true; /* Unlike for functions called once, we play unsafe with COMDATs. We can allow that since we know functions in consideration are small (and thus risk is small) and @@ -4014,18 +4016,13 @@ growth_likely_positive (struct cgraph_node *node, functions may or may not disappear when eliminated from current unit. With good probability making aggressive choice in all units is going to make overall program - smaller. - - Consequently we ask cgraph_can_remove_if_no_direct_calls_p - instead of - cgraph_will_be_removed_from_program_if_no_direct_calls */ - if (DECL_EXTERNAL (node->decl) - || !node->can_remove_if_no_direct_calls_p ()) - return true; - - if (!node->will_be_removed_from_program_if_no_direct_calls_p () - && (!DECL_COMDAT (node->decl) - || !node->can_remove_if_no_direct_calls_p ())) + smaller. */ + if (DECL_COMDAT (node->decl)) + { + if (!node->can_remove_if_no_direct_calls_p ()) + return true; + } + else if (!node->will_be_removed_from_program_if_no_direct_calls_p ()) return true; max_callers = inline_summaries->get (node)->size * 4 / edge_growth + 2; |