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, middle-end] Switch initializations conversion (take four)


> I hope that's not discouraging.  Personally, I think this is a good 
> idea, and might be a big win on some codes.  Even if the benchmark is a 
> single real-world application you have at hand -- rather than some 
> well-known benchmark suite -- the patch might be worthwhile if the costs 
> are low enough.  But, we need to have some quantitative information in 
> order to evaluate it.

PR34708 contains a nice real world testcase where such a conversion
would make real difference.  SWIG contains an error reporting function 

static __attribute__ ((__unused__)) const char*
SWIG_Perl_ErrorType(int code) 

that is basically resonably sized switch translating codes to names.
When inlined many times we explode in number of references to string
pools while this conversion would turn the function into simple lookup.

Honza
> 
> -- 
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713


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