predict.c (compute_function_frequency): Check for presence of IPA profile.
authorJan Hubicka <hubicka@ucw.cz>
Tue, 10 Dec 2019 17:47:28 +0000 (18:47 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 10 Dec 2019 17:47:28 +0000 (17:47 +0000)
* predict.c (compute_function_frequency): Check for presence of IPA
profile.

From-SVN: r279177

gcc/ChangeLog
gcc/predict.c

index 627d1bc0d718a685b3ca26fc374bf11b3715e39c..76da7318741af2ed937eb4d7a372d08f7f004cb2 100644 (file)
@@ -1,3 +1,8 @@
+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
index 8db24816d2939dfcb7923b456a3b971ccdca3a91..4b5b77e78d2dcb440bd8208510c30c2354cbbf67 100644 (file)
@@ -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);