aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@linux.alibaba.com>2018-12-10 07:02:49 +0000
committerBin Cheng <amker@gcc.gnu.org>2018-12-10 07:02:49 +0000
commit1dc7836cdda611e476f2c4f82317662f7f85f101 (patch)
tree62811a47c6e2ab78db0c358940725d77e1fe6afe /gcc
parent395bc8ad4b750607b040653ef1c799d18296e3ff (diff)
downloadgcc-1dc7836cdda611e476f2c4f82317662f7f85f101.zip
gcc-1dc7836cdda611e476f2c4f82317662f7f85f101.tar.gz
gcc-1dc7836cdda611e476f2c4f82317662f7f85f101.tar.bz2
auto-profile.c (afdo_calculate_branch_prob): Convert profile_count to afdo precision quality.
* 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. From-SVN: r266943
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/auto-profile.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ac767e..bffa8e2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
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)
(function_instance::get_function_instance_by_decl): Avoid infinite
recursion by using DECL_FROM_INLINE.
diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c
index 9316f4c..cde4f41 100644
--- a/gcc/auto-profile.c
+++ b/gcc/auto-profile.c
@@ -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;
}