summaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-12 12:45:26 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-12 12:45:26 +0000
commit369ea98da7e50bf397be1aba619d1ba178ca09d9 (patch)
tree8174ebfcbd7b40190073b7254d5a66e0387c7b54 /gcc/df-scan.c
parentb703d146cddb2a032c7fd57fe58c7ec632e4beff (diff)
downloadgcc-369ea98da7e50bf397be1aba619d1ba178ca09d9.tar.gz
* df-core.c (df_clear_bb_info): New function.
(df_set_blocks): bb_info is always allocated. (df_get_bb_info): Use block_info_elt_size. (df_set_bb_info): Likewise. (df_compact_blocks): Update for new block_info. (grow_bb_info): New function. * df-problems.c (df_grow_bb_info): Move to df-core.c (df_rd_set_bb_info): Remove. (df_rd_free_bb_info): Do not free block pool. (df_rd_alloc): Do not create pool, use check for obstack presence instead of NULL pointer for new blocks. (df_rd_free): DO not free alloc pool; clear block_info. (problem_RD): Add size of block info structure. (df_lr_set_bb_info): Remove. (df_lr_free_bb_info): Do not free block pool. (df_lr_alloc): Do not create pool, use check for obstack presence instead of NULL pointer for new blocks. (df_lr_free): DO not free alloc pool; clear block_info. (problem_LR): Add size of block info structure. (df_live_set_bb_info): Remove. (df_live_free_bb_info): Do not free block pool. (df_live_alloc): Do not create pool, use check for obstack presence instead of NULL pointer for new blocks. (df_live_free): DO not free alloc pool; clear block_info. (problem_LIVE): Add size of block info structure. (problem_CHAIN): Add size of block info structure. (df_byte_lr_set_bb_info): Remove. (df_byte_lr_free_bb_info): Do not free block pool. (df_byte_lr_alloc): Do not create pool, use check for obstack presence instead of NULL pointer for new blocks. (df_byte_lr_free): DO not free alloc pool; clear block_info. (problem_BYTE_LR): Add size of block info structure. (problem_NOTE): Add size of block info structure. (df_byte_MD_set_bb_info): Remove. (df_byte_MD_free_bb_info): Do not free block pool. (df_byte_MD_alloc): Do not create pool, use check for obstack presence instead of NULL pointer for new blocks. (df_byte_MD_free): DO not free alloc pool; clear block_info. (problem_BD): Add size of block info structure. * df-scan.c (df_scan_free_internal): Free block pool. (df_scan_set_bb_info): Remove. (df_scan_free_bb_info): Check for artificial_defs instead of bb_info being non-NULL. (df_scan_alloc): DO not create df_scan_block pool. (problem_SCAN): Set size of block info. (df_bb_refs_record): Do not allocate bb_info. * df.h (df_problem): Add block_info_elt_size. (struct dataflow): Change block_info to void *. (df_scan_get_bb_info, df_rd_get_bb_info, df_lr_get_bb_info, df_md_get_bb_info, df_live_get_bb_info, df_byte_lr_get_bb_info): Return in-line structures. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c56
1 files changed, 14 insertions, 42 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 8bb2ac06b1b..902afdae497 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -266,7 +266,6 @@ df_scan_free_internal (void)
bitmap_clear (&df->insns_to_rescan);
bitmap_clear (&df->insns_to_notes_rescan);
- free_alloc_pool (df_scan->block_pool);
free_alloc_pool (problem_data->ref_base_pool);
free_alloc_pool (problem_data->ref_artificial_pool);
free_alloc_pool (problem_data->ref_regular_pool);
@@ -280,17 +279,6 @@ df_scan_free_internal (void)
}
-/* Set basic block info. */
-
-static void
-df_scan_set_bb_info (unsigned int index,
- struct df_scan_bb_info *bb_info)
-{
- df_grow_bb_info (df_scan);
- df_scan->block_info[index] = (void *) bb_info;
-}
-
-
/* Free basic block info. */
static void
@@ -298,7 +286,9 @@ df_scan_free_bb_info (basic_block bb, void *vbb_info)
{
struct df_scan_bb_info *bb_info = (struct df_scan_bb_info *) vbb_info;
unsigned int bb_index = bb->index;
- if (bb_info)
+
+ /* See if bb_info is initialized. */
+ if (bb_info->artificial_defs)
{
rtx insn;
FOR_BB_INSNS (bb, insn)
@@ -312,13 +302,15 @@ df_scan_free_bb_info (basic_block bb, void *vbb_info)
bb_info = df_scan_get_bb_info (bb_index);
/* Get rid of any artificial uses or defs. */
- df_ref_chain_delete_du_chain (bb_info->artificial_defs);
- df_ref_chain_delete_du_chain (bb_info->artificial_uses);
- df_ref_chain_delete (bb_info->artificial_defs);
- df_ref_chain_delete (bb_info->artificial_uses);
- bb_info->artificial_defs = NULL;
- bb_info->artificial_uses = NULL;
- pool_free (df_scan->block_pool, bb_info);
+ if (bb_info->artificial_defs)
+ {
+ df_ref_chain_delete_du_chain (bb_info->artificial_defs);
+ df_ref_chain_delete_du_chain (bb_info->artificial_uses);
+ df_ref_chain_delete (bb_info->artificial_defs);
+ df_ref_chain_delete (bb_info->artificial_uses);
+ bb_info->artificial_defs = NULL;
+ bb_info->artificial_uses = NULL;
+ }
}
}
@@ -339,11 +331,6 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
if (df_scan->problem_data)
df_scan_free_internal ();
- df_scan->block_pool
- = create_alloc_pool ("df_scan_block pool",
- sizeof (struct df_scan_bb_info),
- block_size);
-
problem_data = XNEW (struct df_scan_problem_data);
df_scan->problem_data = problem_data;
df_scan->computed = true;
@@ -383,11 +370,6 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
{
unsigned int bb_index = bb->index;
struct df_scan_bb_info *bb_info = df_scan_get_bb_info (bb_index);
- if (!bb_info)
- {
- bb_info = (struct df_scan_bb_info *) pool_alloc (df_scan->block_pool);
- df_scan_set_bb_info (bb_index, bb_info);
- }
bb_info->artificial_defs = NULL;
bb_info->artificial_uses = NULL;
}
@@ -539,6 +521,7 @@ static struct df_problem problem_SCAN =
NULL, /* Incremental solution verify start. */
NULL, /* Incremental solution verify end. */
NULL, /* Dependent problem. */
+ sizeof (struct df_scan_bb_info),/* Size of entry of block_info array. */
TV_DF_SCAN, /* Timing variable. */
false /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -3698,23 +3681,12 @@ df_bb_refs_record (int bb_index, bool scan_insns)
basic_block bb = BASIC_BLOCK (bb_index);
rtx insn;
int luid = 0;
- struct df_scan_bb_info *bb_info;
struct df_collection_rec collection_rec;
if (!df)
return;
- bb_info = df_scan_get_bb_info (bb_index);
-
- /* Need to make sure that there is a record in the basic block info. */
- if (!bb_info)
- {
- bb_info = (struct df_scan_bb_info *) pool_alloc (df_scan->block_pool);
- df_scan_set_bb_info (bb_index, bb_info);
- bb_info->artificial_defs = NULL;
- bb_info->artificial_uses = NULL;
- }
-
+ df_grow_bb_info (df_scan);
collection_rec.def_vec = VEC_alloc (df_ref, stack, 128);
collection_rec.use_vec = VEC_alloc (df_ref, stack, 32);
collection_rec.eq_use_vec = VEC_alloc (df_ref, stack, 32);