Handcode gen_rtx_INSN

gcc/ChangeLog:
2014-09-09  David Malcolm  <dmalcolm@redhat.com>

	* combine.c (try_combine): Eliminate checked cast on result of
	gen_rtx_INSN.
	* emit-rtl.c (gen_rtx_INSN): New function, improving over the prior
	autogenerated one by strengthening the return type and params 2 and 3
	from rtx to rtx_insn *, and by naming the params.
	* gengenrtl.c (special_rtx): Add INSN to those that are
	special-cased.
	* rtl.h (gen_rtx_INSN): New prototype.

From-SVN: r215083
This commit is contained in:
David Malcolm 2014-09-09 15:14:03 +00:00 committed by David Malcolm
parent 0cc97fc552
commit d6e1e8b8d1
5 changed files with 30 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2014-09-09 David Malcolm <dmalcolm@redhat.com>
* combine.c (try_combine): Eliminate checked cast on result of
gen_rtx_INSN.
* emit-rtl.c (gen_rtx_INSN): New function, improving over the prior
autogenerated one by strengthening the return type and params 2 and 3
from rtx to rtx_insn *, and by naming the params.
* gengenrtl.c (special_rtx): Add INSN to those that are
special-cased.
* rtl.h (gen_rtx_INSN): New prototype.
2014-09-09 David Malcolm <dmalcolm@redhat.com>
* ira.c (ira_update_equiv_info_by_shuffle_insn): Use NULL rather

View File

@ -2772,10 +2772,9 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
never appear in the insn stream so giving it the same INSN_UID
as I2 will not cause a problem. */
i1 = as_a <rtx_insn *> (
gen_rtx_INSN (VOIDmode, NULL_RTX, i2, BLOCK_FOR_INSN (i2),
XVECEXP (PATTERN (i2), 0, 1), INSN_LOCATION (i2),
-1, NULL_RTX));
i1 = gen_rtx_INSN (VOIDmode, NULL, i2, BLOCK_FOR_INSN (i2),
XVECEXP (PATTERN (i2), 0, 1), INSN_LOCATION (i2),
-1, NULL_RTX);
INSN_UID (i1) = INSN_UID (i2);
SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0));

View File

@ -424,6 +424,17 @@ gen_rtx_INSN_LIST (enum machine_mode mode, rtx insn, rtx insn_list)
insn_list));
}
rtx_insn *
gen_rtx_INSN (enum machine_mode mode, rtx_insn *prev_insn, rtx_insn *next_insn,
basic_block bb, rtx pattern, int location, int code,
rtx reg_notes)
{
return as_a <rtx_insn *> (gen_rtx_fmt_uuBeiie (INSN, mode,
prev_insn, next_insn,
bb, pattern, location, code,
reg_notes));
}
rtx
gen_rtx_CONST_INT (enum machine_mode mode ATTRIBUTE_UNUSED, HOST_WIDE_INT arg)
{

View File

@ -125,6 +125,7 @@ special_rtx (int idx)
{
return (strcmp (defs[idx].enumname, "EXPR_LIST") == 0
|| strcmp (defs[idx].enumname, "INSN_LIST") == 0
|| strcmp (defs[idx].enumname, "INSN") == 0
|| strcmp (defs[idx].enumname, "CONST_INT") == 0
|| strcmp (defs[idx].enumname, "REG") == 0
|| strcmp (defs[idx].enumname, "SUBREG") == 0

View File

@ -3089,6 +3089,10 @@ get_mem_attrs (const_rtx x)
extern rtx_expr_list *gen_rtx_EXPR_LIST (enum machine_mode, rtx, rtx);
extern rtx_insn_list *gen_rtx_INSN_LIST (enum machine_mode, rtx, rtx);
extern rtx_insn *
gen_rtx_INSN (enum machine_mode mode, rtx_insn *prev_insn, rtx_insn *next_insn,
basic_block bb, rtx pattern, int location, int code,
rtx reg_notes);
extern rtx gen_rtx_CONST_INT (enum machine_mode, HOST_WIDE_INT);
extern rtx gen_rtx_CONST_VECTOR (enum machine_mode, rtvec);
extern rtx gen_raw_REG (enum machine_mode, int);