aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-06-01 14:49:17 +0200
committerMartin Liska <marxin@gcc.gnu.org>2015-06-01 12:49:17 +0000
commit601f32936b3d8f16d853ece064e7f3c9de743016 (patch)
tree08adc37d75bf74e1a8f5949d1ccbbea6f40b3435
parentd780951804c64f3f1cfcb0297926937dbfedfc95 (diff)
downloadgcc-601f32936b3d8f16d853ece064e7f3c9de743016.zip
gcc-601f32936b3d8f16d853ece064e7f3c9de743016.tar.gz
gcc-601f32936b3d8f16d853ece064e7f3c9de743016.tar.bz2
Change use to type-based pool allocator in ipa-prop.c.
* ipa-prop.c (ipa_set_jf_constant): Use new type-based pool allocator. (ipa_edge_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Likewise. (ipa_free_all_structures_after_iinln): Likewise. From-SVN: r223969
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/ipa-prop.c23
2 files changed, 14 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2291b0f..e3e03cc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2015-06-01 Martin Liska <mliska@suse.cz>
+ * ipa-prop.c (ipa_set_jf_constant): Use new type-based pool allocator.
+ (ipa_edge_duplication_hook): Likewise.
+ (ipa_free_all_structures_after_ipa_cp): Likewise.
+ (ipa_free_all_structures_after_iinln): Likewise.
+
+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.
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 26be5f2..80ce6b8 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -176,7 +176,8 @@ struct ipa_cst_ref_desc
/* Allocation pool for reference descriptions. */
-static alloc_pool ipa_refdesc_pool;
+static pool_allocator<ipa_cst_ref_desc> ipa_refdesc_pool
+ ("IPA-PROP ref descriptions", 32);
/* Return true if DECL_FUNCTION_SPECIFIC_OPTIMIZATION of the decl associated
with NODE should prevent us from analyzing it for the purposes of IPA-CP. */
@@ -508,11 +509,8 @@ ipa_set_jf_constant (struct ipa_jump_func *jfunc, tree constant,
&& TREE_CODE (TREE_OPERAND (constant, 0)) == FUNCTION_DECL)
{
struct ipa_cst_ref_desc *rdesc;
- if (!ipa_refdesc_pool)
- ipa_refdesc_pool = create_alloc_pool ("IPA-PROP ref descriptions",
- sizeof (struct ipa_cst_ref_desc), 32);
- rdesc = (struct ipa_cst_ref_desc *) pool_alloc (ipa_refdesc_pool);
+ rdesc = ipa_refdesc_pool.allocate ();
rdesc->cs = cs;
rdesc->next_duplicate = NULL;
rdesc->refcount = 1;
@@ -3517,9 +3515,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
gcc_checking_assert (ref);
dst->caller->clone_reference (ref, ref->stmt);
- gcc_checking_assert (ipa_refdesc_pool);
- struct ipa_cst_ref_desc *dst_rdesc
- = (struct ipa_cst_ref_desc *) pool_alloc (ipa_refdesc_pool);
+ struct ipa_cst_ref_desc *dst_rdesc = ipa_refdesc_pool.allocate ();
dst_rdesc->cs = dst;
dst_rdesc->refcount = src_rdesc->refcount;
dst_rdesc->next_duplicate = NULL;
@@ -3527,10 +3523,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
}
else if (src_rdesc->cs == src)
{
- struct ipa_cst_ref_desc *dst_rdesc;
- gcc_checking_assert (ipa_refdesc_pool);
- dst_rdesc
- = (struct ipa_cst_ref_desc *) pool_alloc (ipa_refdesc_pool);
+ struct ipa_cst_ref_desc *dst_rdesc = ipa_refdesc_pool.allocate ();
dst_rdesc->cs = dst;
dst_rdesc->refcount = src_rdesc->refcount;
dst_rdesc->next_duplicate = src_rdesc->next_duplicate;
@@ -3681,8 +3674,7 @@ ipa_free_all_structures_after_ipa_cp (void)
free_alloc_pool (ipcp_poly_ctx_values_pool);
free_alloc_pool (ipcp_agg_lattice_pool);
ipa_unregister_cgraph_hooks ();
- if (ipa_refdesc_pool)
- free_alloc_pool (ipa_refdesc_pool);
+ ipa_refdesc_pool.release ();
}
}
@@ -3703,8 +3695,7 @@ ipa_free_all_structures_after_iinln (void)
free_alloc_pool (ipcp_poly_ctx_values_pool);
if (ipcp_agg_lattice_pool)
free_alloc_pool (ipcp_agg_lattice_pool);
- if (ipa_refdesc_pool)
- free_alloc_pool (ipa_refdesc_pool);
+ ipa_refdesc_pool.release ();
}
/* Print ipa_tree_map data structures of all functions in the