Eliminate FOR_EACH_BB_REVERSE macro.

gcc/
	* basic-block.h (FOR_EACH_BB_REVERSE): Eliminate macro.

	* cfghooks.c (verify_flow_info): Replace uses of FOR_EACH_BB_REVERSE
	with FOR_EACH_BB_REVERSE_FN, making uses of cfun explicit.
	* cfgrtl.c (print_rtl_with_bb, rtl_verify_edges,
	rtl_verify_bb_insns, rtl_verify_bb_pointers,
	rtl_verify_bb_insn_chain, rtl_verify_fallthru): Likewise.
	* config/ia64/ia64.c (emit_predicate_relation_info): Likewise.
	* config/sh/sh.c (sh_md_init_global): Likewise.
	* config/sh/sh_optimize_sett_clrt.cc
	(sh_optimize_sett_clrt::execute): Likewise.
	* dce.c (reset_unmarked_insns_debug_uses, delete_unmarked_insns):
	Likewise.
	* dominance.c (calc_dfs_tree): Likewise.
	* final.c (final): Likewise.
	* function.c (thread_prologue_and_epilogue_insns): Likewise.
	* gcse.c (compute_code_hoist_vbeinout): Likewise.
	* ira.c (update_equiv_regs, build_insn_chain): Likewise.
	* lcm.c (compute_antinout_edge): Likewise.
	* mode-switching.c (optimize_mode_switching): Likewise.
	* postreload.c (reload_combine): Likewise.
	* recog.c (split_all_insns, peephole2_optimize): Likewise.
	* tree-ssa-live.c (live_worklist): Likewise.

From-SVN: r205829
This commit is contained in:
David Malcolm 2013-12-09 21:16:25 +00:00 committed by David Malcolm
parent 11cd3bed28
commit 4f42035e38
18 changed files with 53 additions and 29 deletions

View File

@ -1,3 +1,29 @@
2013-12-09 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (FOR_EACH_BB_REVERSE): Eliminate macro.
* cfghooks.c (verify_flow_info): Replace uses of FOR_EACH_BB_REVERSE
with FOR_EACH_BB_REVERSE_FN, making uses of cfun explicit.
* cfgrtl.c (print_rtl_with_bb, rtl_verify_edges,
rtl_verify_bb_insns, rtl_verify_bb_pointers,
rtl_verify_bb_insn_chain, rtl_verify_fallthru): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info): Likewise.
* config/sh/sh.c (sh_md_init_global): Likewise.
* config/sh/sh_optimize_sett_clrt.cc
(sh_optimize_sett_clrt::execute): Likewise.
* dce.c (reset_unmarked_insns_debug_uses, delete_unmarked_insns):
Likewise.
* dominance.c (calc_dfs_tree): Likewise.
* final.c (final): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (compute_code_hoist_vbeinout): Likewise.
* ira.c (update_equiv_regs, build_insn_chain): Likewise.
* lcm.c (compute_antinout_edge): Likewise.
* mode-switching.c (optimize_mode_switching): Likewise.
* postreload.c (reload_combine): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
2013-12-09 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (FOR_EACH_BB): Eliminate macro.

View File

@ -336,8 +336,6 @@ struct GTY(()) control_flow_graph {
#define FOR_EACH_BB_REVERSE_FN(BB, FN) \
FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb)
#define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN (BB, cfun)
/* For iterating over insns in basic block. */
#define FOR_BB_INSNS(BB, INSN) \
for ((INSN) = BB_HEAD (BB); \

View File

@ -123,7 +123,7 @@ verify_flow_info (void)
}
/* Now check the basic blocks (boundaries etc.) */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
int n_fallthru = 0;
edge e;

View File

@ -2153,7 +2153,7 @@ print_rtl_with_bb (FILE *outf, const_rtx rtx_first, int flags)
if (flags & TDF_BLOCKS)
{
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
rtx x;
@ -2408,7 +2408,7 @@ rtl_verify_edges (void)
int err = 0;
basic_block bb;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
int n_fallthru = 0, n_branch = 0, n_abnormal_call = 0, n_sibcall = 0;
int n_eh = 0, n_abnormal = 0;
@ -2586,7 +2586,7 @@ rtl_verify_bb_insns (void)
int err = 0;
basic_block bb;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
/* Now check the header of basic
block. It ought to contain optional CODE_LABEL followed
@ -2649,7 +2649,7 @@ rtl_verify_bb_pointers (void)
basic_block bb;
/* Check the general integrity of the basic blocks. */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
rtx insn;
@ -2739,7 +2739,7 @@ rtl_verify_bb_insn_chain (void)
bb_info = XCNEWVEC (basic_block, max_uid);
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
rtx head = BB_HEAD (bb);
rtx end = BB_END (bb);
@ -2821,7 +2821,7 @@ rtl_verify_fallthru (void)
basic_block bb;
int err = 0;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
edge e;

View File

@ -9613,7 +9613,7 @@ emit_predicate_relation_info (void)
{
basic_block bb;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
int r;
rtx head = BB_HEAD (bb);
@ -9641,7 +9641,7 @@ emit_predicate_relation_info (void)
relations around them. Otherwise the assembler will assume the call
returns, and complain about uses of call-clobbered predicates after
the call. */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
rtx insn = BB_HEAD (bb);

View File

@ -11115,7 +11115,7 @@ sh_md_init_global (FILE *dump ATTRIBUTE_UNUSED,
regmode_weight[1] = (short *) xcalloc (old_max_uid, sizeof (short));
r0_life_regions = 0;
FOR_EACH_BB_REVERSE (b)
FOR_EACH_BB_REVERSE_FN (b, cfun)
{
find_regmode_weight (b, SImode);
find_regmode_weight (b, SFmode);

View File

@ -206,7 +206,7 @@ sh_optimize_sett_clrt::execute (void)
// Look for insns that set the ccreg to a constant value and see if it can
// be optimized.
basic_block bb;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
for (rtx next_i, i = NEXT_INSN (BB_HEAD (bb));
i != NULL_RTX && i != BB_END (bb); i = next_i)
{

View File

@ -511,7 +511,7 @@ reset_unmarked_insns_debug_uses (void)
basic_block bb;
rtx insn, next;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
FOR_BB_INSNS_REVERSE_SAFE (bb, insn, next)
if (DEBUG_INSN_P (insn))
{
@ -550,7 +550,7 @@ delete_unmarked_insns (void)
rtx insn, next;
bool must_clean = false;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
FOR_BB_INSNS_REVERSE_SAFE (bb, insn, next)
if (NONDEBUG_INSN_P (insn))
{

View File

@ -357,7 +357,7 @@ calc_dfs_tree (struct dom_info *di, bool reverse)
basic_block b;
bool saw_unconnected = false;
FOR_EACH_BB_REVERSE (b)
FOR_EACH_BB_REVERSE_FN (b, cfun)
{
if (EDGE_COUNT (b->succs) > 0)
{
@ -376,7 +376,7 @@ calc_dfs_tree (struct dom_info *di, bool reverse)
if (saw_unconnected)
{
FOR_EACH_BB_REVERSE (b)
FOR_EACH_BB_REVERSE_FN (b, cfun)
{
basic_block b2;
if (di->dfs_order[b->index])

View File

@ -1996,7 +1996,7 @@ final (rtx first, FILE *file, int optimize_p)
/* There is no cfg for a thunk. */
if (!cfun->is_thunk)
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
start_to_bb[INSN_UID (BB_HEAD (bb))] = bb;
end_to_bb[INSN_UID (BB_END (bb))] = bb;

View File

@ -6236,7 +6236,7 @@ thread_prologue_and_epilogue_insns (void)
}
/* Now duplicate the tails. */
if (!bitmap_empty_p (&bb_tail))
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
basic_block copy_bb, tbb;
rtx insert_point;

View File

@ -2829,7 +2829,7 @@ compute_code_hoist_vbeinout (void)
/* We scan the blocks in the reverse order to speed up
the convergence. */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
if (bb->next_bb != EXIT_BLOCK_PTR_FOR_FN (cfun))
{

View File

@ -3772,7 +3772,7 @@ update_equiv_regs (void)
within the same loop (or in an inner loop), then move the register
initialization just before the use, so that they are in the same
basic block. */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
loop_depth = bb_loop_depth (bb);
for (insn = BB_END (bb);
@ -4127,7 +4127,7 @@ build_insn_chain (void)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (eliminable_regset, i))
bitmap_set_bit (elim_regset, i);
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
bitmap_iterator bi;
rtx insn;

View File

@ -109,7 +109,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* Put every block on the worklist; this is necessary because of the
optimistic initialization of ANTIN above. */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
*qin++ = bb;
bb->aux = bb;

View File

@ -692,7 +692,7 @@ optimize_mode_switching (void)
insert_insn_on_edge (mode_set, eg);
}
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
if (bitmap_bit_p (del[bb->index], j))
{
make_preds_opaque (bb, j);
@ -712,7 +712,7 @@ optimize_mode_switching (void)
{
int no_mode = num_modes[entity_map[j]];
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
struct seginfo *ptr, *next;
for (ptr = bb_info[j][bb->index].seginfo; ptr; ptr = next)

View File

@ -1281,7 +1281,7 @@ reload_combine (void)
label_live = XNEWVEC (HARD_REG_SET, n_labels);
CLEAR_HARD_REG_SET (ever_live_at_start);
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
insn = BB_HEAD (bb);
if (LABEL_P (insn))

View File

@ -2902,7 +2902,7 @@ split_all_insns (void)
bitmap_clear (blocks);
changed = false;
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
rtx insn, next;
bool finish = false;
@ -3556,7 +3556,7 @@ peephole2_optimize (void)
search_ofs = 0;
live = BITMAP_ALLOC (&reg_obstack);
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
{
bool past_end = false;
int pos;

View File

@ -1050,7 +1050,7 @@ live_worklist (tree_live_info_p live)
/* Visit all the blocks in reverse order and propagate live on entry values
into the predecessors blocks. */
FOR_EACH_BB_REVERSE (bb)
FOR_EACH_BB_REVERSE_FN (bb, cfun)
loe_visit_block (live, bb, visited, tmp);
/* Process any blocks which require further iteration. */