split up some variables to use rtx_insn * more

gcc/ChangeLog:

2016-11-01  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/alpha/alpha.c (alpha_legitimize_address_1): Split up
	variables so some can be rtx_insn *.
	(alpha_emit_xfloating_libcall): Likewise.
	* config/mips/mips.c (mips_call_tls_get_addr): Likewise.
	(mips_legitimize_tls_address): Likewise.
	* optabs.c (expand_binop): Likewise.
	* reload1.c (gen_reload): Likewise.

From-SVN: r241770
This commit is contained in:
Trevor Saunders 2016-11-02 03:45:45 +00:00 committed by Trevor Saunders
parent 88f9bb4dcb
commit 4b6ab43387
5 changed files with 109 additions and 89 deletions

View File

@ -1,3 +1,13 @@
2016-11-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* config/alpha/alpha.c (alpha_legitimize_address_1): Split up
variables so some can be rtx_insn *.
(alpha_emit_xfloating_libcall): Likewise.
* config/mips/mips.c (mips_call_tls_get_addr): Likewise.
(mips_legitimize_tls_address): Likewise.
* optabs.c (expand_binop): Likewise.
* reload1.c (gen_reload): Likewise.
2016-11-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* reorg.c (relax_delay_slots): Split up the trial variable.

View File

@ -1017,7 +1017,8 @@ alpha_legitimize_address_1 (rtx x, rtx scratch, machine_mode mode)
&& GET_MODE_SIZE (mode) <= UNITS_PER_WORD
&& symbolic_operand (x, Pmode))
{
rtx r0, r16, eqv, tga, tp, insn, dest, seq;
rtx r0, r16, eqv, tga, tp, dest, seq;
rtx_insn *insn;
switch (tls_symbolic_operand_type (x))
{
@ -1025,66 +1026,70 @@ alpha_legitimize_address_1 (rtx x, rtx scratch, machine_mode mode)
break;
case TLS_MODEL_GLOBAL_DYNAMIC:
start_sequence ();
{
start_sequence ();
r0 = gen_rtx_REG (Pmode, 0);
r16 = gen_rtx_REG (Pmode, 16);
tga = get_tls_get_addr ();
dest = gen_reg_rtx (Pmode);
seq = GEN_INT (alpha_next_sequence_number++);
r0 = gen_rtx_REG (Pmode, 0);
r16 = gen_rtx_REG (Pmode, 16);
tga = get_tls_get_addr ();
dest = gen_reg_rtx (Pmode);
seq = GEN_INT (alpha_next_sequence_number++);
emit_insn (gen_movdi_er_tlsgd (r16, pic_offset_table_rtx, x, seq));
insn = gen_call_value_osf_tlsgd (r0, tga, seq);
insn = emit_call_insn (insn);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r16);
emit_insn (gen_movdi_er_tlsgd (r16, pic_offset_table_rtx, x, seq));
rtx val = gen_call_value_osf_tlsgd (r0, tga, seq);
insn = emit_call_insn (val);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r16);
insn = get_insns ();
end_sequence ();
insn = get_insns ();
end_sequence ();
emit_libcall_block (insn, dest, r0, x);
return dest;
emit_libcall_block (insn, dest, r0, x);
return dest;
}
case TLS_MODEL_LOCAL_DYNAMIC:
start_sequence ();
{
start_sequence ();
r0 = gen_rtx_REG (Pmode, 0);
r16 = gen_rtx_REG (Pmode, 16);
tga = get_tls_get_addr ();
scratch = gen_reg_rtx (Pmode);
seq = GEN_INT (alpha_next_sequence_number++);
r0 = gen_rtx_REG (Pmode, 0);
r16 = gen_rtx_REG (Pmode, 16);
tga = get_tls_get_addr ();
scratch = gen_reg_rtx (Pmode);
seq = GEN_INT (alpha_next_sequence_number++);
emit_insn (gen_movdi_er_tlsldm (r16, pic_offset_table_rtx, seq));
insn = gen_call_value_osf_tlsldm (r0, tga, seq);
insn = emit_call_insn (insn);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r16);
emit_insn (gen_movdi_er_tlsldm (r16, pic_offset_table_rtx, seq));
rtx val = gen_call_value_osf_tlsldm (r0, tga, seq);
insn = emit_call_insn (val);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r16);
insn = get_insns ();
end_sequence ();
insn = get_insns ();
end_sequence ();
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
UNSPEC_TLSLDM_CALL);
emit_libcall_block (insn, scratch, r0, eqv);
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
UNSPEC_TLSLDM_CALL);
emit_libcall_block (insn, scratch, r0, eqv);
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), UNSPEC_DTPREL);
eqv = gen_rtx_CONST (Pmode, eqv);
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), UNSPEC_DTPREL);
eqv = gen_rtx_CONST (Pmode, eqv);
if (alpha_tls_size == 64)
{
dest = gen_reg_rtx (Pmode);
emit_insn (gen_rtx_SET (dest, eqv));
emit_insn (gen_adddi3 (dest, dest, scratch));
return dest;
}
if (alpha_tls_size == 32)
{
insn = gen_rtx_HIGH (Pmode, eqv);
insn = gen_rtx_PLUS (Pmode, scratch, insn);
scratch = gen_reg_rtx (Pmode);
emit_insn (gen_rtx_SET (scratch, insn));
}
return gen_rtx_LO_SUM (Pmode, scratch, eqv);
if (alpha_tls_size == 64)
{
dest = gen_reg_rtx (Pmode);
emit_insn (gen_rtx_SET (dest, eqv));
emit_insn (gen_adddi3 (dest, dest, scratch));
return dest;
}
if (alpha_tls_size == 32)
{
rtx temp = gen_rtx_HIGH (Pmode, eqv);
temp = gen_rtx_PLUS (Pmode, scratch, temp);
scratch = gen_reg_rtx (Pmode);
emit_insn (gen_rtx_SET (scratch, temp));
}
return gen_rtx_LO_SUM (Pmode, scratch, eqv);
}
case TLS_MODEL_INITIAL_EXEC:
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), UNSPEC_TPREL);
@ -1106,10 +1111,10 @@ alpha_legitimize_address_1 (rtx x, rtx scratch, machine_mode mode)
emit_insn (gen_get_thread_pointerdi (tp));
if (alpha_tls_size == 32)
{
insn = gen_rtx_HIGH (Pmode, eqv);
insn = gen_rtx_PLUS (Pmode, tp, insn);
rtx temp = gen_rtx_HIGH (Pmode, eqv);
temp = gen_rtx_PLUS (Pmode, tp, temp);
tp = gen_reg_rtx (Pmode);
emit_insn (gen_rtx_SET (tp, insn));
emit_insn (gen_rtx_SET (tp, temp));
}
return gen_rtx_LO_SUM (Pmode, tp, eqv);
@ -3059,7 +3064,7 @@ static void
alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[],
int noperands, rtx equiv)
{
rtx usage = NULL_RTX, tmp, reg;
rtx usage = NULL_RTX, reg;
int regno = 16, i;
start_sequence ();
@ -3109,9 +3114,9 @@ alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[],
gcc_unreachable ();
}
tmp = gen_rtx_MEM (QImode, func);
tmp = emit_call_insn (gen_call_value (reg, tmp, const0_rtx,
const0_rtx, const0_rtx));
rtx mem = gen_rtx_MEM (QImode, func);
rtx_insn *tmp = emit_call_insn (gen_call_value (reg, mem, const0_rtx,
const0_rtx, const0_rtx));
CALL_INSN_FUNCTION_USAGE (tmp) = usage;
RTL_CONST_CALL_P (tmp) = 1;

View File

@ -3396,10 +3396,11 @@ static GTY(()) rtx mips_tls_symbol;
(either global dynamic or local dynamic). V0 is an RTX for the
return value location. */
static rtx
static rtx_insn *
mips_call_tls_get_addr (rtx sym, enum mips_symbol_type type, rtx v0)
{
rtx insn, loc, a0;
rtx loc, a0;
rtx_insn *insn;
a0 = gen_rtx_REG (Pmode, GP_ARG_FIRST);
@ -3455,7 +3456,7 @@ mips_get_tp (void)
static rtx
mips_legitimize_tls_address (rtx loc)
{
rtx dest, insn, v0, tp, tmp1, tmp2, eqv, offset;
rtx dest, v0, tp, tmp1, tmp2, eqv, offset;
enum tls_model model;
model = SYMBOL_REF_TLS_MODEL (loc);
@ -3468,33 +3469,37 @@ mips_legitimize_tls_address (rtx loc)
switch (model)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
v0 = gen_rtx_REG (Pmode, GP_RETURN);
insn = mips_call_tls_get_addr (loc, SYMBOL_TLSGD, v0);
dest = gen_reg_rtx (Pmode);
emit_libcall_block (insn, dest, v0, loc);
break;
{
v0 = gen_rtx_REG (Pmode, GP_RETURN);
rtx_insn *insn = mips_call_tls_get_addr (loc, SYMBOL_TLSGD, v0);
dest = gen_reg_rtx (Pmode);
emit_libcall_block (insn, dest, v0, loc);
break;
}
case TLS_MODEL_LOCAL_DYNAMIC:
v0 = gen_rtx_REG (Pmode, GP_RETURN);
insn = mips_call_tls_get_addr (loc, SYMBOL_TLSLDM, v0);
tmp1 = gen_reg_rtx (Pmode);
{
v0 = gen_rtx_REG (Pmode, GP_RETURN);
rtx_insn *insn = mips_call_tls_get_addr (loc, SYMBOL_TLSLDM, v0);
tmp1 = gen_reg_rtx (Pmode);
/* Attach a unique REG_EQUIV, to allow the RTL optimizers to
share the LDM result with other LD model accesses. */
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
UNSPEC_TLS_LDM);
emit_libcall_block (insn, tmp1, v0, eqv);
/* Attach a unique REG_EQUIV, to allow the RTL optimizers to
share the LDM result with other LD model accesses. */
eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
UNSPEC_TLS_LDM);
emit_libcall_block (insn, tmp1, v0, eqv);
offset = mips_unspec_address (loc, SYMBOL_DTPREL);
if (mips_split_p[SYMBOL_DTPREL])
{
tmp2 = mips_unspec_offset_high (NULL, tmp1, loc, SYMBOL_DTPREL);
dest = gen_rtx_LO_SUM (Pmode, tmp2, offset);
}
else
dest = expand_binop (Pmode, add_optab, tmp1, offset,
0, 0, OPTAB_DIRECT);
break;
offset = mips_unspec_address (loc, SYMBOL_DTPREL);
if (mips_split_p[SYMBOL_DTPREL])
{
tmp2 = mips_unspec_offset_high (NULL, tmp1, loc, SYMBOL_DTPREL);
dest = gen_rtx_LO_SUM (Pmode, tmp2, offset);
}
else
dest = expand_binop (Pmode, add_optab, tmp1, offset,
0, 0, OPTAB_DIRECT);
break;
}
case TLS_MODEL_INITIAL_EXEC:
tp = mips_get_tp ();

View File

@ -1712,8 +1712,9 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1,
{
if (optab_handler (mov_optab, mode) != CODE_FOR_nothing)
{
temp = emit_move_insn (target ? target : product, product);
set_dst_reg_note (temp,
rtx_insn *move = emit_move_insn (target ? target : product,
product);
set_dst_reg_note (move,
REG_EQUAL,
gen_rtx_fmt_ee (MULT, mode,
copy_rtx (op0),

View File

@ -8703,7 +8703,6 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
#endif
else if (REG_P (out) && UNARY_P (in))
{
rtx insn;
rtx op1;
rtx out_moded;
rtx_insn *set;
@ -8728,13 +8727,13 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
gen_reload (out_moded, op1, opnum, type);
insn = gen_rtx_SET (out, gen_rtx_fmt_e (GET_CODE (in), GET_MODE (in),
out_moded));
insn = emit_insn_if_valid_for_reload (insn);
rtx temp = gen_rtx_SET (out, gen_rtx_fmt_e (GET_CODE (in), GET_MODE (in),
out_moded));
rtx_insn *insn = emit_insn_if_valid_for_reload (temp);
if (insn)
{
set_unique_reg_note (insn, REG_EQUIV, in);
return as_a <rtx_insn *> (insn);
return insn;
}
fatal_insn ("failure trying to reload:", set);