This is the mail archive of the
mailing list for the GCC project.
Re: Minor reload cleanup/speedup
- From: Jan Hubicka <jh at suse dot cz>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 4 Feb 2004 17:02:26 +0100
- Subject: Re: Minor reload cleanup/speedup
- References: <20040204145630.GE21148@kam.mff.cuni.cz> <40210DD7.firstname.lastname@example.org>
> Jan Hubicka wrote:
> >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