Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Diego Novillo
On Mon, Nov 25, 2013 at 1:30 PM, Dehao Chen wrote: > On Mon, Nov 25, 2013 at 10:26 AM, Diego Novillo wrote: >> On Mon, Nov 25, 2013 at 1:22 PM, Xinliang David Li >> wrote: >>> In this case the backedge will be a critical edge, which will be split by >>> GCC. >> >> Right. So, if I split it, I w

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Dehao Chen
On Mon, Nov 25, 2013 at 10:26 AM, Diego Novillo wrote: > On Mon, Nov 25, 2013 at 1:22 PM, Xinliang David Li wrote: >> In this case the backedge will be a critical edge, which will be split by >> GCC. > > Right. So, if I split it, I will reach essentially the same > conclusion, I think. The new b

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Diego Novillo
On Mon, Nov 25, 2013 at 1:22 PM, Xinliang David Li wrote: > In this case the backedge will be a critical edge, which will be split by GCC. Right. So, if I split it, I will reach essentially the same conclusion, I think. The new block will get the original block's weight, which (in turn) will tran

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Xinliang David Li
On Mon, Nov 25, 2013 at 10:23 AM, Dehao Chen wrote: > On Mon, Nov 25, 2013 at 10:08 AM, Diego Novillo wrote: >> Thanks, Deaho. >> >> One other thing that I've found on the LLVM implementation (that I'm >> not sure happens in GCC): self-referential edges. If a loop consists >> of a single-basic b

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Dehao Chen
On Mon, Nov 25, 2013 at 10:08 AM, Diego Novillo wrote: > Thanks, Deaho. > > One other thing that I've found on the LLVM implementation (that I'm > not sure happens in GCC): self-referential edges. If a loop consists > of a single-basic block, the back edge will point to itself. I > haven't been

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Xinliang David Li
In this case the backedge will be a critical edge, which will be split by GCC. David On Mon, Nov 25, 2013 at 10:08 AM, Diego Novillo wrote: > Thanks, Deaho. > > One other thing that I've found on the LLVM implementation (that I'm > not sure happens in GCC): self-referential edges. If a loop con

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Diego Novillo
Thanks, Deaho. One other thing that I've found on the LLVM implementation (that I'm not sure happens in GCC): self-referential edges. If a loop consists of a single-basic block, the back edge will point to itself. I haven't been able to reproduce it with regular control flow constructs in GCC.

Re: [GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Xinliang David Li
Ok. David On Mon, Nov 25, 2013 at 9:56 AM, Dehao Chen wrote: > afdo_propagate_multi_edge can do everything afdo_propagate_single_edge > does. So we refactor the code to keep only one afdo_propagate_edge > function. > > Bootstrapped and passed all unittests and performance tests. > > OK for googl

[GOOGLE] Refactor the profile propagation for AutoFDO

2013-11-25 Thread Dehao Chen
afdo_propagate_multi_edge can do everything afdo_propagate_single_edge does. So we refactor the code to keep only one afdo_propagate_edge function. Bootstrapped and passed all unittests and performance tests. OK for googlge branch? Thanks, Dehao Index: gcc/auto-profile.c ===