This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 014/236] VINSN_INSN_RTX 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:53 -0400
- Subject: [PATCH 014/236] VINSN_INSN_RTX scaffolding
- Authentication-results: sourceware.org; auth=none
- References: <1407345815-14551-1-git-send-email-dmalcolm at redhat dot com>
For now, convert into VINSN_INSN_RTX a pair of functions. We will
eventually change them back to a macro once the relevant field is of type
rtx_insn *.
gcc/
* sel-sched-ir.h (VINSN_INSN_RTX): struct vinsn_def's "insn_rtx"
field will eventually be an rtx_insn *. To help with transition,
for now, convert from an access macro into a pair of functions:
VINSN_INSN_RTX, returning an rtx_insn *, and...
(SET_VINSN_INSN_RTX): New function, for use where VINSN_INSN_RTX
is used as an lvalue.
* sel-sched-ir.c (vinsn_init): Replace VINSN_INSN_RTX with
SET_VINSN_INSN_RTX where it's used as an lvalue.
(VINSN_INSN_RTX): New function.
(SET_VINSN_INSN_RTX): New function.
/
* rtx-classes-status.txt: Add SET_VINSN_INSN_RTX.
---
gcc/sel-sched-ir.c | 13 ++++++++++++-
gcc/sel-sched-ir.h | 3 ++-
rtx-classes-status.txt | 1 +
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index c1a8a48..18ffa6c 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -1179,7 +1179,7 @@ vinsn_init (vinsn_t vi, insn_t insn, bool force_unique_p)
hash_rtx_callback_function hrcf;
int insn_class;
- VINSN_INSN_RTX (vi) = insn;
+ SET_VINSN_INSN_RTX (vi) = insn;
VINSN_COUNT (vi) = 0;
vi->cost = -1;
@@ -6446,4 +6446,15 @@ sel_remove_loop_preheader (void)
SET_LOOP_PREHEADER_BLOCKS (loop_outer (current_loop_nest),
preheader_blocks);
}
+
+rtx_insn *VINSN_INSN_RTX (vinsn_t vi)
+{
+ return as_a_nullable <rtx_insn *> (vi->insn_rtx);
+}
+
+rtx& SET_VINSN_INSN_RTX (vinsn_t vi)
+{
+ return vi->insn_rtx;
+}
+
#endif
diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h
index f63d571..7aef287 100644
--- a/gcc/sel-sched-ir.h
+++ b/gcc/sel-sched-ir.h
@@ -645,7 +645,8 @@ struct vinsn_def
bool may_trap_p;
};
-#define VINSN_INSN_RTX(VI) ((VI)->insn_rtx)
+extern rtx_insn *VINSN_INSN_RTX (vinsn_t);
+extern rtx& SET_VINSN_INSN_RTX (vinsn_t);
#define VINSN_PATTERN(VI) (PATTERN (VINSN_INSN_RTX (VI)))
#define VINSN_ID(VI) (&((VI)->id))
diff --git a/rtx-classes-status.txt b/rtx-classes-status.txt
index 2a8773f..fe04611 100644
--- a/rtx-classes-status.txt
+++ b/rtx-classes-status.txt
@@ -14,3 +14,4 @@ TODO: "Scaffolding" to be removed
* SET_BB_HEAD, SET_BB_END, SET_BB_HEADER, SET_BB_FOOTER
* SET_DEP_PRO, SET_DEP_CON
* SET_NEXT_INSN, SET_PREV_INSN
+* SET_VINSN_INSN_RTX
--
1.8.5.3