]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* auto-profile.c (afdo_calculate_branch_prob): Convert profile_count
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Dec 2018 07:02:49 +0000 (07:02 +0000)
committeramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Dec 2018 07:02:49 +0000 (07:02 +0000)
to afdo precision quality.
(afdo_callsite_hot_enough_for_early_inline): Likewise.
(afdo_annotate_cfg): Set profile_count for exit basic block.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266943 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/auto-profile.c

index 6ac767e78175f40a6ece457c910b2bb1b899cd29..bffa8e295919d83cc7b68d2a90620bd79f0a48e3 100644 (file)
@@ -1,3 +1,10 @@
+2018-12-10  Bin Cheng  <bin.cheng@linux.alibaba.com>
+
+       * auto-profile.c (afdo_calculate_branch_prob): Convert profile_count
+       to afdo precision quality.
+       (afdo_callsite_hot_enough_for_early_inline): Likewise.
+       (afdo_annotate_cfg): Set profile_count for exit basic block.
+
 2018-12-10  Bin Cheng  <bin.cheng@linux.alibaba.com>
 
        * auto-profile.c (string_table::get_index_by_decl)
index 9316f4c477b97c18ea49eea66ea863f567e09d0b..cde4f41c1d922f527d3720133067c0a3226f4248 100644 (file)
@@ -1400,7 +1400,7 @@ afdo_calculate_branch_prob (bb_set *annotated_bb, edge_set *annotated_edge)
     edge e;
     edge_iterator ei;
     int num_unknown_succ = 0;
-    profile_count total_count = profile_count::zero ();
+    profile_count total_count = profile_count::zero ().afdo ();
 
     FOR_EACH_EDGE (e, ei, bb->succs)
     {
@@ -1507,6 +1507,7 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts)
      = profile_count::from_gcov_type (s->head_count ()).afdo ();
   ENTRY_BLOCK_PTR_FOR_FN (cfun)->count
      = profile_count::from_gcov_type (s->head_count ()).afdo ();
+  EXIT_BLOCK_PTR_FOR_FN (cfun)->count = profile_count::zero ().afdo ();
   profile_count max_count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
 
   FOR_EACH_BB_FN (bb, cfun)
@@ -1686,11 +1687,12 @@ afdo_callsite_hot_enough_for_early_inline (struct cgraph_edge *edge)
   if (count > 0)
     {
       bool is_hot;
+      profile_count pcount = profile_count::from_gcov_type (count).afdo ();
       gcov_summary *saved_profile_info = profile_info;
       /* At early inline stage, profile_info is not set yet. We need to
          temporarily set it to afdo_profile_info to calculate hotness.  */
       profile_info = autofdo::afdo_profile_info;
-      is_hot = maybe_hot_count_p (NULL, profile_count::from_gcov_type (count));
+      is_hot = maybe_hot_count_p (NULL, pcount);
       profile_info = saved_profile_info;
       return is_hot;
     }