vec<edge_growth_cache_entry> edge_growth_cache;
/* Edge predicates goes here. */
-static alloc_pool edge_predicate_pool;
+static pool_allocator<predicate> edge_predicate_pool ("edge predicates", 10);
/* Return true predicate (tautology).
We represent it by empty list of clauses. */
if (predicate && !true_predicate_p (predicate))
{
if (!es->predicate)
- es->predicate = (struct predicate *) pool_alloc (edge_predicate_pool);
+ es->predicate = edge_predicate_pool.allocate ();
*es->predicate = *predicate;
}
else
{
if (es->predicate)
- pool_free (edge_predicate_pool, es->predicate);
+ edge_predicate_pool.remove (es->predicate);
es->predicate = NULL;
}
}
if (false_predicate_p (&new_predicate) || true_predicate_p (&new_predicate))
{
if (*p)
- pool_free (edge_predicate_pool, *p);
+ edge_predicate_pool.remove (*p);
*p = NULL;
}
else
{
if (!*p)
- *p = (struct predicate *) pool_alloc (edge_predicate_pool);
+ *p = edge_predicate_pool.allocate ();
**p = new_predicate;
}
}
if (inline_edge_summary_vec.length () <= (unsigned) symtab->edges_max_uid)
inline_edge_summary_vec.safe_grow_cleared (symtab->edges_max_uid + 1);
- if (!edge_predicate_pool)
- edge_predicate_pool = create_alloc_pool ("edge predicates",
- sizeof (struct predicate), 10);
}
/* We are called multiple time for given function; clear
es->call_stmt_size = es->call_stmt_time = 0;
if (es->predicate)
- pool_free (edge_predicate_pool, es->predicate);
+ edge_predicate_pool.remove (es->predicate);
es->predicate = NULL;
es->param.release ();
}
info->scc_no = 0;
if (info->loop_iterations)
{
- pool_free (edge_predicate_pool, info->loop_iterations);
+ edge_predicate_pool.remove (info->loop_iterations);
info->loop_iterations = NULL;
}
if (info->loop_stride)
{
- pool_free (edge_predicate_pool, info->loop_stride);
+ edge_predicate_pool.remove (info->loop_stride);
info->loop_stride = NULL;
}
if (info->array_index)
{
- pool_free (edge_predicate_pool, info->array_index);
+ edge_predicate_pool.remove (info->array_index);
info->array_index = NULL;
}
vec_free (info->conds);
struct predicate p = add_condition (summary, index, &aggpos,
this_code,
gimple_cond_rhs (last));
- e->aux = pool_alloc (edge_predicate_pool);
+ e->aux = edge_predicate_pool.allocate ();
*(struct predicate *) e->aux = p;
}
}
{
struct predicate p = add_condition (summary, index, &aggpos,
IS_NOT_CONSTANT, NULL_TREE);
- e->aux = pool_alloc (edge_predicate_pool);
+ e->aux = edge_predicate_pool.allocate ();
*(struct predicate *) e->aux = p;
}
}
FOR_EACH_EDGE (e, ei, bb->succs)
{
- e->aux = pool_alloc (edge_predicate_pool);
+ e->aux = edge_predicate_pool.allocate ();
*(struct predicate *) e->aux = false_predicate ();
}
n = gimple_switch_num_labels (last);
/* Entry block is always executable. */
ENTRY_BLOCK_PTR_FOR_FN (my_function)->aux
- = pool_alloc (edge_predicate_pool);
+ = edge_predicate_pool.allocate ();
*(struct predicate *) ENTRY_BLOCK_PTR_FOR_FN (my_function)->aux
= true_predicate ();
if (!bb->aux)
{
done = false;
- bb->aux = pool_alloc (edge_predicate_pool);
+ bb->aux = edge_predicate_pool.allocate ();
*((struct predicate *) bb->aux) = p;
}
else if (!predicates_equal_p (&p, (struct predicate *) bb->aux))
edge_iterator ei;
if (bb->aux)
- pool_free (edge_predicate_pool, bb->aux);
+ edge_predicate_pool.remove ((predicate *)bb->aux);
bb->aux = NULL;
FOR_EACH_EDGE (e, ei, bb->succs)
{
if (e->aux)
- pool_free (edge_predicate_pool, e->aux);
+ edge_predicate_pool.remove ((predicate *) e->aux);
e->aux = NULL;
}
}
inline_summaries->release ();
inline_summaries = NULL;
inline_edge_summary_vec.release ();
- if (edge_predicate_pool)
- free_alloc_pool (edge_predicate_pool);
- edge_predicate_pool = 0;
+ edge_predicate_pool.release ();
}