Re: [patch] Remove strange case cost code

2012-04-17 Thread Jan Hubicka
> On Tue, Apr 17, 2012 at 1:48 AM, Jan Hubicka 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

Re: [patch] Remove strange case cost code

2012-04-17 Thread Xinliang David Li
On Tue, Apr 17, 2012 at 1:48 AM, Jan Hubicka 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 o

Re: [patch] Remove strange case cost code

2012-04-17 Thread Jan Hubicka
> On Tue, Apr 17, 2012 at 10:45 AM, Richard Guenther > wrote: > >> Also it is possble to get an historgrams from profile feedback into > >> switch expansion. I always wanted to do that once switch expansion code > >> is cleaned up and moved to gimple level... > > > > Indeed.  At least the parts th

Re: [patch] Remove strange case cost code

2012-04-17 Thread Steven Bosscher
On Tue, Apr 17, 2012 at 10:45 AM, Richard Guenther wrote: >> Also it is possble to get an historgrams from profile feedback into >> switch expansion. I always wanted to do that once switch expansion code >> is cleaned up and moved to gimple level... > > Indeed.  At least the parts that expand swit

Re: [patch] Remove strange case cost code

2012-04-17 Thread Paolo Bonzini
Il 17/04/2012 10:45, Richard Guenther ha scritto: > > Also it is possble to get an historgrams from profile feedback into > > switch expansion. I always wanted to do that once switch expansion code > > is cleaned up and moved to gimple level... > > Indeed. At least the parts that expand switch st

Re: [patch] Remove strange case cost code

2012-04-17 Thread Jan Hubicka
> > 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:

Re: [patch] Remove strange case cost code

2012-04-17 Thread Richard Guenther
On Tue, Apr 17, 2012 at 8:49 AM, Jan Hubicka wrote: >> Hello, >> >> There is code in stmt.c since the initial checkin, that tries to >> balance a switch tree according to some ascii heuristics. I see a >> couple of problems with this code: >> >> 1. It doesn't seem to help much. With the attached p

Re: [patch] Remove strange case cost code

2012-04-16 Thread Jan Hubicka
> Hello, > > There is code in stmt.c since the initial checkin, that tries to > balance a switch tree according to some ascii heuristics. I see a > couple of problems with this code: > > 1. It doesn't seem to help much. With the attached patch to remove the > code, I see no compile time changes t

[patch] Remove strange case cost code

2012-04-16 Thread Steven Bosscher
Hello, There is code in stmt.c since the initial checkin, that tries to balance a switch tree according to some ascii heuristics. I see a couple of problems with this code: 1. It doesn't seem to help much. With the attached patch to remove the code, I see no compile time changes to e.g. compile G