This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] decide edge's hotness when there is profile info
- From: Dehao Chen <dehao at google dot com>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Mon, 14 Oct 2013 09:19:22 -0700
- Subject: Re: [PATCH] decide edge's hotness when there is profile info
- Authentication-results: sourceware.org; auth=none
- References: <CAO2gOZVX2QuoUGRy6uRiT4A+=xdeCXmq04tF0Qr1kqezP-y5-A at mail dot gmail dot com> <CAAkRFZLHHDgtfCQQE06O8NKMfSzQuXyweHSoBUwTWseUu7KTnQ at mail dot gmail dot com>
Not for instrumented FDO (not as I know of). But for AutoFDO, this
could be a potential risk because some callee is marked unlikely
executed simply because they are inlined and eliminated in the O2
binary. But in ipa-inline it will not get inlined because the edge is
not hot from cgraph_maybe_hot_edge_p (because callee is
UNLIKELY_EXECUTED), while the edge->count is actually hot.
On Mon, Oct 14, 2013 at 9:13 AM, Xinliang David Li <email@example.com> wrote:
> Looks like there is some inconsistency between edge hotness and callee
> On Mon, Oct 14, 2013 at 9:08 AM, Dehao Chen <firstname.lastname@example.org> wrote:
>> This patch forces to use profile info to check if an edge is hot when
>> profile is available.
>> Bootstrapped and passed regression tests.
>> OK for trunk?
>> 2013-10-14 Dehao Chen <email@example.com>
>> * predict.c(cgraph_maybe_hot_edge_p): Decide edge's hotness from profile.
>> Index: gcc/predict.c
>> --- gcc/predict.c (revision 203568)
>> +++ gcc/predict.c (working copy)
>> @@ -185,10 +185,8 @@ maybe_hot_bb_p (struct function *fun, const_basic_
>> cgraph_maybe_hot_edge_p (struct cgraph_edge *edge)
>> - if (profile_info && flag_branch_probabilities
>> - && !maybe_hot_count_p (NULL,
>> - edge->count))
>> - return false;
>> + if (profile_info && flag_branch_probabilities)
>> + return maybe_hot_count_p (NULL, edge->count);
>> if (edge->caller->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
>> || (edge->callee
>> && edge->callee->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED))