Commit f95ff97f by Nathan Sidwell Committed by Nathan Sidwell

ipa-visibility.c (can_replace_by_local_alias): Make static, check ASM_OUTPUT_DEF.

	* ipa-visibility.c (can_replace_by_local_alias): Make static,
	check ASM_OUTPUT_DEF.
	(can_replace_by_local_alias_in_vtable): Make static.
	(function_and_variable_visibility): Reformat overlong comment.

From-SVN: r231721
parent 60b5526f
2015-12-16 Nathan Sidwell <nathan@acm.org>
* ipa-visibility.c (can_replace_by_local_alias): Make static,
check ASM_OUTPUT_DEF.
(can_replace_by_local_alias_in_vtable): Make static.
(function_and_variable_visibility): Reformat overlong comment.
2015-12-16 Jeff Law <law@redhat.com> 2015-12-16 Jeff Law <law@redhat.com>
* ree.c (add_removable_extension): Use reg_overlap_mentioned_p * ree.c (add_removable_extension): Use reg_overlap_mentioned_p
...@@ -329,9 +329,13 @@ varpool_node::externally_visible_p (void) ...@@ -329,9 +329,13 @@ varpool_node::externally_visible_p (void)
Local aliases save dynamic linking overhead and enable more optimizations. Local aliases save dynamic linking overhead and enable more optimizations.
*/ */
bool static bool
can_replace_by_local_alias (symtab_node *node) can_replace_by_local_alias (symtab_node *node)
{ {
#ifndef ASM_OUTPUT_DEF
/* If aliases aren't supported, we can't do replacement. */
return false;
#endif
/* Weakrefs have a reason to be non-local. Be sure we do not replace /* Weakrefs have a reason to be non-local. Be sure we do not replace
them. */ them. */
while (node->transparent_alias && node->definition && !node->weakref) while (node->transparent_alias && node->definition && !node->weakref)
...@@ -344,11 +348,11 @@ can_replace_by_local_alias (symtab_node *node) ...@@ -344,11 +348,11 @@ can_replace_by_local_alias (symtab_node *node)
&& !node->can_be_discarded_p ()); && !node->can_be_discarded_p ());
} }
/* Return true if we can replace refernece to NODE by local alias /* Return true if we can replace reference to NODE by local alias
within a virtual table. Generally we can replace function pointers within a virtual table. Generally we can replace function pointers
and virtual table pointers. */ and virtual table pointers. */
bool static bool
can_replace_by_local_alias_in_vtable (symtab_node *node) can_replace_by_local_alias_in_vtable (symtab_node *node)
{ {
if (is_a <varpool_node *> (node) if (is_a <varpool_node *> (node)
...@@ -592,10 +596,11 @@ function_and_variable_visibility (bool whole_program) ...@@ -592,10 +596,11 @@ function_and_variable_visibility (bool whole_program)
if (!node->local.local) if (!node->local.local)
node->local.local |= node->local_p (); node->local.local |= node->local_p ();
/* If we know that function can not be overwritten by a different semantics /* If we know that function can not be overwritten by a
and moreover its section can not be discarded, replace all direct calls different semantics and moreover its section can not be
by calls to an noninterposable alias. This make dynamic linking discarded, replace all direct calls by calls to an
cheaper and enable more optimization. noninterposable alias. This make dynamic linking cheaper and
enable more optimization.
TODO: We can also update virtual tables. */ TODO: We can also update virtual tables. */
if (node->callers if (node->callers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment