Commit c3f1ae8a by Jan Hubicka Committed by Jan Hubicka

Prevent inconsistent profiles to be created in inlin_transform

	* ipa-inline-transform.c (inline_transform): Scale profile before
	redirecting.

From-SVN: r278814
parent 97dd1ee8
2019-11-28 Jan Hubicka <hubicka@ucw.cz> 2019-11-28 Jan Hubicka <hubicka@ucw.cz>
* ipa-inline-transform.c (inline_transform): Scale profile before
redirecting.
2019-11-28 Jan Hubicka <hubicka@ucw.cz>
* profile-count.h (profile_count::max): Work on profiles of different * profile-count.h (profile_count::max): Work on profiles of different
type. type.
(profile_count::apply_scale): Be sure that ret is not local or global0 (profile_count::apply_scale): Be sure that ret is not local or global0
...@@ -681,18 +681,6 @@ inline_transform (struct cgraph_node *node) ...@@ -681,18 +681,6 @@ inline_transform (struct cgraph_node *node)
if (preserve_function_body_p (node)) if (preserve_function_body_p (node))
save_inline_function_body (node); save_inline_function_body (node);
for (e = node->callees; e; e = next)
{
if (!e->inline_failed)
has_inline = true;
next = e->next_callee;
e->redirect_call_stmt_to_callee ();
}
node->remove_all_references ();
timevar_push (TV_INTEGRATION);
if (node->callees && (opt_for_fn (node->decl, optimize) || has_inline))
{
profile_count num = node->count; profile_count num = node->count;
profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count; profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
bool scale = num.initialized_p () && !(num == den); bool scale = num.initialized_p () && !(num == den);
...@@ -717,6 +705,19 @@ inline_transform (struct cgraph_node *node) ...@@ -717,6 +705,19 @@ inline_transform (struct cgraph_node *node)
} }
ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = node->count; ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = node->count;
} }
for (e = node->callees; e; e = next)
{
if (!e->inline_failed)
has_inline = true;
next = e->next_callee;
e->redirect_call_stmt_to_callee ();
}
node->remove_all_references ();
timevar_push (TV_INTEGRATION);
if (node->callees && (opt_for_fn (node->decl, optimize) || has_inline))
{
todo = optimize_inline_calls (current_function_decl); todo = optimize_inline_calls (current_function_decl);
} }
timevar_pop (TV_INTEGRATION); timevar_pop (TV_INTEGRATION);
......
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