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: Trim down memory usage in alias.c


> Jan Hubicka <jh@suse.cz> writes:
> 
> > > On Tue, Jan 20, 2004 at 09:39:21PM +0100, Jan Hubicka wrote:
> > > > + static unsigned int old_reg_base_value_size;
> > > [...]
> > > > !       reg_base_value_size = old_reg_base_value_size;
> > > > !       if (reg_base_value_size > maxreg * 2)
> > > > ! 	reg_base_value_size = maxreg * 2;
> > > [...]
> > > > +   old_reg_base_value_size = reg_base_value_size;
> > > 
> > > Better than this, which crops the known size of the old array,
> > > would be to use ggc_get_size when looking to reuse the old array.
> > 
> > Hi,
> > here is updated patch, it uses the varray and scales other arrays down.
> > It has passed bootstrap now, gc,gcac bootstrap is scheduled overnight.
> > OK assuming it passes?
> > 
> > The savings are slightly higher (about 750Kb of varray overhead now)
> 
> This looks good to me.  I noticed:
> 
> !       VARRAY_RTX_INIT (reg_base_value, maxreg, "reg_base_value");
> 
> It seems like it would be better to initially make it larger than
> 'maxreg', since surely it will need to grow.  But I presume that if
> this had required real memory allocation then you'd have seen extra
> varray overhead, and you didn't, so it's probably OK.  (Wait a bit
> before committing in case rth sees something I missed.)

I actually tested this idea and it seems to just increase the overhead.
GGC knows how to handle small increases and the most common ussage does
not introduce new registers, just few very specific cases do this.

Thanks,
Honza
> 
> -- 
> - Geoffrey Keating <geoffk@geoffk.org>


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