Commit c2fc1aee by David Malcolm Committed by David Malcolm

BB_NOTE_LIST scaffolding

gcc/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* sel-sched-ir.h (BB_NOTE_LIST): struct sel_region_bb_info_def's
	"note_list" field will eventually be an rtx_insn *.  To help with
	transition, for now, convert from an access macro into a pair of
	functions: BB_NOTE_LIST, returning an rtx_insn *, and...
	(SET_BB_NOTE_LIST): New function, for use where BB_NOTE_LIST is
	used as an lvalue.

	* sel-sched.c (create_block_for_bookkeeping): Update lvalue usage
	of BB_NOTE_LIST to SET_BB_NOTE_LIST.

	* sel-sched-ir.c (init_bb): Likewise.
	(sel_restore_notes): Likewise.
	(move_bb_info): Likewise.
	(BB_NOTE_LIST): New function, adding a checked cast to rtx_insn *.
	(SET_BB_NOTE_LIST): New function.

/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* rtx-classes-status.txt (TODO): Add SET_BB_NOTE_LIST.

From-SVN: r214167
parent 3f4f5c9a
2014-08-19 David Malcolm <dmalcolm@redhat.com> 2014-08-19 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt (TODO): Add SET_BB_NOTE_LIST.
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt (TODO): Add SET_VINSN_INSN_RTX. * rtx-classes-status.txt (TODO): Add SET_VINSN_INSN_RTX.
2014-08-19 David Malcolm <dmalcolm@redhat.com> 2014-08-19 David Malcolm <dmalcolm@redhat.com>
......
2014-08-19 David Malcolm <dmalcolm@redhat.com> 2014-08-19 David Malcolm <dmalcolm@redhat.com>
* sel-sched-ir.h (BB_NOTE_LIST): struct sel_region_bb_info_def's
"note_list" field will eventually be an rtx_insn *. To help with
transition, for now, convert from an access macro into a pair of
functions: BB_NOTE_LIST, returning an rtx_insn *, and...
(SET_BB_NOTE_LIST): New function, for use where BB_NOTE_LIST is
used as an lvalue.
* sel-sched.c (create_block_for_bookkeeping): Update lvalue usage
of BB_NOTE_LIST to SET_BB_NOTE_LIST.
* sel-sched-ir.c (init_bb): Likewise.
(sel_restore_notes): Likewise.
(move_bb_info): Likewise.
(BB_NOTE_LIST): New function, adding a checked cast to rtx_insn *.
(SET_BB_NOTE_LIST): New function.
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* sel-sched-ir.h (VINSN_INSN_RTX): struct vinsn_def's "insn_rtx" * sel-sched-ir.h (VINSN_INSN_RTX): struct vinsn_def's "insn_rtx"
field will eventually be an rtx_insn *. To help with transition, field will eventually be an rtx_insn *. To help with transition,
for now, convert from an access macro into a pair of functions: for now, convert from an access macro into a pair of functions:
......
...@@ -4620,7 +4620,7 @@ static void ...@@ -4620,7 +4620,7 @@ static void
init_bb (basic_block bb) init_bb (basic_block bb)
{ {
remove_notes (bb_note (bb), BB_END (bb)); remove_notes (bb_note (bb), BB_END (bb));
BB_NOTE_LIST (bb) = note_list; SET_BB_NOTE_LIST (bb) = note_list;
} }
void void
...@@ -4655,7 +4655,7 @@ sel_restore_notes (void) ...@@ -4655,7 +4655,7 @@ sel_restore_notes (void)
{ {
note_list = BB_NOTE_LIST (first); note_list = BB_NOTE_LIST (first);
restore_other_notes (NULL, first); restore_other_notes (NULL, first);
BB_NOTE_LIST (first) = NULL_RTX; SET_BB_NOTE_LIST (first) = NULL_RTX;
FOR_BB_INSNS (first, insn) FOR_BB_INSNS (first, insn)
if (NONDEBUG_INSN_P (insn)) if (NONDEBUG_INSN_P (insn))
...@@ -5263,8 +5263,8 @@ move_bb_info (basic_block merge_bb, basic_block empty_bb) ...@@ -5263,8 +5263,8 @@ move_bb_info (basic_block merge_bb, basic_block empty_bb)
{ {
if (in_current_region_p (merge_bb)) if (in_current_region_p (merge_bb))
concat_note_lists (BB_NOTE_LIST (empty_bb), concat_note_lists (BB_NOTE_LIST (empty_bb),
&BB_NOTE_LIST (merge_bb)); &SET_BB_NOTE_LIST (merge_bb));
BB_NOTE_LIST (empty_bb) = NULL_RTX; SET_BB_NOTE_LIST (empty_bb) = NULL_RTX;
} }
...@@ -6452,4 +6452,15 @@ rtx& SET_VINSN_INSN_RTX (vinsn_t vi) ...@@ -6452,4 +6452,15 @@ rtx& SET_VINSN_INSN_RTX (vinsn_t vi)
return vi->insn_rtx; return vi->insn_rtx;
} }
rtx_insn *BB_NOTE_LIST (basic_block bb)
{
rtx note_list = SEL_REGION_BB_INFO (bb)->note_list;
return safe_as_a <rtx_insn *> (note_list);
}
rtx& SET_BB_NOTE_LIST (basic_block bb)
{
return SEL_REGION_BB_INFO (bb)->note_list;
}
#endif #endif
...@@ -920,7 +920,8 @@ extern vec<sel_region_bb_info_def> sel_region_bb_info; ...@@ -920,7 +920,8 @@ extern vec<sel_region_bb_info_def> sel_region_bb_info;
A note_list is a list of various notes that was scattered across BB A note_list is a list of various notes that was scattered across BB
before scheduling, and will be appended at the beginning of BB after before scheduling, and will be appended at the beginning of BB after
scheduling is finished. */ scheduling is finished. */
#define BB_NOTE_LIST(BB) (SEL_REGION_BB_INFO (BB)->note_list) extern rtx_insn *BB_NOTE_LIST (basic_block);
extern rtx& SET_BB_NOTE_LIST (basic_block);
#define BB_AV_SET(BB) (SEL_REGION_BB_INFO (BB)->av_set) #define BB_AV_SET(BB) (SEL_REGION_BB_INFO (BB)->av_set)
#define BB_AV_LEVEL(BB) (SEL_REGION_BB_INFO (BB)->av_level) #define BB_AV_LEVEL(BB) (SEL_REGION_BB_INFO (BB)->av_level)
......
...@@ -4585,8 +4585,8 @@ create_block_for_bookkeeping (edge e1, edge e2) ...@@ -4585,8 +4585,8 @@ create_block_for_bookkeeping (edge e1, edge e2)
/* Move note_list from the upper bb. */ /* Move note_list from the upper bb. */
gcc_assert (BB_NOTE_LIST (new_bb) == NULL_RTX); gcc_assert (BB_NOTE_LIST (new_bb) == NULL_RTX);
BB_NOTE_LIST (new_bb) = BB_NOTE_LIST (bb); SET_BB_NOTE_LIST (new_bb) = BB_NOTE_LIST (bb);
BB_NOTE_LIST (bb) = NULL_RTX; SET_BB_NOTE_LIST (bb) = NULL_RTX;
gcc_assert (e2->dest == bb); gcc_assert (e2->dest == bb);
......
...@@ -16,6 +16,7 @@ TODO: "Scaffolding" to be removed ...@@ -16,6 +16,7 @@ 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_FOOTER
* SET_BB_NOTE_LIST
* SET_DEP_PRO, SET_DEP_CON * SET_DEP_PRO, SET_DEP_CON
* SET_NEXT_INSN, SET_PREV_INSN * SET_NEXT_INSN, SET_PREV_INSN
* SET_VINSN_INSN_RTX * SET_VINSN_INSN_RTX
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