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: [PATCH GCC][refacor]Manage allocation of struct iv in obstack.


On 06/26/2015 03:02 AM, Bin Cheng wrote:
Hi,
GCC avoids multi-pointers/dangling-pointers of struct iv by allocating
multiple copies of the structure.  This patch is an obvious fix to the issue
by managing iv structures in obstack.

Bootstrap on x86_64, will apply to trunk if no objection.

Thanks,
bin

2015-06-26  Bin Cheng  <bin.cheng@arm.com>

	* tree-ssa-loop-ivopts.c (struct ivopts_data): New field iv_obstack.
	(tree_ssa_iv_optimize_init): Initialize iv_obstack.
	(alloc_iv): New parameter.  Allocate struct iv using obstack_alloc.
	(set_iv, find_interesting_uses_address, add_candidate_1): New
	argument.
	(find_interesting_uses_op): Don't duplicate struct iv.
	(free_loop_data): Don't free iv structure explicitly.
	(tree_ssa_iv_optimize_finalize): Free iv_obstack.
Presumably you're trying to simplify the memory management here so that you don't have to track lifetimes of the IV structures so carefully, which in turn simplifies some upcoming patch?

Note we don't have a "no objection" policy for this kind of patch. However, I think it may make sense to look into having you as a maintainer for the IV optimizations if you're interested.

Jeff


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