This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Speedup invalid_mode_change_p
- From: Jan Hubicka <jh at suse dot cz>
- To: Segher Boessenkool <segher at koffie dot nl>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Mon, 10 Mar 2003 22:38:15 +0100
- Subject: Re: Speedup invalid_mode_change_p
- References: <20030227120952.GF2773@kam.mff.cuni.cz> <3E640FB0.5070008@koffie.nl>
> Jan Hubicka wrote:
> >Hi,
> >this patch saves 5-10% of nonoptimizing combine.c compilation time.
> >I will try to figure out from where the zillions of
> >invalid_mode_change_p comes from and cut this down as an followup too.
>
> Sorry for replying so late; I wrote the attached patch a week
> or so ago. It saves 5-15% time on -O0 compilations (on PowerPC).
>
> invalid_mode_change_p() was called in a loop that finds the
> closed union of all valid classes with the best score. This
> patch changes that to computing the closed union of *all*
> classes with best score, and seeing if that is valid; if so,
> we have a winner; if not, fall back to using the old loop.
>
> Bootstrapped on ppc-unknown-linux-gnu (in a heavily modified
> 3.3 tree). Not regtested due to lack of resources. Jan, could
> you please test it and commit if okay?
>
>
> Segher
>
>
>
>
> 2003-03-04 Segher Boessenkool <segher at koffie dot nl>
>
> * regclass.c (regclass): Try first if the subunion of
> all best classes is allowed, and if so, use it, instead
> of always computing the subunion of allowed best classes.
Hmm, witht he invalid_mode_change speedup the effect is smaller,
but it still cuts 80% of calls to that functions in my profile,
so I like it :)
Can you please update it to avoid the goto statement (simply put the
default loop into the body). Also the default loop can be optimized
slightly by first checking that the cost is not greater than best_cost
we currently have.
Please resubmit the patch then. Hope someone will review it :)
Honza