aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index caffe82..8252084 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -183,6 +183,9 @@ static struct
struct pointer_map_t *ttae_cache;
} memory_accesses;
+/* Obstack for the bitmaps in the above data structures. */
+static bitmap_obstack lim_bitmap_obstack;
+
static bool ref_indep_loop_p (struct loop *, mem_ref_p);
/* Minimum cost of an expensive expression. */
@@ -1491,12 +1494,6 @@ memref_free (struct mem_ref *mem)
unsigned i;
mem_ref_locs_p accs;
- BITMAP_FREE (mem->stored);
- BITMAP_FREE (mem->indep_loop);
- BITMAP_FREE (mem->dep_loop);
- BITMAP_FREE (mem->indep_ref);
- BITMAP_FREE (mem->dep_ref);
-
FOR_EACH_VEC_ELT (mem_ref_locs_p, mem->accesses_in_loop, i, accs)
free_mem_ref_locs (accs);
VEC_free (mem_ref_locs_p, heap, mem->accesses_in_loop);
@@ -1514,11 +1511,11 @@ mem_ref_alloc (tree mem, unsigned hash, unsigned id)
ref->mem = mem;
ref->id = id;
ref->hash = hash;
- ref->stored = BITMAP_ALLOC (NULL);
- ref->indep_loop = BITMAP_ALLOC (NULL);
- ref->dep_loop = BITMAP_ALLOC (NULL);
- ref->indep_ref = BITMAP_ALLOC (NULL);
- ref->dep_ref = BITMAP_ALLOC (NULL);
+ ref->stored = BITMAP_ALLOC (&lim_bitmap_obstack);
+ ref->indep_loop = BITMAP_ALLOC (&lim_bitmap_obstack);
+ ref->dep_loop = BITMAP_ALLOC (&lim_bitmap_obstack);
+ ref->indep_ref = BITMAP_ALLOC (&lim_bitmap_obstack);
+ ref->dep_ref = BITMAP_ALLOC (&lim_bitmap_obstack);
ref->accesses_in_loop = NULL;
return ref;
@@ -1738,11 +1735,11 @@ analyze_memory_references (void)
for (i = 0; i < number_of_loops (); i++)
{
- empty = BITMAP_ALLOC (NULL);
+ empty = BITMAP_ALLOC (&lim_bitmap_obstack);
VEC_quick_push (bitmap, memory_accesses.refs_in_loop, empty);
- empty = BITMAP_ALLOC (NULL);
+ empty = BITMAP_ALLOC (&lim_bitmap_obstack);
VEC_quick_push (bitmap, memory_accesses.all_refs_in_loop, empty);
- empty = BITMAP_ALLOC (NULL);
+ empty = BITMAP_ALLOC (&lim_bitmap_obstack);
VEC_quick_push (bitmap, memory_accesses.all_refs_stored_in_loop, empty);
}
@@ -2581,6 +2578,8 @@ tree_ssa_lim_initialize (void)
struct loop *loop;
basic_block bb;
+ bitmap_obstack_initialize (&lim_bitmap_obstack);
+
sbitmap_zero (contains_call);
FOR_EACH_BB (bb)
{
@@ -2614,7 +2613,6 @@ tree_ssa_lim_finalize (void)
{
basic_block bb;
unsigned i;
- bitmap b;
mem_ref_p ref;
free_aux_for_edges ();
@@ -2622,6 +2620,7 @@ tree_ssa_lim_finalize (void)
FOR_EACH_BB (bb)
SET_ALWAYS_EXECUTED_IN (bb, NULL);
+ bitmap_obstack_release (&lim_bitmap_obstack);
pointer_map_destroy (lim_aux_data_map);
htab_delete (memory_accesses.refs);
@@ -2630,16 +2629,8 @@ tree_ssa_lim_finalize (void)
memref_free (ref);
VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
- FOR_EACH_VEC_ELT (bitmap, memory_accesses.refs_in_loop, i, b)
- BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.refs_in_loop);
-
- FOR_EACH_VEC_ELT (bitmap, memory_accesses.all_refs_in_loop, i, b)
- BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.all_refs_in_loop);
-
- FOR_EACH_VEC_ELT (bitmap, memory_accesses.all_refs_stored_in_loop, i, b)
- BITMAP_FREE (b);
VEC_free (bitmap, heap, memory_accesses.all_refs_stored_in_loop);
if (memory_accesses.ttae_cache)