This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: haifa-sched.c : memory usage reduction
- From: Jeffrey A Law <law at redhat dot com>
- To: Christophe Jaillet <christophe dot jaillet at wanadoo dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Feb 2005 10:19:21 -0700
- Subject: Re: haifa-sched.c : memory usage reduction
- Organization: Red Hat, Inc
- References: <00a601c51224$a9b71dc0$96cefea9@none>
- Reply-to: law at redhat dot com
On Mon, 2005-02-14 at 00:22 +0100, Christophe Jaillet wrote:
> Description : in gcc/haifa-sched.c, some memory allocated with alloca could
> be avoided.
> During a full bootstrap, more than 2 000 000 calls to alloca have been
> avoided (20 bytes each time)
>
> Bootstrapped on my i686-pc-cygwin.
>
>
> 2005-02-13 Christophe Jaillet <christophe.jaillet@wanadoo.fr>
>
> * haifa-sched.c (early_queue_to_ready): delay a call to alloca to avoid
> it if (! flag_sched_stalled_insns)
I doubt this is worth the effort to bother changing. But if you really
want to do something with this code, why don't you move the test for
!flag_sched_stalled_insns into the single caller of
early_queue_to_ready.
That would avoid avoid the call to early_queue_to_ready completely in
the cases where it is just going to return. Avoiding the function call
probably gets us more benefit than avoiding the alloca (which is just a
stack adjustment).
jeff