Commit e6007a27 by Jan Hubicka Committed by Jan Hubicka

ipa-inline.c (can_inline_edge_p): Pass caller info to ultiimate_alias_target.


	* ipa-inline.c (can_inline_edge_p): Pass caller info to
	ultiimate_alias_target.
	(update_callee_keys): Likewise.
	(lookup_recursive_calls): Likewise.
	(speculation_useful_p): Likewise.

From-SVN: r235319
parent a2b056a3
2016-04-20 Jan Hubicka <jh@suse.cz> 2016-04-20 Jan Hubicka <jh@suse.cz>
* ipa-inline.c (can_inline_edge_p): Pass caller info to
ultiimate_alias_target.
(update_callee_keys): Likewise.
(lookup_recursive_calls): Likewise.
(speculation_useful_p): Likewise.
2016-04-20 Jan Hubicka <jh@suse.cz>
PR ipa/70018 PR ipa/70018
* cgraph.c (cgraph_set_nothrow_flag_1): Rename to ... * cgraph.c (cgraph_set_nothrow_flag_1): Rename to ...
(set_nothrow_flag_1): ... this; handle interposition correctly; (set_nothrow_flag_1): ... this; handle interposition correctly;
......
...@@ -313,9 +313,9 @@ can_inline_edge_p (struct cgraph_edge *e, bool report, ...@@ -313,9 +313,9 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,
bool inlinable = true; bool inlinable = true;
enum availability avail; enum availability avail;
cgraph_node *callee = e->callee->ultimate_alias_target (&avail);
cgraph_node *caller = e->caller->global.inlined_to cgraph_node *caller = e->caller->global.inlined_to
? e->caller->global.inlined_to : e->caller; ? e->caller->global.inlined_to : e->caller;
cgraph_node *callee = e->callee->ultimate_alias_target (&avail, caller);
tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (caller->decl); tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (caller->decl);
tree callee_tree tree callee_tree
= callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL; = callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL;
...@@ -1382,7 +1382,7 @@ update_callee_keys (edge_heap_t *heap, struct cgraph_node *node, ...@@ -1382,7 +1382,7 @@ update_callee_keys (edge_heap_t *heap, struct cgraph_node *node,
growth chould have just increased and consequentely badness metric growth chould have just increased and consequentely badness metric
don't need updating. */ don't need updating. */
if (e->inline_failed if (e->inline_failed
&& (callee = e->callee->ultimate_alias_target (&avail)) && (callee = e->callee->ultimate_alias_target (&avail, e->caller))
&& inline_summaries->get (callee)->inlinable && inline_summaries->get (callee)->inlinable
&& avail >= AVAIL_AVAILABLE && avail >= AVAIL_AVAILABLE
&& !bitmap_bit_p (updated_nodes, callee->uid)) && !bitmap_bit_p (updated_nodes, callee->uid))
...@@ -1425,7 +1425,7 @@ lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where, ...@@ -1425,7 +1425,7 @@ lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where,
for (e = where->callees; e; e = e->next_callee) for (e = where->callees; e; e = e->next_callee)
if (e->callee == node if (e->callee == node
|| (e->callee->ultimate_alias_target (&avail) == node || (e->callee->ultimate_alias_target (&avail, e->caller) == node
&& avail > AVAIL_INTERPOSABLE)) && avail > AVAIL_INTERPOSABLE))
{ {
/* When profile feedback is available, prioritize by expected number /* When profile feedback is available, prioritize by expected number
...@@ -1624,7 +1624,8 @@ bool ...@@ -1624,7 +1624,8 @@ bool
speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining) speculation_useful_p (struct cgraph_edge *e, bool anticipate_inlining)
{ {
enum availability avail; enum availability avail;
struct cgraph_node *target = e->callee->ultimate_alias_target (&avail); struct cgraph_node *target = e->callee->ultimate_alias_target (&avail,
e->caller);
struct cgraph_edge *direct, *indirect; struct cgraph_edge *direct, *indirect;
struct ipa_ref *ref; struct ipa_ref *ref;
......
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