This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 016/236] BND_TO scaffolding
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Wed, 6 Aug 2014 13:19:55 -0400
- Subject: [PATCH 016/236] BND_TO scaffolding
- Authentication-results: sourceware.org; auth=none
- References: <1407345815-14551-1-git-send-email-dmalcolm at redhat dot com>
gcc/
* sel-sched-ir.h (BND_TO): insn_t will eventually be an
rtx_insn *. To help with transition, for now, convert from an
access macro into a pair of functions: BND_TO, returning an
rtx_insn *, and...
(SET_BND_TO): New function, for use where BND_TO is used as an
lvalue.
* sel-sched-ir.c (blist_add): Update lvalue usage of BND_TO to
SET_BND_TO.
(BND_TO): New function, adding a checked cast.
(SET_BND_TO): New function.
* sel-sched.c (move_cond_jump): Update lvalue usage of BND_TO to
SET_BND_TO.
(compute_av_set_on_boundaries): Likewise.
/
* rtx-classes-status.txt: Add SET_BND_TO
---
gcc/sel-sched-ir.c | 12 +++++++++++-
gcc/sel-sched-ir.h | 3 ++-
gcc/sel-sched.c | 4 ++--
rtx-classes-status.txt | 1 +
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index cb4682f..01e1dd3 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -207,7 +207,7 @@ blist_add (blist_t *lp, insn_t to, ilist_t ptr, deps_t dc)
_list_add (lp);
bnd = BLIST_BND (*lp);
- BND_TO (bnd) = to;
+ SET_BND_TO (bnd) = to;
BND_PTR (bnd) = ptr;
BND_AV (bnd) = NULL;
BND_AV1 (bnd) = NULL;
@@ -6468,4 +6468,14 @@ rtx& SET_BB_NOTE_LIST (basic_block bb)
return SEL_REGION_BB_INFO (bb)->note_list;
}
+rtx_insn *BND_TO (bnd_t bnd)
+{
+ return as_a_nullable <rtx_insn *> (bnd->to);
+}
+
+insn_t& SET_BND_TO (bnd_t bnd)
+{
+ return bnd->to;
+}
+
#endif
diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h
index 81accaf..ab1f42f 100644
--- a/gcc/sel-sched-ir.h
+++ b/gcc/sel-sched-ir.h
@@ -233,7 +233,8 @@ struct _bnd
deps_t dc;
};
typedef struct _bnd *bnd_t;
-#define BND_TO(B) ((B)->to)
+extern rtx_insn *BND_TO (bnd_t bnd);
+extern insn_t& SET_BND_TO (bnd_t bnd);
/* PTR stands not for pointer as you might think, but as a Path To Root of the
current instruction group from boundary B. */
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index c3e0cca..8181ec2 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -4961,7 +4961,7 @@ move_cond_jump (rtx insn, bnd_t bnd)
/* Jump is moved to the boundary. */
next = PREV_INSN (insn);
- BND_TO (bnd) = insn;
+ SET_BND_TO (bnd) = insn;
ft_edge = find_fallthru_edge_from (block_from);
block_next = ft_edge->dest;
@@ -5102,7 +5102,7 @@ compute_av_set_on_boundaries (fence_t fence, blist_t bnds, av_set_t *av_vliw_p)
{
gcc_assert (FENCE_INSN (fence) == BND_TO (bnd));
FENCE_INSN (fence) = bnd_to;
- BND_TO (bnd) = bnd_to;
+ SET_BND_TO (bnd) = bnd_to;
}
av_set_clear (&BND_AV (bnd));
diff --git a/rtx-classes-status.txt b/rtx-classes-status.txt
index e77e847..52567e7 100644
--- a/rtx-classes-status.txt
+++ b/rtx-classes-status.txt
@@ -13,6 +13,7 @@ TODO: "Scaffolding" to be removed
* DF_REF_INSN
* SET_BB_HEAD, SET_BB_END, SET_BB_HEADER, SET_BB_FOOTER
* SET_BB_NOTE_LIST
+* SET_BND_TO
* SET_DEP_PRO, SET_DEP_CON
* SET_NEXT_INSN, SET_PREV_INSN
* SET_VINSN_INSN_RTX
--
1.8.5.3