Commit ebc8f0bb by Jan Hubicka Committed by Jan Hubicka

ipa-inline-analysis.c (simple_edge_hints): Fix check for cross-module inlining.

	* ipa-inline-analysis.c (simple_edge_hints): Fix check for
	cross-module inlining.
	* cgraph.h (cgraph_node): Add flag merged.
	* ipa-icf.c (sem_function::merge): Maintain it.

	* lto-symtab.c (lto_cgraph_replace_node): Maintain merged flag.

From-SVN: r220372
parent 901e59b2
2015-02-03 Jan Hubicka <hubicka@ucw.cz>
* ipa-inline-analysis.c (simple_edge_hints): Fix check for
cross-module inlining.
* cgraph.h (cgraph_node): Add flag merged.
* ipa-icf.c (sem_function::merge): Maintain it.
2015-02-03 Richard Sandiford <richard.sandiford@arm.com> 2015-02-03 Richard Sandiford <richard.sandiford@arm.com>
* config/arm/arm.c (thumb2_reorg): Test UNARY_P and BINARY_P * config/arm/arm.c (thumb2_reorg): Test UNARY_P and BINARY_P
......
...@@ -1296,6 +1296,8 @@ public: ...@@ -1296,6 +1296,8 @@ public:
other operation that could make previously non-trapping memory other operation that could make previously non-trapping memory
accesses trapping. */ accesses trapping. */
unsigned nonfreeing_fn : 1; unsigned nonfreeing_fn : 1;
/* True if there was multiple COMDAT bodies merged by lto-symtab. */
unsigned merged : 1;
}; };
/* A cgraph node set is a collection of cgraph nodes. A cgraph node /* A cgraph node set is a collection of cgraph nodes. A cgraph node
......
...@@ -711,6 +711,10 @@ sem_function::merge (sem_item *alias_item) ...@@ -711,6 +711,10 @@ sem_function::merge (sem_item *alias_item)
} }
alias->icf_merged = true; alias->icf_merged = true;
if (local_original->lto_file_data
&& alias->lto_file_data
&& local_original->lto_file_data != alias->lto_file_data)
local_original->merged = true;
/* The alias function is removed if symbol address /* The alias function is removed if symbol address
does not matter. */ does not matter. */
...@@ -725,6 +729,10 @@ sem_function::merge (sem_item *alias_item) ...@@ -725,6 +729,10 @@ sem_function::merge (sem_item *alias_item)
else if (create_alias) else if (create_alias)
{ {
alias->icf_merged = true; alias->icf_merged = true;
if (local_original->lto_file_data
&& alias->lto_file_data
&& local_original->lto_file_data != alias->lto_file_data)
local_original->merged = true;
/* Remove the function's body. */ /* Remove the function's body. */
ipa_merge_profiles (original, alias); ipa_merge_profiles (original, alias);
...@@ -762,6 +770,10 @@ sem_function::merge (sem_item *alias_item) ...@@ -762,6 +770,10 @@ sem_function::merge (sem_item *alias_item)
} }
alias->icf_merged = true; alias->icf_merged = true;
if (local_original->lto_file_data
&& alias->lto_file_data
&& local_original->lto_file_data != alias->lto_file_data)
local_original->merged = true;
ipa_merge_profiles (local_original, alias, true); ipa_merge_profiles (local_original, alias, true);
alias->create_wrapper (local_original); alias->create_wrapper (local_original);
......
...@@ -3702,13 +3702,16 @@ simple_edge_hints (struct cgraph_edge *edge) ...@@ -3702,13 +3702,16 @@ simple_edge_hints (struct cgraph_edge *edge)
int hints = 0; int hints = 0;
struct cgraph_node *to = (edge->caller->global.inlined_to struct cgraph_node *to = (edge->caller->global.inlined_to
? edge->caller->global.inlined_to : edge->caller); ? edge->caller->global.inlined_to : edge->caller);
struct cgraph_node *callee = edge->callee->ultimate_alias_target ();
if (inline_summaries->get (to)->scc_no if (inline_summaries->get (to)->scc_no
&& inline_summaries->get (to)->scc_no == inline_summaries->get (edge->callee)->scc_no && inline_summaries->get (to)->scc_no
== inline_summaries->get (callee)->scc_no
&& !edge->recursive_p ()) && !edge->recursive_p ())
hints |= INLINE_HINT_same_scc; hints |= INLINE_HINT_same_scc;
if (to->lto_file_data && edge->callee->lto_file_data if (callee->lto_file_data && edge->caller->lto_file_data
&& to->lto_file_data != edge->callee->lto_file_data) && edge->caller->lto_file_data != callee->lto_file_data
&& !callee->merged)
hints |= INLINE_HINT_cross_module; hints |= INLINE_HINT_cross_module;
return hints; return hints;
......
2015-02-03 Jan Hubicka <hubicka@ucw.cz>
* lto-symtab.c (lto_cgraph_replace_node): Maintain merged flag.
2015-01-30 Joseph Myers <joseph@codesourcery.com> 2015-01-30 Joseph Myers <joseph@codesourcery.com>
* lto-object.c, lto-symtab.c, lto.c: All callers of fatal_error * lto-object.c, lto-symtab.c, lto.c: All callers of fatal_error
......
...@@ -88,6 +88,8 @@ lto_cgraph_replace_node (struct cgraph_node *node, ...@@ -88,6 +88,8 @@ lto_cgraph_replace_node (struct cgraph_node *node,
gcc_assert (!prevailing_node->global.inlined_to); gcc_assert (!prevailing_node->global.inlined_to);
prevailing_node->mark_address_taken (); prevailing_node->mark_address_taken ();
} }
if (node->definition && prevailing_node->definition)
prevailing_node->merged = true;
/* Redirect all incoming edges. */ /* Redirect all incoming edges. */
compatible_p compatible_p
......
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