diff mbox

Update the overall summary after edge_summary is updated

Message ID CAO2gOZW0X14Vt6t9aTeASRpHNHqjpA2BygU1z1saaN1LkjVFKA@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen March 21, 2014, 9:15 p.m. UTC
Hi,

This patch updates node's inline summary after edge_summary is
updated. Otherwise it could lead to incorrect inline summary.

Bootstrapped and gcc regression test on-going.

OK for trunk?

Thanks,
Dehao

gcc/ChangeLog:

2014-03-21  Dehao Chen  <dehao@google.com>

*ipa-inline.c (early_inliner): updates overall summary.

Comments

Jan Hubicka March 23, 2014, 1:32 a.m. UTC | #1
> Hi,
> 
> This patch updates node's inline summary after edge_summary is
> updated. Otherwise it could lead to incorrect inline summary.
> 
> Bootstrapped and gcc regression test on-going.
> 
> OK for trunk?
> 
> Thanks,
> Dehao
> 
> gcc/ChangeLog:
> 
> 2014-03-21  Dehao Chen  <dehao@google.com>
> 
> *ipa-inline.c (early_inliner): updates overall summary.

Looks resonable, do you have testcase where it would make a difference?

Honza
> 
> Index: gcc/ipa-inline.c
> ===================================================================
> --- gcc/ipa-inline.c (revision 208755)
> +++ gcc/ipa-inline.c (working copy)
> @@ -2318,6 +2318,7 @@ early_inliner (void)
>        edge->call_stmt, edge->callee->decl, false))
>   edge->call_stmt_cannot_inline_p = true;
>      }
> +  inline_update_overall_summary (node);
>    timevar_pop (TV_INTEGRATION);
>    iterations++;
>    inlined = false;
Dehao Chen March 25, 2014, 11:45 p.m. UTC | #2
On Sat, Mar 22, 2014 at 6:32 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> Hi,
>>
>> This patch updates node's inline summary after edge_summary is
>> updated. Otherwise it could lead to incorrect inline summary.
>>
>> Bootstrapped and gcc regression test on-going.
>>
>> OK for trunk?
>>
>> Thanks,
>> Dehao
>>
>> gcc/ChangeLog:
>>
>> 2014-03-21  Dehao Chen  <dehao@google.com>
>>
>> *ipa-inline.c (early_inliner): updates overall summary.
>
> Looks resonable, do you have testcase where it would make a difference?

Sorry, no small test case because this depends on autofdo profile.

The problem actually does not manifest in trunk unless einline
iterations is increased to >1

Thanks,
Dehao

>
> Honza
>>
>> Index: gcc/ipa-inline.c
>> ===================================================================
>> --- gcc/ipa-inline.c (revision 208755)
>> +++ gcc/ipa-inline.c (working copy)
>> @@ -2318,6 +2318,7 @@ early_inliner (void)
>>        edge->call_stmt, edge->callee->decl, false))
>>   edge->call_stmt_cannot_inline_p = true;
>>      }
>> +  inline_update_overall_summary (node);
>>    timevar_pop (TV_INTEGRATION);
>>    iterations++;
>>    inlined = false;
Jan Hubicka March 26, 2014, 12:47 a.m. UTC | #3
> On Sat, Mar 22, 2014 at 6:32 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> Hi,
> >>
> >> This patch updates node's inline summary after edge_summary is
> >> updated. Otherwise it could lead to incorrect inline summary.
> >>
> >> Bootstrapped and gcc regression test on-going.
> >>
> >> OK for trunk?
> >>
> >> Thanks,
> >> Dehao
> >>
> >> gcc/ChangeLog:
> >>
> >> 2014-03-21  Dehao Chen  <dehao@google.com>
> >>
> >> *ipa-inline.c (early_inliner): updates overall summary.
> >
> > Looks resonable, do you have testcase where it would make a difference?
> 
> Sorry, no small test case because this depends on autofdo profile.
> 
> The problem actually does not manifest in trunk unless einline
> iterations is increased to >1
> 

Hmm, OK, then you can avoid the update when we are running the last iteration.

OK with that change.
Honza

> Thanks,
> Dehao
> 
> >
> > Honza
> >>
> >> Index: gcc/ipa-inline.c
> >> ===================================================================
> >> --- gcc/ipa-inline.c (revision 208755)
> >> +++ gcc/ipa-inline.c (working copy)
> >> @@ -2318,6 +2318,7 @@ early_inliner (void)
> >>        edge->call_stmt, edge->callee->decl, false))
> >>   edge->call_stmt_cannot_inline_p = true;
> >>      }
> >> +  inline_update_overall_summary (node);
> >>    timevar_pop (TV_INTEGRATION);
> >>    iterations++;
> >>    inlined = false;
diff mbox

Patch

Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c (revision 208755)
+++ gcc/ipa-inline.c (working copy)
@@ -2318,6 +2318,7 @@  early_inliner (void)
       edge->call_stmt, edge->callee->decl, false))
  edge->call_stmt_cannot_inline_p = true;
     }
+  inline_update_overall_summary (node);
   timevar_pop (TV_INTEGRATION);
   iterations++;
   inlined = false;