summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ter.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-17 09:42:06 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-17 09:42:06 +0000
commit4fb07d0042a71da1c2709e00c7c1b446479b8414 (patch)
tree0ebbe8deabfc8b9cc126c002c0f1e91f0ac0ea98 /gcc/tree-ssa-ter.c
parent9d436fdd1b63396ba4c981c0a6a960428edcb37b (diff)
downloadgcc-4fb07d0042a71da1c2709e00c7c1b446479b8414.tar.gz
PR middle-end/54146
* tree-ssa-loop-im.c (lim_bitmap_obstack): New bitmap_obstack. (memref_free): Don't free the bitmaps individually here. (mem_ref_alloc): Allocate the bitmaps on the new bitmap obstack. (analyze_memory_references): Likewise. (tree_ssa_lim_initialize): Initialize the new bitmap obstack. (tree_ssa_lim_finalize): Release it. * dse.c (dse_bitmap_obstack): New bitmap obstack. (dse_obstack): New obstack. (get_group_info): Allocate the bitmaps on the new bitmap obstack. (dse_step0): Allocate the scratch bitmap on reg_obstack. Initialize the new bitmap obstack and normal obstack. Use XNEWVEC for bb_table. (record_store): Allocate regs_set on reg_obstack. (dse_step1): Allocate regs_live on reg_obstack. (dse_step2_init): Allocate offset_map_n and offset_map_p on the new obstack. (dse_step3_scan): Allocate bitmaps on the new bitmap obstack. (dse_step3): Likewise. (dse_confluence_0): Likewise. (dse_confluence_n): Likewise. (dse_transfer_function): Likewise. (dse_step7): Destroy the new obstacks, and everything allocated on them, in one big sweep. (rest_of_handle_dse): Update. * cfgexpand.c (stack_var_bitmap_obstack): New bitmap obstack. (add_stack_var_conflict): Allocate bitmaps on it. (add_scope_conflicts_1): Likewise. (add_scope_conflicts): Likewise. (update_alias_info_with_stack_vars): Likewise. (init_vars_expansion): Move TREE_USED fiddling expand_used_vars. Initialize the new bitmap obstack. (fini_vars_expansion): Release it. (estimated_stack_frame_size): Use init_vars_expansion to set things up and always clean up at the end. (expand_used_vars): Do the TREE_USED trickery here. Always call fini_vars_expansion. * tree-ssa-live.h (struct tree_live_info_d): Make livein and liveout arrays of bitmap_head to avoid one indirection per bitmap access. (live_on_entry, live_on_exit, live_var_map, live_merge_and_clear, make_live_on_entry): Update. * tree-ssa-live.c (partition_view_bitmap): Don't double-free 'used'. (liveness_bitmap_obstack): New bitmap obstack. (remove_unused_locals): Use it to allocate all bitmaps on. Update for livein/liveout changes in tree-ssa-live.h. (delete_tree_live_info): Release the bitmap obstack. (loe_visit_block, live_worklist, set_var_live_on_entry, calculate_live_on_exit, dump_live_info): Update. (calculate_live_ranges): Initialize the bitmap. * tree-ssa-ter.c (ter_bitmap_obstack): New bitmap obstack. (new_temp_expr_table): Allocate bitmap on it. (make_dependent_on_partition, add_to_partition_kill_list, add_dependence, process_replaceable): Likewise. (find_replaceable_exprs): Initialize and release the new obstack here. * df-problems.c (df_lr_add_problem): Allocate persistent bitmap for out_of_date_transfer_functions on df_bitmap_obstack. (df_live_add_problem): Likewise. (df_chain_add_problem): Likewise. (df_word_lr_add_problem): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190475 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r--gcc/tree-ssa-ter.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index dbfa37cf7c4..3375a2777c9 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -172,6 +172,9 @@ typedef struct temp_expr_table_d
/* Used to indicate a dependency on VDEFs. */
#define VIRTUAL_PARTITION(table) (table->virtual_partition)
+/* A place for the many, many bitmaps we create. */
+static bitmap_obstack ter_bitmap_obstack;
+
#ifdef ENABLE_CHECKING
extern void debug_ter (FILE *, temp_expr_table_p);
#endif
@@ -192,10 +195,10 @@ new_temp_expr_table (var_map map)
t->expr_decl_uids = XCNEWVEC (bitmap, num_ssa_names + 1);
t->kill_list = XCNEWVEC (bitmap, num_var_partitions (map) + 1);
- t->partition_in_use = BITMAP_ALLOC (NULL);
+ t->partition_in_use = BITMAP_ALLOC (&ter_bitmap_obstack);
t->virtual_partition = num_var_partitions (map);
- t->new_replaceable_dependencies = BITMAP_ALLOC (NULL);
+ t->new_replaceable_dependencies = BITMAP_ALLOC (&ter_bitmap_obstack);
t->replaceable_expressions = NULL;
t->num_in_part = XCNEWVEC (int, num_var_partitions (map));
@@ -269,7 +272,7 @@ static inline void
make_dependent_on_partition (temp_expr_table_p tab, int version, int p)
{
if (!tab->partition_dependencies[version])
- tab->partition_dependencies[version] = BITMAP_ALLOC (NULL);
+ tab->partition_dependencies[version] = BITMAP_ALLOC (&ter_bitmap_obstack);
bitmap_set_bit (tab->partition_dependencies[version], p);
}
@@ -282,7 +285,7 @@ add_to_partition_kill_list (temp_expr_table_p tab, int p, int ver)
{
if (!tab->kill_list[p])
{
- tab->kill_list[p] = BITMAP_ALLOC (NULL);
+ tab->kill_list[p] = BITMAP_ALLOC (&ter_bitmap_obstack);
bitmap_set_bit (tab->partition_in_use, p);
}
bitmap_set_bit (tab->kill_list[p], ver);
@@ -330,7 +333,8 @@ add_dependence (temp_expr_table_p tab, int version, tree var)
/* Rather than set partition_dependencies and in_use lists bit by
bit, simply OR in the new_replaceable_dependencies bits. */
if (!tab->partition_dependencies[version])
- tab->partition_dependencies[version] = BITMAP_ALLOC (NULL);
+ tab->partition_dependencies[version] =
+ BITMAP_ALLOC (&ter_bitmap_obstack);
bitmap_ior_into (tab->partition_dependencies[version],
tab->new_replaceable_dependencies);
bitmap_ior_into (tab->partition_in_use,
@@ -498,7 +502,7 @@ process_replaceable (temp_expr_table_p tab, gimple stmt, int call_cnt)
def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
version = SSA_NAME_VERSION (def);
- def_vars = BITMAP_ALLOC (NULL);
+ def_vars = BITMAP_ALLOC (&ter_bitmap_obstack);
basevar = SSA_NAME_VAR (def);
if (basevar)
@@ -578,7 +582,9 @@ mark_replaceable (temp_expr_table_p tab, tree var, bool more_replacing)
finished_with_expr (tab, version, !more_replacing);
- /* Set the replaceable expression. */
+ /* Set the replaceable expression.
+ The bitmap for this "escapes" from this file so it's allocated
+ on the default obstack. */
if (!tab->replaceable_expressions)
tab->replaceable_expressions = BITMAP_ALLOC (NULL);
bitmap_set_bit (tab->replaceable_expressions, version);
@@ -706,21 +712,22 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
NULL is returned by the function, otherwise an expression vector indexed
by SSA_NAME version numbers. */
-extern bitmap
+bitmap
find_replaceable_exprs (var_map map)
{
basic_block bb;
temp_expr_table_p table;
bitmap ret;
+ bitmap_obstack_initialize (&ter_bitmap_obstack);
table = new_temp_expr_table (map);
FOR_EACH_BB (bb)
{
find_replaceable_in_bb (table, bb);
gcc_checking_assert (bitmap_empty_p (table->partition_in_use));
}
-
ret = free_temp_expr_table (table);
+ bitmap_obstack_release (&ter_bitmap_obstack);
return ret;
}