diff mbox

[GOOGLE] Do not promote indirect call for AutoFDO in the callee body definition is not available

Message ID CAO2gOZW4sA+CanEdrvo9ZQSSXcfCRtq6wVsW4TbHtp+_tDt5Sw@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen Dec. 16, 2014, 10:38 p.m. UTC
This patch fixes the bug for undefined symbol in AutoFDO build.

Testing on going. OK for google-4_9 branch?

Thanks,
Dehao

Comments

Xinliang David Li Dec. 16, 2014, 10:45 p.m. UTC | #1
Does it paper over the real bug?

David

On Tue, Dec 16, 2014 at 2:38 PM, Dehao Chen <dehao@google.com> wrote:
> This patch fixes the bug for undefined symbol in AutoFDO build.
>
> Testing on going. OK for google-4_9 branch?
>
> Thanks,
> Dehao
>
> Index: gcc/auto-profile.c
> ===================================================================
> --- gcc/auto-profile.c (revision 218784)
> +++ gcc/auto-profile.c (working copy)
> @@ -592,6 +592,8 @@
>   continue;
>        if (!check_ic_target (stmt, node))
>   continue;
> +      if (!node->definition)
> +        continue;
>        (*map)[callee] = iter->second->total_count ();
>        ret += iter->second->total_count ();
>      }
Dehao Chen Dec. 16, 2014, 11:07 p.m. UTC | #2
The real bug is in debug info. The callgraph should look like:

foo->D1EV->D4EV

While everything is inlined into foo, but in the inline stack D1EV is missing.

This patch does not fix that problem, but is also reasonable because
if callee's definition is not available, we should not promote the
indirect call anyway.

Dehao

On Tue, Dec 16, 2014 at 2:45 PM, Xinliang David Li <davidxl@google.com> wrote:
> Does it paper over the real bug?
>
> David
>
> On Tue, Dec 16, 2014 at 2:38 PM, Dehao Chen <dehao@google.com> wrote:
>> This patch fixes the bug for undefined symbol in AutoFDO build.
>>
>> Testing on going. OK for google-4_9 branch?
>>
>> Thanks,
>> Dehao
>>
>> Index: gcc/auto-profile.c
>> ===================================================================
>> --- gcc/auto-profile.c (revision 218784)
>> +++ gcc/auto-profile.c (working copy)
>> @@ -592,6 +592,8 @@
>>   continue;
>>        if (!check_ic_target (stmt, node))
>>   continue;
>> +      if (!node->definition)
>> +        continue;
>>        (*map)[callee] = iter->second->total_count ();
>>        ret += iter->second->total_count ();
>>      }
Xinliang David Li Dec. 16, 2014, 11:17 p.m. UTC | #3
On Tue, Dec 16, 2014 at 3:07 PM, Dehao Chen <dehao@google.com> wrote:
> The real bug is in debug info. The callgraph should look like:
>
> foo->D1EV->D4EV
>
> While everything is inlined into foo, but in the inline stack D1EV is missing.

Is it DFEed?
>
> This patch does not fix that problem, but is also reasonable because
> if callee's definition is not available, we should not promote the
> indirect call anyway.
>

It depends. If there is a wrong DFE before the promotion, we will end
up missing opportunities.

David

> Dehao
>
> On Tue, Dec 16, 2014 at 2:45 PM, Xinliang David Li <davidxl@google.com> wrote:
>> Does it paper over the real bug?
>>
>> David
>>
>> On Tue, Dec 16, 2014 at 2:38 PM, Dehao Chen <dehao@google.com> wrote:
>>> This patch fixes the bug for undefined symbol in AutoFDO build.
>>>
>>> Testing on going. OK for google-4_9 branch?
>>>
>>> Thanks,
>>> Dehao
>>>
>>> Index: gcc/auto-profile.c
>>> ===================================================================
>>> --- gcc/auto-profile.c (revision 218784)
>>> +++ gcc/auto-profile.c (working copy)
>>> @@ -592,6 +592,8 @@
>>>   continue;
>>>        if (!check_ic_target (stmt, node))
>>>   continue;
>>> +      if (!node->definition)
>>> +        continue;
>>>        (*map)[callee] = iter->second->total_count ();
>>>        ret += iter->second->total_count ();
>>>      }
diff mbox

Patch

Index: gcc/auto-profile.c
===================================================================
--- gcc/auto-profile.c (revision 218784)
+++ gcc/auto-profile.c (working copy)
@@ -592,6 +592,8 @@ 
  continue;
       if (!check_ic_target (stmt, node))
  continue;
+      if (!node->definition)
+        continue;
       (*map)[callee] = iter->second->total_count ();
       ret += iter->second->total_count ();
     }