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: Even more trim down init_emit usage


> > Hi,
> > my first reaction to see init_emit datastructures top on the list was to reuse arrays.
> > After my previous patch it makes much less difference than before, but it still save
> > 2MB of garbage for regno_reg_rtx array and 1.3MB for pointer_align.
> > I've moved pointer_align to the reg_attrs that has been my plan for a while anyway.
> > 
> > Bootstrapped/regtested i686-pc-gnu-linux
> > OK?
> > 
> > Honza
> > 
> > 2004-01-22  Jan Hubicka  <jh@suse.cz>
> > 	* combine.c (nonzero_bits1): Use REG_POINTER_ALIGN
> > 	* emit-rtl.c (get_reg_attrs): Accept alignment argument.
> > 	(reg_attrs_htab_hash, reg_attrs_htab_eq): Hash using alignment too.
> > 	(gen_reg_rtx): Do not resize regno_pointer_align array.
> > 	(gen_rtx_REG_offset, set_reg_attrs_from_mem): Update.
> > 	(set_decl_rtl): Compute pointer alignment.
> > 	(set_reg_pointer_align): New function.
> > 	(old_regno_reg_rtx, old_regno_reg_rtx_length): New.
> > 	(init_emit): Reuse regno_rtx array; do not construct pointer_align
> > 	array.
> > 	(finish_emit): New.
> > 	(mark_reg_pointer): Update to REG_POINTER_ALIGN.
> > 	* function.c (free_after_compilation): Use finish_emit.
> > 	* function.h (struct function): Kill regno_pointer_align array;
> > 	rename regno_pointer_align_length to regno_reg_rtx_length.
> > 	(REGNO_POINTER_ALIGN): Use REG_POINTER_ALIGN.
> > 	* integrate.c (expand_inline_function): Do not use regno_pointer_align.
> > 	(copy_rtx_and_substitute): Use REG_POINTER_ALIGN.
> > 	* integrate.h (struct inline_remap): Kill regno_pointer_align.
> > 	* loop.c (lop_givs_rescan): Use REG_POINTER_ALIGN.
> > 	* reload.c (find_reloads_subreg_address): Likewise.
> > 	* reload1.c (reload): Likewise.
> > 	* rtl.h (struct reg_attrs): Add pointer_align field
> > 	(REG_POINTER_ALIGN): New macro.
> > 	(set_reg_pointer_align): New.
> > 	* unroll.c (unroll_loop): Use new macro.
> 
> Hi,
> assuming that the ggc_free patch will be scuesfull, this patch can be
> simplified by not using old_regno_rtx/old_rengo_reg_rtx_length.
> I will submit updated version then.

Actually thinking about it deeper, I can re-use all the pseudo registers
present in regno_rtx array by simply modifying gen_reg_rtx too look
whether array is already big and has present entry.
The alternative would be to walk whole array at the end of
rest_of_compilation and call ggc_free on each individual operand,
but that looks more expensive to me.

What would be preferred sollution?

Honza
> 
> Honza


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