BND_TO scaffolding
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 19 Aug 2014 16:39:52 +0000 (16:39 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 19 Aug 2014 16:39:52 +0000 (16:39 +0000)
gcc/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

* 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.

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

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

From-SVN: r214170

ChangeLog
gcc/ChangeLog
gcc/sel-sched-ir.c
gcc/sel-sched-ir.h
gcc/sel-sched.c
rtx-classes-status.txt

index b06346ce702839e62b7e168d89d10604b1e0bcb3..3265772827c637dfc86c72a3049b6d4e1e796cd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-19  David Malcolm  <dmalcolm@redhat.com>
+
+       * rtx-classes-status.txt (TODO): Add SET_BND_TO
+
 2014-08-19  David Malcolm  <dmalcolm@redhat.com>
 
        * rtx-classes-status.txt (TODO): Add SET_BB_NOTE_LIST.
index 01597a4c32558baa722f816b93bf07797d5154b6..f3aea7a0d44f27cfb8a6e6df890de71ce241fd08 100644 (file)
@@ -1,3 +1,21 @@
+2014-08-19  David Malcolm  <dmalcolm@redhat.com>
+
+       * 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.
+
 2014-08-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.md (*ctz<mode>2_falsedep_1): Don't clear
index 91656499a7ffa1e54f684358f5962da2d7ac9a59..8e257c509a8b3306d6a83a668fdd1ce4f952cb94 100644 (file)
@@ -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;
@@ -6463,4 +6463,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 safe_as_a <rtx_insn *> (bnd->to);
+}
+
+insn_t& SET_BND_TO (bnd_t bnd)
+{
+  return bnd->to;
+}
+
 #endif
index 81accaf6e7c79fae10bd2001aa0c59d93fa4ee72..ab1f42f3a6c36e5fb44c6b8ee6f23288e0c0bd9e 100644 (file)
@@ -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.  */
index 2d9bc81b27ab09ba03f0fabf1bcd7e24468c96d5..3248629e89d7be2f538b415ad7b775323c97e9ba 100644 (file)
@@ -4954,7 +4954,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;
@@ -5095,7 +5095,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));
index ea0941a03bd69b8875f989febe64e9bb237e5683..50daeaca148e9afd85ce255d386b94365bcebbc2 100644 (file)
@@ -17,6 +17,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