diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2018-12-04 22:38:01 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2018-12-04 21:38:01 +0000 |
commit | 7b377b221075723021fafc1a2942a1dc15cf5953 (patch) | |
tree | 0720f8ba9532f427706cf1b3e7671730ea889f15 /gcc | |
parent | 206d8779eb286b3bdbfab5723a5265357ccf33b3 (diff) | |
download | gcc-7b377b221075723021fafc1a2942a1dc15cf5953.zip gcc-7b377b221075723021fafc1a2942a1dc15cf5953.tar.gz gcc-7b377b221075723021fafc1a2942a1dc15cf5953.tar.bz2 |
ipa-prop.c (jump_function_useful_p): New.
* ipa-prop.c (jump_function_useful_p): New.
(ipa_read_node_info): Do not allocated useless jump functions.
From-SVN: r266799
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 34 |
2 files changed, 39 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 795dbb1..baf3825 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-12-04 Jan Hubicka <hubicka@ucw.cz> + + * ipa-prop.c (jump_function_useful_p): New. + (ipa_read_node_info): Do not allocated useless jump functions. + 2018-12-04 David Malcolm <dmalcolm@redhat.com> PR c/82967 diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 7405235..f19b3ab 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -4344,6 +4344,26 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node) } } +/* If jump functions points to node we possibly can propagate into. + At this moment symbol table is still not merged, but the prevailing + symbol is always first in the list. */ + +static bool +jump_function_useful_p (symtab_node *node) +{ + /* While incremental linking we may end up getting function body later. */ + if (flag_incremental_link == INCREMENTAL_LINK_LTO) + return true; + if (!TREE_PUBLIC (node->decl) && !DECL_EXTERNAL (node->decl)) + return true; + for (int n = 10; node->previous_sharing_asm_name && n ; n--) + node = node->previous_sharing_asm_name; + if (node->previous_sharing_asm_name) + node = symtab_node::get_for_asmname (DECL_ASSEMBLER_NAME (node->decl)); + gcc_assert (TREE_PUBLIC (node->decl)); + return node->definition; +} + /* Stream in NODE info from IB. */ static void @@ -4380,6 +4400,20 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node, if (!count) continue; + if (!jump_function_useful_p (e->callee)) + { + for (k = 0; k < count; k++) + { + struct ipa_jump_func dummy; + ipa_read_jump_function (ib, &dummy, e, data_in); + if (contexts_computed) + { + struct ipa_polymorphic_call_context ctx; + ctx.stream_in (ib, data_in); + } + } + continue; + } vec_safe_grow_cleared (args->jump_functions, count); if (contexts_computed) vec_safe_grow_cleared (args->polymorphic_call_contexts, count); |