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]

obstack for equiv_class_label, more vectors on stack





2012-08-19 Dimitrios Apostolou <jimis@gmx.net>


	* gcc/tree-ssa-structalias.c: Change declaration of ce_s type
	vector from heap to stack. Update all relevant functions to
	VEC_alloc() such vector upfront with enough (32) slots so that
	malloc() calls are mostly avoided.
	(equiv_class_obstack) New global static obstack for allocating
	struct equiv_class_label.
	(equiv_class_add): Use the above instead of malloc().
	(perform_var_substitution): Don't allow entries of
	location_equiv_class_table to be freed, because they are free'd...
	(free_var_substitution_info): ...here by freeing the obstack.
	* gcc/vecir.h: Add declaration of stack allocated tree type vector.
	* gcc/tree-ssa-sccvn.c (vn_phi_insert, print_scc, compare_ops)
	(sort_scc, copy_reference, extract_and_process_scc_for_name): Use
	it, instead of heap allocated vector.



Not all of these places are hot on the profiler, but since I changed a few I had to change them all to remove complete the heap ce_s vector. Passes tests and offers small gains (couple of ms), but expect a more thorough report and testing against a new snapshot by next week.


Thanks, Dimitris

Attachment: ssa-stackvectors.diff
Description: Text document


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