RE: branch probabilities on multiway branches

2010-05-04 Thread Rahul Kharche
Edmar Wienskoski Cc: Steven Bosscher; Jan Hubicka; gcc@gcc.gnu.org; sdkteam-gnu Subject: RE: branch probabilities on multiway branches Thanks Edmar! I will try and work your patch into our GCC 4.4.1 port and get some results. Cheers, Rahul

RE: branch probabilities on multiway branches

2010-04-22 Thread Rahul Kharche
Thanks Edmar! I will try and work your patch into our GCC 4.4.1 port and get some results. Cheers, Rahul

RE: branch probabilities on multiway branches

2010-04-20 Thread Rahul Kharche
Hi Steven, > There is a transformation implemented in GCC's > value profiling to put the most-frequently taken case-label of a > switch-expr at the top of the switch Could you point me to the bit of code that does this? I'm exploring the idea of implementing source hints much like __builtin_expe

Re: branch probabilities on multiway branches

2010-04-15 Thread Jan Hubicka
> On Thu, Apr 15, 2010 at 1:11 PM, Rahul Kharche wrote: > > The calculate branch probabilities algorithm (1) in the Wu Larus paper > > also evenly distributes branch probabilities when number of outgoing > > edges is > 2, e.g. switch cases implemented as jump tables. > > > > Are they any known heu

RE: branch probabilities on multiway branches

2010-04-15 Thread Rahul Kharche
The other case I'm working on is to selectively apply tailcall optimization when optimizing for size. Clearly tail call optimiztion is desirable along frequently executed edges. Otherwise we found tailcall optimization generates a sicall_epilogue for each tailcall which has a significant impact on

RE: branch probabilities on multiway branches

2010-04-15 Thread Rahul Kharche
>>What is the problem you're trying to solve? Generally speaking I was looking for a better logic based on estimated branch probability to decide between using binary search tree and jump table implementation of a switch case. One interesting test case is where the gross structure of a function i

Re: branch probabilities on multiway branches

2010-04-15 Thread Steven Bosscher
On Thu, Apr 15, 2010 at 1:11 PM, Rahul Kharche wrote: > The calculate branch probabilities algorithm (1) in the Wu Larus paper > also evenly distributes branch probabilities when number of outgoing > edges is > 2, e.g. switch cases implemented as jump tables. > > Are they any known heuristics to g

RE: branch probabilities on multiway branches

2010-04-15 Thread Rahul Kharche
ase? -Original Message- From: Jan Hubicka [mailto:hubi...@ucw.cz] Sent: 14 April 2010 00:44 To: Rahul Kharche Cc: gcc@gcc.gnu.org; sdkteam-gnu Subject: Re: branch probabilities on multiway branches > Hi All, > > The following bit of code in predict.c implies branch probabilities > are

Re: branch probabilities on multiway branches

2010-04-13 Thread Jan Hubicka
> Hi All, > > The following bit of code in predict.c implies branch probabilities > are strictly evenly distributed for multiway branches at present. The > comment suggests it is possible to generate better estimates for more > generic cases, apart from being involved. Could anyone point me to > t

branch probabilities on multiway branches

2010-04-13 Thread Rahul Kharche
Hi All, The following bit of code in predict.c implies branch probabilities are strictly evenly distributed for multiway branches at present. The comment suggests it is possible to generate better estimates for more generic cases, apart from being involved. Could anyone point me to the reference a