This is the mail archive of the gcc-patches@gcc.gnu.org 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: haifa-sched.c : memory usage reduction


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




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