This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Remove strange case cost code


> On Tue, Apr 17, 2012 at 1:48 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> > Note that it would make a lot of sense to teach this heuristics predict.c
> >> > and properly identify chars.
> >>
> >> Indeed this would be the proper place to implement this logic.
> >
> > TO a degree - switch expansion needs more info than it can obtain from edge
> > profile. ?Having
> > switch
> > ?case 1,3,5,7,8,9: aaa
> > ?case 2,4,6,8,10,12: bbb
> > to produce well ballanced decision tree, it is not enough to know how
> > often the value is even and how often it is odd...
> 
> Why is that? In this case, the expanded switch case does not use BST,
> but testing against bit patterns.

Yep, oversimplified example... 
> 
> >
> > Thus there is a need for value histograms.
> 
> None of the existing value profiler will be powerful enough for this
> though: the one_value profiler only tracks one value. The interval
> profiler can potentially be used if the switch case range is small --
> otherwise the runtime memory overhead will be too large.

Adding profiler to profile individual value ranges is not that hard...
But indeed, at the moment we have single value profiler only...

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]