On Tue, Apr 17, 2012 at 10:45 AM, Richard Guenther <richard.guent...@gmail.com> 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 switch stmts to (balanced) trees > should be moved to the GIMPLE level, retaining only the table-jump-like > expansions as switch stmts.
My goal for GCC 4.8 is to do just that: Move switch expansion to GIMPLE and add value profiling for switch expressions. I may put back that heuristic as a branch predictor, but I doubt it makes much of a difference. Besides, it is actually hard to figure out whether a switch expression is for characters in an ascii string because char is promoted to int. Ciao! Steven