Commit 06656427 by Jan Hubicka Committed by Jan Hubicka

predict.c (compute_function_frequency): Check for presence of IPA profile.

	* predict.c (compute_function_frequency): Check for presence of IPA
	profile.

From-SVN: r279177
parent 12651dc6
2019-12-10 Jan Hubicka <hubicka@ucw.cz> 2019-12-10 Jan Hubicka <hubicka@ucw.cz>
* predict.c (compute_function_frequency): Check for presence of IPA
profile.
2019-12-10 Jan Hubicka <hubicka@ucw.cz>
* varasm.c (default_function_section): Fix confused tests for * varasm.c (default_function_section): Fix confused tests for
tp_first_run reordering. tp_first_run reordering.
...@@ -3932,13 +3932,11 @@ compute_function_frequency (void) ...@@ -3932,13 +3932,11 @@ compute_function_frequency (void)
if (DECL_STATIC_DESTRUCTOR (current_function_decl)) if (DECL_STATIC_DESTRUCTOR (current_function_decl))
node->only_called_at_exit = true; node->only_called_at_exit = true;
if (profile_status_for_fn (cfun) != PROFILE_READ) if (!ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa_p ())
{ {
int flags = flags_from_decl_or_type (current_function_decl); int flags = flags_from_decl_or_type (current_function_decl);
if ((ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa_p () if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
&& ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa() == profile_count::zero ()) != NULL)
|| lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
!= NULL)
{ {
node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED; node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
warn_function_cold (current_function_decl); warn_function_cold (current_function_decl);
......
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