Commit 2cc777fb by Martin Liska Committed by Martin Liska

Change use to type-based pool allocator in

	* tree-ssa-math-opts.c (occ_new): Use new type-based pool allocator.
	(free_bb): Likewise.
	(pass_cse_reciprocals::execute): Likewise.

From-SVN: r223957
parent bc2c893b
2015-06-01 Martin Liska <mliska@suse.cz> 2015-06-01 Martin Liska <mliska@suse.cz>
* tree-ssa-math-opts.c (occ_new): Use new type-based pool allocator.
(free_bb): Likewise.
(pass_cse_reciprocals::execute): Likewise.
2015-06-01 Martin Liska <mliska@suse.cz>
* tree-sra.c (sra_initialize): Use new type-based pool allocator. * tree-sra.c (sra_initialize): Use new type-based pool allocator.
(sra_deinitialize) Likewise. (sra_deinitialize) Likewise.
(create_access_1) Likewise. (create_access_1) Likewise.
......
...@@ -229,7 +229,7 @@ static struct ...@@ -229,7 +229,7 @@ static struct
static struct occurrence *occ_head; static struct occurrence *occ_head;
/* Allocation pool for getting instances of "struct occurrence". */ /* Allocation pool for getting instances of "struct occurrence". */
static alloc_pool occ_pool; static pool_allocator<occurrence> *occ_pool;
...@@ -240,7 +240,7 @@ occ_new (basic_block bb, struct occurrence *children) ...@@ -240,7 +240,7 @@ occ_new (basic_block bb, struct occurrence *children)
{ {
struct occurrence *occ; struct occurrence *occ;
bb->aux = occ = (struct occurrence *) pool_alloc (occ_pool); bb->aux = occ = occ_pool->allocate ();
memset (occ, 0, sizeof (struct occurrence)); memset (occ, 0, sizeof (struct occurrence));
occ->bb = bb; occ->bb = bb;
...@@ -468,7 +468,7 @@ free_bb (struct occurrence *occ) ...@@ -468,7 +468,7 @@ free_bb (struct occurrence *occ)
next = occ->next; next = occ->next;
child = occ->children; child = occ->children;
occ->bb->aux = NULL; occ->bb->aux = NULL;
pool_free (occ_pool, occ); occ_pool->remove (occ);
/* Now ensure that we don't recurse unless it is necessary. */ /* Now ensure that we don't recurse unless it is necessary. */
if (!child) if (!child)
...@@ -572,9 +572,8 @@ pass_cse_reciprocals::execute (function *fun) ...@@ -572,9 +572,8 @@ pass_cse_reciprocals::execute (function *fun)
basic_block bb; basic_block bb;
tree arg; tree arg;
occ_pool = create_alloc_pool ("dominators for recip", occ_pool = new pool_allocator<occurrence>
sizeof (struct occurrence), ("dominators for recip", n_basic_blocks_for_fn (fun) / 3 + 1);
n_basic_blocks_for_fn (fun) / 3 + 1);
memset (&reciprocal_stats, 0, sizeof (reciprocal_stats)); memset (&reciprocal_stats, 0, sizeof (reciprocal_stats));
calculate_dominance_info (CDI_DOMINATORS); calculate_dominance_info (CDI_DOMINATORS);
...@@ -704,7 +703,7 @@ pass_cse_reciprocals::execute (function *fun) ...@@ -704,7 +703,7 @@ pass_cse_reciprocals::execute (function *fun)
free_dominance_info (CDI_DOMINATORS); free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS); free_dominance_info (CDI_POST_DOMINATORS);
free_alloc_pool (occ_pool); delete occ_pool;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment