This is the mail archive of the 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: Minor reload cleanup/speedup

> Jan Hubicka wrote:
> >Hi,
> >just simple replacements of switch instructions that are really ifs.
> >Cause about 30% speedup of the loop, but it is quite small difference in
> >overall scores even tought it is one of the most hot loops around.
> >
> Hi Honza, interesting tweak!
> Can we say something general? I mean, for instance: let's suppose that
> all the branches are equally probable, in that case, the generated code
> is *always* faster for a switch?

Actually the code is faster just because ISDIGIT is implemented in
locale's way and is more expensive than the conditional and additionally
the conditionals are not organized very well.

But in general, the switch is not always faster.  If one of choices
dominates all the others, doing if in advance is probably a win.
I plan to implement profile based switch expansion on tree-SSA once the
CFG transparency bits get in.

> This kind of knowledge could greatly help in performance tuning the
> library.
> Thanks!
> Paolo.

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