summaryrefslogtreecommitdiff
path: root/gcc/df-problems.c
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-19 19:04:52 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-19 19:04:52 +0000
commitdeb2741b38fe5c3702de0139b72df56eb72ebe35 (patch)
treefa9997fc4e323fc1d4610bbda7d845966152ff14 /gcc/df-problems.c
parenta650636a6229f762a28f3316815082c269a10e7e (diff)
downloadgcc-deb2741b38fe5c3702de0139b72df56eb72ebe35.tar.gz
2007-06-15 Kenneth Zadeck <zadeck@naturalbridge.com>
* df.h (DF_FIRST_OPTIONAL_PROBLEM): Removed. (struct df_problem.free_blocks_on_set_blocks): New field. (struct dataflow.optional_p): New field. (df_bb_regno_last_use_find, df_insn_regno_def_p): Removed. (df_live_set_all_dirty): New function. * df-scan.c (df_scan_alloc): Initialize optional_p. (problem_SCAN): Initialize free_blocks_on_set_blocks. * df-core.c (df_set_blocks): Removed use of DF_FIRST_OPTIONAL_PROBLEM. Now uses df_problem.free_blocks_on_set_blocks to determine which blocks are recycled. (df_remove_problem): Removed use of DF_FIRST_OPTIONAL_PROBLEM. (df_finish_pass): Removed use of DF_FIRST_OPTIONAL_PROBLEM. Now uses dataflow.optional_p to determine if problem should be deleted. (rest_of_handle_df_initialize): Only start live problem if -02 or above. (df_bb_regno_last_use_find, df_insn_regno_def_p): Removed. * df-problems.c (df_ru_alloc, df_rd_alloc, df_lr_alloc, df_live_alloc, df_urec_alloc, df_note_alloc): set optional_p. (problem_RU, problem_RD, problem_LR, problem_UREC, problem_CHAIN, problem_NOTE): Initialize free_blocks_on_set_blocks. (df_lr_bb_local_compute): Recompute luids if df_live problem is not active. (df_live_set_all_dirty, df_note_alloc): New function. * regrename.c (merge_overlapping_regs): Change DF_LIVE_* to df_get_live_*. * sched_ebb.c (compute_jump_reg_dependencies): Ditto. * postreload.c (reload_combine): Ditto. * cse.c (cse_extended_basic_block): Ditto. * regmove.c (mark_flags_life_zones): Ditto. * rtlfactoring.c (split_blocks_after_seqs, split_pattern_seq, erase_matching_seqs): Ditto. * bt-load.c (compute_defs_uses_and_gen): Ditto. * integrate (allocate_initial_values): Ditto. * combine.c (reg_dead_at_p): Ditto. * resource.c (mark_target_live_regs): Ditto. * sched-rgn.c (check_live_1, update_live_1): Ditto. * config/sh/sh.c (find_r0_life_regions): Ditto. * global.c (rest_of_handle_global_alloc): Only add back df_live for -O > 1. * local-alloc.c (rest_of_handle_local_alloc): Only remove df_live for -O > 1. * ifcvt.c (dead_or_predicable): Change DF_LIVE_* to df_get_live_*. (if_convert): Make sure df_live is there at -O == 1. (pass_if_after_combine): Cleanup flags. * init-regs.c (initialize_uninitialized_regs): Make sure df_live is there at -O == 1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-problems.c')
-rw-r--r--gcc/df-problems.c56
1 files changed, 48 insertions, 8 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index dc5270e935b..101b46f58e3 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -331,6 +331,7 @@ df_ru_alloc (bitmap all_blocks)
bb_info->out = BITMAP_ALLOC (&problem_data->ru_bitmaps);
}
}
+ df_ru->optional_p = true;
}
@@ -711,7 +712,8 @@ static struct df_problem problem_RU =
NULL, /* Incremental solution verify start. */
NULL, /* Incremental solution verfiy end. */
NULL, /* Dependent problem. */
- TV_DF_RU /* Timing variable. */
+ TV_DF_RU, /* Timing variable. */
+ true /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -841,6 +843,7 @@ df_rd_alloc (bitmap all_blocks)
bb_info->out = BITMAP_ALLOC (&problem_data->rd_bitmaps);
}
}
+ df_rd->optional_p = true;
}
@@ -1207,7 +1210,8 @@ static struct df_problem problem_RD =
NULL, /* Incremental solution verify start. */
NULL, /* Incremental solution verfiy end. */
NULL, /* Dependent problem. */
- TV_DF_RD /* Timing variable. */
+ TV_DF_RD, /* Timing variable. */
+ true /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -1320,6 +1324,8 @@ df_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
bb_info->ause = NULL;
}
}
+
+ df_lr->optional_p = false;
}
@@ -1478,6 +1484,13 @@ df_lr_bb_local_compute (unsigned int bb_index)
}
}
#endif
+
+ /* If the df_live problem is not defined, such as at -O0 and -O1, we
+ still need to keep the luids up to date. This is normally done
+ in the df_live problem since this problem has a forwards
+ scan. */
+ if (!df_live)
+ df_recompute_luids (bb);
}
@@ -1818,7 +1831,8 @@ static struct df_problem problem_LR =
df_lr_verify_solution_start,/* Incremental solution verify start. */
df_lr_verify_solution_end, /* Incremental solution verify end. */
NULL, /* Dependent problem. */
- TV_DF_LR /* Timing variable. */
+ TV_DF_LR, /* Timing variable. */
+ false /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -2016,6 +2030,7 @@ df_live_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
bb_info->out = BITMAP_ALLOC (NULL);
}
}
+ df_live->optional_p = (optimize <= 1);
}
@@ -2368,7 +2383,8 @@ static struct df_problem problem_LIVE =
df_live_verify_solution_start,/* Incremental solution verify start. */
df_live_verify_solution_end, /* Incremental solution verify end. */
&problem_LR, /* Dependent problem. */
- TV_DF_LIVE /* Timing variable. */
+ TV_DF_LIVE, /* Timing variable. */
+ false /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -2386,6 +2402,19 @@ df_live_add_problem (void)
}
+/* Set all of the blocks as dirty. This needs to be done if this
+ problem is added after all of the insns have been scanned. */
+
+void
+df_live_set_all_dirty (void)
+{
+ basic_block bb;
+ FOR_ALL_BB (bb)
+ bitmap_set_bit (df_live->out_of_date_transfer_functions,
+ bb->index);
+}
+
+
/* Verify that all of the lr related info is consistent and
correct. */
@@ -2555,6 +2584,7 @@ df_urec_alloc (bitmap all_blocks)
bb_info->earlyclobber = BITMAP_ALLOC (NULL);
}
}
+ df_urec->optional_p = true;
}
@@ -3041,7 +3071,8 @@ static struct df_problem problem_UREC =
NULL, /* Incremental solution verify start. */
NULL, /* Incremental solution verfiy end. */
&problem_LR, /* Dependent problem. */
- TV_DF_UREC /* Timing variable. */
+ TV_DF_UREC, /* Timing variable. */
+ false /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -3213,6 +3244,7 @@ df_chain_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
df_chain_remove_problem ();
df_chain->block_pool = create_alloc_pool ("df_chain_block pool",
sizeof (struct df_link), 50);
+ df_chain->optional_p = true;
}
@@ -3520,7 +3552,8 @@ static struct df_problem problem_CHAIN =
NULL, /* Incremental solution verify start. */
NULL, /* Incremental solution verfiy end. */
&problem_RD, /* Dependent problem. */
- TV_DF_CHAIN /* Timing variable. */
+ TV_DF_CHAIN, /* Timing variable. */
+ false /* Reset blocks on dropping out of blocks_to_analyze. */
};
@@ -3543,6 +3576,12 @@ df_chain_add_problem (enum df_chain_flags chain_flags)
This pass computes REG_DEAD and REG_UNUSED notes.
----------------------------------------------------------------------------*/
+static void
+df_note_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
+{
+ df_note->optional_p = true;
+}
+
#ifdef REG_DEAD_DEBUGGING
static void
df_print_note (const char *prefix, rtx insn, rtx note)
@@ -4077,7 +4116,7 @@ static struct df_problem problem_NOTE =
{
DF_NOTE, /* Problem id. */
DF_NONE, /* Direction. */
- NULL, /* Allocate the problem specific data. */
+ df_note_alloc, /* Allocate the problem specific data. */
NULL, /* Reset global information. */
NULL, /* Free basic block info. */
df_note_compute, /* Local compute function. */
@@ -4099,7 +4138,8 @@ static struct df_problem problem_NOTE =
but it will produce information if built one of uninitialized
register problems (UR, UREC) is also run. */
&problem_LR, /* Dependent problem. */
- TV_DF_NOTE /* Timing variable. */
+ TV_DF_NOTE, /* Timing variable. */
+ false /* Reset blocks on dropping out of blocks_to_analyze. */
};