Commit d7809518 by Martin Liska Committed by Martin Liska

Change use to type-based pool allocator in

	* ipa-profile.c (account_time_size): Use new type-based pool allocator.
	(ipa_profile_generate_summary): Likewise.
	(ipa_profile_read_summary): Likewise.
	(ipa_profile): Likewise.

From-SVN: r223968
parent dc5667a3
2015-06-01 Martin Liska <mliska@suse.cz> 2015-06-01 Martin Liska <mliska@suse.cz>
* ipa-profile.c (account_time_size): Use new type-based pool allocator.
(ipa_profile_generate_summary): Likewise.
(ipa_profile_read_summary): Likewise.
(ipa_profile): Likewise.
2015-06-01 Martin Liska <mliska@suse.cz>
* tree-ssa-structalias.c (new_var_info): Use new type-based pool allocator. * tree-ssa-structalias.c (new_var_info): Use new type-based pool allocator.
(new_constraint): Likewise. (new_constraint): Likewise.
(init_alias_vars): Likewise. (init_alias_vars): Likewise.
......
...@@ -107,7 +107,8 @@ struct histogram_entry ...@@ -107,7 +107,8 @@ struct histogram_entry
duplicate entries. */ duplicate entries. */
vec<histogram_entry *> histogram; vec<histogram_entry *> histogram;
static alloc_pool histogram_pool; static pool_allocator<histogram_entry> histogram_pool
("IPA histogram", 10);
/* Hashtable support for storing SSA names hashed by their SSA_NAME_VAR. */ /* Hashtable support for storing SSA names hashed by their SSA_NAME_VAR. */
...@@ -144,7 +145,7 @@ account_time_size (hash_table<histogram_hash> *hashtable, ...@@ -144,7 +145,7 @@ account_time_size (hash_table<histogram_hash> *hashtable,
if (!*val) if (!*val)
{ {
*val = (histogram_entry *) pool_alloc (histogram_pool); *val = histogram_pool.allocate ();
**val = key; **val = key;
histogram.safe_push (*val); histogram.safe_push (*val);
} }
...@@ -205,8 +206,6 @@ ipa_profile_generate_summary (void) ...@@ -205,8 +206,6 @@ ipa_profile_generate_summary (void)
basic_block bb; basic_block bb;
hash_table<histogram_hash> hashtable (10); hash_table<histogram_hash> hashtable (10);
histogram_pool = create_alloc_pool ("IPA histogram", sizeof (struct histogram_entry),
10);
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (node->decl)) FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (node->decl))
...@@ -287,8 +286,6 @@ ipa_profile_read_summary (void) ...@@ -287,8 +286,6 @@ ipa_profile_read_summary (void)
int j = 0; int j = 0;
hash_table<histogram_hash> hashtable (10); hash_table<histogram_hash> hashtable (10);
histogram_pool = create_alloc_pool ("IPA histogram", sizeof (struct histogram_entry),
10);
while ((file_data = file_data_vec[j++])) while ((file_data = file_data_vec[j++]))
{ {
...@@ -593,7 +590,7 @@ ipa_profile (void) ...@@ -593,7 +590,7 @@ ipa_profile (void)
} }
} }
histogram.release (); histogram.release ();
free_alloc_pool (histogram_pool); histogram_pool.release ();
/* Produce speculative calls: we saved common traget from porfiling into /* Produce speculative calls: we saved common traget from porfiling into
e->common_target_id. Now, at link time, we can look up corresponding e->common_target_id. Now, at link time, we can look up corresponding
......
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