aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-12-10 18:47:28 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-12-10 17:47:28 +0000
commit066564270000d608114fdea89cfbf58c69f68845 (patch)
treea5d84230d458d8c7f49569aad7d94c200fe7a5e6
parent12651dc6dcaafb3c8a5cdfc10b7bc25e6f62cb33 (diff)
downloadgcc-066564270000d608114fdea89cfbf58c69f68845.zip
gcc-066564270000d608114fdea89cfbf58c69f68845.tar.gz
gcc-066564270000d608114fdea89cfbf58c69f68845.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/predict.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 627d1bc..76da731 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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
tp_first_run reordering.
diff --git a/gcc/predict.c b/gcc/predict.c
index 8db2481..4b5b77e 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -3932,13 +3932,11 @@ compute_function_frequency (void)
if (DECL_STATIC_DESTRUCTOR (current_function_decl))
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);
- if ((ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa_p ()
- && ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa() == profile_count::zero ())
- || lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
- != NULL)
+ if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
+ != NULL)
{
node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
warn_function_cold (current_function_decl);