Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-19 Thread Jan Hubicka
> On Mon, May 19, 2014 at 1:40 PM, Jan Hubicka wrote: > >> I've updated the patch. Shall I move the check inside cgraph_clone_node? > > > > Thanks, > > I think it is OK as it is. I belive individual users should know what do to > > in such cases themselves. > > You may want to also check what ipa-

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-19 Thread Dehao Chen
On Mon, May 19, 2014 at 1:40 PM, Jan Hubicka wrote: >> I've updated the patch. Shall I move the check inside cgraph_clone_node? > > Thanks, > I think it is OK as it is. I belive individual users should know what do to > in such cases themselves. > You may want to also check what ipa-cp is doing.

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-19 Thread Jan Hubicka
> I've updated the patch. Shall I move the check inside cgraph_clone_node? Thanks, I think it is OK as it is. I belive individual users should know what do to in such cases themselves. You may want to also check what ipa-cp is doing. Patch is OK (with Changelog) Honza > > Thanks, > Dehao > > In

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-19 Thread Dehao Chen
I've updated the patch. Shall I move the check inside cgraph_clone_node? Thanks, Dehao Index: gcc/ipa-inline-transform.c === --- gcc/ipa-inline-transform.c (revision 210535) +++ gcc/ipa-inline-transform.c (working copy) @@ -183,8 +18

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-16 Thread Jan Hubicka
> Do you mean adjusting bb->count? Because in > expand_call_inline(tree-inline.c), it will use bb->count to pass into > copy_body to calculate count_scale. What about taking here callee->count instead? For inline nodes without any capping hack, bb->count == edge->count = callee->count. When profi

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-16 Thread Dehao Chen
Do you mean adjusting bb->count? Because in expand_call_inline(tree-inline.c), it will use bb->count to pass into copy_body to calculate count_scale. Thanks, Dehao On Fri, May 16, 2014 at 5:22 PM, Jan Hubicka wrote: >> In AutoFDO, a basic block's count can be much larger than it's actual >> coun

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-16 Thread Jan Hubicka
> In AutoFDO, a basic block's count can be much larger than it's actual > count because debug info might be incorrect. In this case, a call edge > count (calculated from BB count) could be much larger than callee's > header count, making the count_scale incorrectly large. In this case I still thin

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-16 Thread Dehao Chen
On Fri, May 16, 2014 at 4:41 PM, Jan Hubicka wrote: > > > Is this patch ok for trunk? Bootstrapped and regression test on-going. > > > > Thanks, > > Dehao > > > > 2014-05-16 Dehao Chen > > > > * tree-inline.c (initialize_cfun): Ensure count_scale is no larger > > than REG_BR_PRO

Re: [PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-16 Thread Jan Hubicka
> Is this patch ok for trunk? Bootstrapped and regression test on-going. > > Thanks, > Dehao > > 2014-05-16 Dehao Chen > > * tree-inline.c (initialize_cfun): Ensure count_scale is no larger > than REG_BR_PROB_BASE. > (copy_cfg_body): Likewise. This seems like wrong pl

[PATCH] Ensure count_scale is no larger than REG_BR_PROB_BASE

2014-05-16 Thread Dehao Chen
Is this patch ok for trunk? Bootstrapped and regression test on-going. Thanks, Dehao 2014-05-16 Dehao Chen * tree-inline.c (initialize_cfun): Ensure count_scale is no larger than REG_BR_PROB_BASE. (copy_cfg_body): Likewise. Index: gcc/tree-inline.c ===