diff options
author | Xiong Hu Luo <luoxhu@linux.ibm.com> | 2019-07-25 09:20:13 +0000 |
---|---|---|
committer | Xiong Hu Luo <luoxhu@gcc.gnu.org> | 2019-07-25 09:20:13 +0000 |
commit | 982b149787057bb288caed389f231c4979e969dc (patch) | |
tree | 2a07f4c7042d98ef450b5c6e62c0f08bb7e143f4 /gcc/ipa-profile.c | |
parent | 25b46fc9185402b36eeab7e2ec12931bfec378ba (diff) |
Generalize get_most_common_single_value to return n_th value & count
Currently get_most_common_single_value could only return the max hist
<value, count>, add sort after reading from disk, then it return nth value
in later use. Rename it to get_nth_most_common_value.
gcc/ChangeLog:
2019-07-15 Xiong Hu Luo <luoxhu@linux.ibm.com>
* ipa-profile.c (get_most_common_single_value): Use
get_nth_most_common_value.
* profile.c (sort_hist_value): New function.
(compute_value_histograms): Call sort_hist_value to sort the
values after loading from disk.
* value-prof.c (get_most_common_single_value): Rename to ...
get_nth_most_common_value. Add input params n, return
the n_th value and count.
(gimple_divmod_fixed_value_transform): Use
get_nth_most_common_value.
(gimple_ic_transform): Likewise.
(gimple_stringops_transform): Likewise.
* value-prof.h (get_most_common_single_value): Add input params
n, default to 0.
From-SVN: r273789
Diffstat (limited to 'gcc/ipa-profile.c')
-rw-r--r-- | gcc/ipa-profile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index 1fb939b73d0..970dba39c80 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -192,8 +192,8 @@ ipa_profile_generate_summary (void) if (h) { gcov_type val, count, all; - if (get_most_common_single_value (NULL, "indirect call", - h, &val, &count, &all)) + if (get_nth_most_common_value (NULL, "indirect call", h, + &val, &count, &all)) { struct cgraph_edge * e = node->get_edge (stmt); if (e && !e->indirect_unknown_callee) |