Commit d8ce2eae by David Malcolm Committed by David Malcolm

Remove BB_FOOTER scaffolding

gcc/
	* basic-block.h (struct rtl_bb_info): Strengthen field "footer_"
	from rtx to rtx_insn *.
	(BB_FOOTER): Replace function with access macro.
	(SET_BB_FOOTER): Delete.

	* cfgcleanup.c (try_optimize_cfg): Replace uses of SET_BB_FOOTER
	with BB_FOOTER.
	* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
	(emit_barrier_after_bb): Likewise.
	(record_effective_endpoints): Likewise.
	(relink_block_chain): Likewise.
	(fixup_fallthru_exit_predecessor): Likewise.
	(cfg_layout_duplicate_bb): Likewise.
	(cfg_layout_split_block): Likewise.
	(cfg_layout_delete_block): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	(BB_FOOTER): Delete function.
	(SET_BB_FOOTER): Delete function.
	* combine.c (update_cfg_for_uncondjump): Replace uses of
	SET_BB_FOOTER with BB_FOOTER.

/
	* rtx-classes-status.txt (TODO): Remove SET_BB_FOOTER.

From-SVN: r214470
parent be7457df
2014-08-25 David Malcolm <dmalcolm@redhat.com> 2014-08-25 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt (TODO): Remove SET_BB_FOOTER.
2014-08-25 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt: Phase 3 (per-file commits within * rtx-classes-status.txt: Phase 3 (per-file commits within
"config" subdirs) is done; begin phase 4 (removal of "config" subdirs) is done; begin phase 4 (removal of
"scaffolding"). "scaffolding").
......
2014-08-25 David Malcolm <dmalcolm@redhat.com> 2014-08-25 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (struct rtl_bb_info): Strengthen field "footer_"
from rtx to rtx_insn *.
(BB_FOOTER): Replace function with access macro.
(SET_BB_FOOTER): Delete.
* cfgcleanup.c (try_optimize_cfg): Replace uses of SET_BB_FOOTER
with BB_FOOTER.
* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
(emit_barrier_after_bb): Likewise.
(record_effective_endpoints): Likewise.
(relink_block_chain): Likewise.
(fixup_fallthru_exit_predecessor): Likewise.
(cfg_layout_duplicate_bb): Likewise.
(cfg_layout_split_block): Likewise.
(cfg_layout_delete_block): Likewise.
(cfg_layout_merge_blocks): Likewise.
(BB_FOOTER): Delete function.
(SET_BB_FOOTER): Delete function.
* combine.c (update_cfg_for_uncondjump): Replace uses of
SET_BB_FOOTER with BB_FOOTER.
2014-08-25 David Malcolm <dmalcolm@redhat.com>
* except.h (struct eh_landing_pad_d): Strengthen field * except.h (struct eh_landing_pad_d): Strengthen field
"landing_pad" from rtx to rtx_code_label *. "landing_pad" from rtx to rtx_code_label *.
......
...@@ -127,7 +127,7 @@ struct GTY(()) rtl_bb_info { ...@@ -127,7 +127,7 @@ struct GTY(()) rtl_bb_info {
/* In CFGlayout mode points to insn notes/jumptables to be placed just before /* In CFGlayout mode points to insn notes/jumptables to be placed just before
and after the block. */ and after the block. */
rtx header_; rtx header_;
rtx footer_; rtx_insn *footer_;
}; };
struct GTY(()) gimple_bb_info { struct GTY(()) gimple_bb_info {
...@@ -381,8 +381,7 @@ extern rtx& SET_BB_END (basic_block bb); ...@@ -381,8 +381,7 @@ extern rtx& SET_BB_END (basic_block bb);
extern rtx_insn *BB_HEADER (const_basic_block bb); extern rtx_insn *BB_HEADER (const_basic_block bb);
extern rtx& SET_BB_HEADER (basic_block bb); extern rtx& SET_BB_HEADER (basic_block bb);
extern rtx_insn *BB_FOOTER (const_basic_block bb); #define BB_FOOTER(B) (B)->il.x.rtl->footer_
extern rtx& SET_BB_FOOTER (basic_block bb);
/* Special block numbers [markers] for entry and exit. /* Special block numbers [markers] for entry and exit.
Neither of them is supposed to hold actual statements. */ Neither of them is supposed to hold actual statements. */
......
...@@ -2676,13 +2676,13 @@ try_optimize_cfg (int mode) ...@@ -2676,13 +2676,13 @@ try_optimize_cfg (int mode)
{ {
if (BB_FOOTER (b)) if (BB_FOOTER (b))
{ {
SET_BB_FOOTER (e->src) = BB_FOOTER (b); BB_FOOTER (e->src) = BB_FOOTER (b);
SET_BB_FOOTER (b) = NULL; BB_FOOTER (b) = NULL;
} }
else else
{ {
start_sequence (); start_sequence ();
SET_BB_FOOTER (e->src) = emit_barrier (); BB_FOOTER (e->src) = emit_barrier ();
end_sequence (); end_sequence ();
} }
} }
......
...@@ -1063,7 +1063,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) ...@@ -1063,7 +1063,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
if (PREV_INSN (insn)) if (PREV_INSN (insn))
SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else else
SET_BB_FOOTER (src) = NEXT_INSN (insn); BB_FOOTER (src) = NEXT_INSN (insn);
if (NEXT_INSN (insn)) if (NEXT_INSN (insn))
SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
} }
...@@ -1451,7 +1451,7 @@ emit_barrier_after_bb (basic_block bb) ...@@ -1451,7 +1451,7 @@ emit_barrier_after_bb (basic_block bb)
gcc_assert (current_ir_type () == IR_RTL_CFGRTL gcc_assert (current_ir_type () == IR_RTL_CFGRTL
|| current_ir_type () == IR_RTL_CFGLAYOUT); || current_ir_type () == IR_RTL_CFGLAYOUT);
if (current_ir_type () == IR_RTL_CFGLAYOUT) if (current_ir_type () == IR_RTL_CFGLAYOUT)
SET_BB_FOOTER (bb) = unlink_insn_chain (barrier, barrier); BB_FOOTER (bb) = unlink_insn_chain (barrier, barrier);
} }
/* Like force_nonfallthru below, but additionally performs redirection /* Like force_nonfallthru below, but additionally performs redirection
...@@ -3462,7 +3462,7 @@ record_effective_endpoints (void) ...@@ -3462,7 +3462,7 @@ record_effective_endpoints (void)
PREV_INSN (BB_HEAD (bb))); PREV_INSN (BB_HEAD (bb)));
end = skip_insns_after_block (bb); end = skip_insns_after_block (bb);
if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end) if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end)
SET_BB_FOOTER (bb) = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end); BB_FOOTER (bb) = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
next_insn = NEXT_INSN (BB_END (bb)); next_insn = NEXT_INSN (BB_END (bb));
} }
...@@ -3620,7 +3620,7 @@ relink_block_chain (bool stay_in_cfglayout_mode) ...@@ -3620,7 +3620,7 @@ relink_block_chain (bool stay_in_cfglayout_mode)
{ {
bb->aux = NULL; bb->aux = NULL;
if (!stay_in_cfglayout_mode) if (!stay_in_cfglayout_mode)
SET_BB_HEADER (bb) = SET_BB_FOOTER (bb) = NULL; SET_BB_HEADER (bb) = BB_FOOTER (bb) = NULL;
} }
/* Maybe reset the original copy tables, they are not valid anymore /* Maybe reset the original copy tables, they are not valid anymore
...@@ -3988,8 +3988,8 @@ fixup_fallthru_exit_predecessor (void) ...@@ -3988,8 +3988,8 @@ fixup_fallthru_exit_predecessor (void)
bb = split_block (bb, NULL)->dest; bb = split_block (bb, NULL)->dest;
bb->aux = c->aux; bb->aux = c->aux;
c->aux = bb; c->aux = bb;
SET_BB_FOOTER (bb) = BB_FOOTER (c); BB_FOOTER (bb) = BB_FOOTER (c);
SET_BB_FOOTER (c) = NULL; BB_FOOTER (c) = NULL;
} }
while (c->aux != bb) while (c->aux != bb)
...@@ -4203,7 +4203,7 @@ cfg_layout_duplicate_bb (basic_block bb) ...@@ -4203,7 +4203,7 @@ cfg_layout_duplicate_bb (basic_block bb)
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
insn = duplicate_insn_chain (BB_FOOTER (bb), insn); insn = duplicate_insn_chain (BB_FOOTER (bb), insn);
if (insn) if (insn)
SET_BB_FOOTER (new_bb) = unlink_insn_chain (insn, get_last_insn ()); BB_FOOTER (new_bb) = unlink_insn_chain (insn, get_last_insn ());
} }
return new_bb; return new_bb;
...@@ -4311,8 +4311,8 @@ cfg_layout_split_block (basic_block bb, void *insnp) ...@@ -4311,8 +4311,8 @@ cfg_layout_split_block (basic_block bb, void *insnp)
rtx insn = (rtx) insnp; rtx insn = (rtx) insnp;
basic_block new_bb = rtl_split_block (bb, insn); basic_block new_bb = rtl_split_block (bb, insn);
SET_BB_FOOTER (new_bb) = BB_FOOTER (bb); BB_FOOTER (new_bb) = BB_FOOTER (bb);
SET_BB_FOOTER (bb) = NULL; BB_FOOTER (bb) = NULL;
return new_bb; return new_bb;
} }
...@@ -4443,7 +4443,7 @@ cfg_layout_delete_block (basic_block bb) ...@@ -4443,7 +4443,7 @@ cfg_layout_delete_block (basic_block bb)
if (PREV_INSN (insn)) if (PREV_INSN (insn))
SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else else
SET_BB_FOOTER (bb) = NEXT_INSN (insn); BB_FOOTER (bb) = NEXT_INSN (insn);
if (NEXT_INSN (insn)) if (NEXT_INSN (insn))
SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
} }
...@@ -4578,7 +4578,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -4578,7 +4578,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
if (BB_FOOTER (b)) if (BB_FOOTER (b))
{ {
if (!BB_FOOTER (a)) if (!BB_FOOTER (a))
SET_BB_FOOTER (a) = SET_BB_FOOTER (b); BB_FOOTER (a) = BB_FOOTER (b);
else else
{ {
rtx_insn *last = BB_FOOTER (a); rtx_insn *last = BB_FOOTER (a);
...@@ -4588,7 +4588,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -4588,7 +4588,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
SET_NEXT_INSN (last) = BB_FOOTER (b); SET_NEXT_INSN (last) = BB_FOOTER (b);
SET_PREV_INSN (BB_FOOTER (b)) = last; SET_PREV_INSN (BB_FOOTER (b)) = last;
} }
SET_BB_FOOTER (b) = NULL; BB_FOOTER (b) = NULL;
} }
/* Move things from b->header before a->footer. /* Move things from b->header before a->footer.
...@@ -4597,7 +4597,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -4597,7 +4597,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
if (BB_HEADER (b)) if (BB_HEADER (b))
{ {
if (! BB_FOOTER (a)) if (! BB_FOOTER (a))
SET_BB_FOOTER (a) = BB_HEADER (b); BB_FOOTER (a) = BB_HEADER (b);
else else
{ {
rtx_insn *last = BB_HEADER (b); rtx_insn *last = BB_HEADER (b);
...@@ -4606,7 +4606,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) ...@@ -4606,7 +4606,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
last = NEXT_INSN (last); last = NEXT_INSN (last);
SET_NEXT_INSN (last) = BB_FOOTER (a); SET_NEXT_INSN (last) = BB_FOOTER (a);
SET_PREV_INSN (BB_FOOTER (a)) = last; SET_PREV_INSN (BB_FOOTER (a)) = last;
SET_BB_FOOTER (a) = BB_HEADER (b); BB_FOOTER (a) = BB_HEADER (b);
} }
SET_BB_HEADER (b) = NULL; SET_BB_HEADER (b) = NULL;
} }
...@@ -5150,19 +5150,4 @@ rtx& SET_BB_HEADER (basic_block bb) ...@@ -5150,19 +5150,4 @@ rtx& SET_BB_HEADER (basic_block bb)
return bb->il.x.rtl->header_; return bb->il.x.rtl->header_;
} }
/* BB_FOOTER as an rvalue. */
rtx_insn *BB_FOOTER (const_basic_block bb)
{
rtx insn = bb->il.x.rtl->footer_;
return safe_as_a <rtx_insn *> (insn);
}
/* BB_FOOTER as an lvalue. */
rtx& SET_BB_FOOTER (basic_block bb)
{
return bb->il.x.rtl->footer_;
}
#include "gt-cfgrtl.h" #include "gt-cfgrtl.h"
...@@ -2425,7 +2425,7 @@ update_cfg_for_uncondjump (rtx_insn *insn) ...@@ -2425,7 +2425,7 @@ update_cfg_for_uncondjump (rtx_insn *insn)
if (PREV_INSN (insn)) if (PREV_INSN (insn))
SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
else else
SET_BB_FOOTER (bb) = NEXT_INSN (insn); BB_FOOTER (bb) = NEXT_INSN (insn);
if (NEXT_INSN (insn)) if (NEXT_INSN (insn))
SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
} }
......
...@@ -15,7 +15,7 @@ Phase 6: use extra rtx_def subclasses: TODO ...@@ -15,7 +15,7 @@ Phase 6: use extra rtx_def subclasses: TODO
TODO: "Scaffolding" to be removed TODO: "Scaffolding" to be removed
================================= =================================
* DF_REF_INSN * DF_REF_INSN
* SET_BB_HEAD, SET_BB_END, SET_BB_HEADER, SET_BB_FOOTER * SET_BB_HEAD, SET_BB_END, SET_BB_HEADER
* SET_BB_NOTE_LIST * SET_BB_NOTE_LIST
* SET_BND_TO * SET_BND_TO
* SET_DEP_PRO, SET_DEP_CON * SET_DEP_PRO, SET_DEP_CON
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment