This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 014/236] VINSN_INSN_RTX scaffolding
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Aug 2014 11:43:05 -0400
- Subject: Re: [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> <1407345815-14551-15-git-send-email-dmalcolm at redhat dot com> <53EA8573 dot 8070300 at redhat dot com>
On Tue, 2014-08-12 at 15:21 -0600, Jeff Law wrote:
> On 08/06/14 11:19, David Malcolm wrote:
> > 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.
> OK.
Thanks.
Fixed up the as_a_nullable to safe_as_a, and committed to trunk as
r214165, having verified bootstrap®rtest on x86_64-unknown-linux-gnu
(Fedora 20) albeit in combination with patches 9-29 [1], and verified
that it builds standalone with 9 targets.
Am attaching what I committed.
FWIW these functions becomes a macro again in patch #174.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 214164)
+++ ChangeLog (revision 214165)
@@ -1,5 +1,9 @@
2014-08-19 David Malcolm <dmalcolm@redhat.com>
+ * rtx-classes-status.txt (TODO): Add SET_VINSN_INSN_RTX.
+
+2014-08-19 David Malcolm <dmalcolm@redhat.com>
+
* rtx-classes-status.txt (TODO): Add SET_DEP_PRO, SET_DEP_CON.
2014-08-19 David Malcolm <dmalcolm@redhat.com>
Index: rtx-classes-status.txt
===================================================================
--- rtx-classes-status.txt (revision 214164)
+++ rtx-classes-status.txt (revision 214165)
@@ -18,3 +18,4 @@
* 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
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 214164)
+++ gcc/ChangeLog (revision 214165)
@@ -1,5 +1,19 @@
2014-08-19 David Malcolm <dmalcolm@redhat.com>
+ * 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.
+
+2014-08-19 David Malcolm <dmalcolm@redhat.com>
+
* sched-int.h (DEP_PRO): struct _dep's "pro" and "con" fields will
eventually be rtx_insn *, but to help with transition, for now,
convert from an access macro into a pair of functions: DEP_PRO
Index: gcc/sel-sched-ir.c
===================================================================
--- gcc/sel-sched-ir.c (revision 214164)
+++ gcc/sel-sched-ir.c (revision 214165)
@@ -1179,7 +1179,7 @@
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;
@@ -6441,4 +6441,15 @@
SET_LOOP_PREHEADER_BLOCKS (loop_outer (current_loop_nest),
preheader_blocks);
}
+
+rtx_insn *VINSN_INSN_RTX (vinsn_t vi)
+{
+ return safe_as_a <rtx_insn *> (vi->insn_rtx);
+}
+
+rtx& SET_VINSN_INSN_RTX (vinsn_t vi)
+{
+ return vi->insn_rtx;
+}
+
#endif
Index: gcc/sel-sched-ir.h
===================================================================
--- gcc/sel-sched-ir.h (revision 214164)
+++ gcc/sel-sched-ir.h (revision 214165)
@@ -645,7 +645,8 @@
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))