+2014-08-25 David Malcolm <dmalcolm@redhat.com>
+
+ * config/i386/i386-protos.h (ix86_avoid_lea_for_add): Strengthen
+ param 1 "insn" from rtx to rtx_insn *.
+ (ix86_use_lea_for_mov): Likewise.
+ (ix86_avoid_lea_for_addr): Likewise.
+ (ix86_split_lea_for_addr): Likewise.
+ (ix86_lea_for_add_ok): Likewise.
+ (ix86_output_call_insn): Likewise.
+
+ * config/i386/i386.c (ix86_va_start): Likewise for local "seq".
+ (ix86_get_drap_rtx): Likewise for locals "seq", "insn".
+ (ix86_output_function_epilogue): Likewise for locals "insn",
+ "deleted_debug_label".
+ (legitimize_tls_address): Likewise for local "insn".
+ (get_some_local_dynamic_name): Likewise.
+ (increase_distance): Likewise for params "prev", "next".
+ (distance_non_agu_define_in_bb): Likewise for params "insn",
+ "start" and locals "prev", "next".
+ (distance_non_agu_define): Likewise for param "insn".
+ (distance_agu_use_in_bb): Likewise for params "insn", "start" and
+ locals "next", "prev".
+ (distance_agu_use): Likewise for param "insn".
+ (ix86_lea_outperforms): Likewise.
+ (ix86_ok_to_clobber_flags): Likewise.
+ (ix86_avoid_lea_for_add): Likewise.
+ (ix86_use_lea_for_mov): Likewise.
+ (ix86_avoid_lea_for_addr): Likewise.
+ (find_nearest_reg_def): Likewise, also for locals "prev", "start".
+ (ix86_split_lea_for_addr): Likewise for param "insn".
+ (ix86_lea_for_add_ok): Likewise for param "insn".
+ (ix86_expand_carry_flag_compare): Likewise for local
+ "compare_seq".
+ (ix86_expand_int_movcc): Likewise.
+ (ix86_output_call_insn): Likewise for param "insn".
+ (ix86_output_call_insn): Likewise for local "i".
+ (x86_output_mi_thunk): Introduce local "insn", using it in place
+ of "tmp" when dealing with insns.
+ (ix86_avoid_jump_mispredicts): Likewise for locals "insn",
+ "start".
+ (ix86_pad_returns): Likewise for locals "ret", "prev".
+ (ix86_count_insn_bb): Likewise for local "insn".
+ (ix86_pad_short_function): Likewise for locals "ret", "insn".
+ (ix86_seh_fixup_eh_fallthru): Likewise for locals "insn", "next".
+ (ix86_vector_duplicate_value): Likewise for local "insn", "seq".
+ (expand_vec_perm_interleave2): Likewise for local "seq".
+ (expand_vec_perm_vperm2f128_vblend): Likewise.
+ (ix86_loop_unroll_adjust): Likewise for local "insn". Convert
+ call to for_each_rtx with for_each_rtx_in_insn.
+
2014-08-25 David Malcolm <dmalcolm@redhat.com>
* config/i386/i386.c (setup_incoming_varargs_64): Strengthen local
scratch_regno = split_stack_prologue_scratch_regno ();
if (scratch_regno != INVALID_REGNUM)
{
- rtx reg, seq;
+ rtx reg;
+ rtx_insn *seq;
reg = gen_reg_rtx (Pmode);
cfun->machine->split_stack_varargs_pointer = reg;
unsigned int regno = find_drap_reg ();
rtx drap_vreg;
rtx arg_ptr;
- rtx seq, insn;
+ rtx_insn *seq, *insn;
arg_ptr = gen_rtx_REG (Pmode, regno);
crtl->drap_reg = arg_ptr;
/* Mach-O doesn't support labels at the end of objects, so if
it looks like we might want one, insert a NOP. */
{
- rtx insn = get_last_insn ();
- rtx deleted_debug_label = NULL_RTX;
+ rtx_insn *insn = get_last_insn ();
+ rtx_insn *deleted_debug_label = NULL;
while (insn
&& NOTE_P (insn)
&& NOTE_KIND (insn) != NOTE_INSN_DELETED_LABEL)
if (TARGET_64BIT)
{
rtx rax = gen_rtx_REG (Pmode, AX_REG);
- rtx insns;
+ rtx_insn *insns;
start_sequence ();
emit_call_insn
if (TARGET_64BIT)
{
rtx rax = gen_rtx_REG (Pmode, AX_REG);
- rtx insns, eqv;
+ rtx_insn *insns;
+ rtx eqv;
start_sequence ();
emit_call_insn
static const char *
get_some_local_dynamic_name (void)
{
- rtx insn;
+ rtx_insn *insn;
if (cfun->machine->some_ld_name)
return cfun->machine->some_ld_name;
go to next cycle if there is some dependecy. */
static unsigned int
-increase_distance (rtx prev, rtx next, unsigned int distance)
+increase_distance (rtx_insn *prev, rtx_insn *next, unsigned int distance)
{
df_ref def, use;
static int
distance_non_agu_define_in_bb (unsigned int regno1, unsigned int regno2,
- rtx insn, int distance,
- rtx start, bool *found)
+ rtx_insn *insn, int distance,
+ rtx_insn *start, bool *found)
{
basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL;
- rtx prev = start;
- rtx next = NULL;
+ rtx_insn *prev = start;
+ rtx_insn *next = NULL;
*found = false;
static int
distance_non_agu_define (unsigned int regno1, unsigned int regno2,
- rtx insn)
+ rtx_insn *insn)
{
basic_block bb = BLOCK_FOR_INSN (insn);
int distance = 0;
static int
distance_agu_use_in_bb (unsigned int regno,
- rtx insn, int distance, rtx start,
+ rtx_insn *insn, int distance, rtx_insn *start,
bool *found, bool *redefined)
{
basic_block bb = NULL;
- rtx next = start;
- rtx prev = NULL;
+ rtx_insn *next = start;
+ rtx_insn *prev = NULL;
*found = false;
*redefined = false;
a use is found within LEA_SEARCH_THRESHOLD or REGNO0 is set. */
static int
-distance_agu_use (unsigned int regno0, rtx insn)
+distance_agu_use (unsigned int regno0, rtx_insn *insn)
{
basic_block bb = BLOCK_FOR_INSN (insn);
int distance = 0;
SPLIT_COST cycles higher latency than lea latency. */
static bool
-ix86_lea_outperforms (rtx insn, unsigned int regno0, unsigned int regno1,
+ix86_lea_outperforms (rtx_insn *insn, unsigned int regno0, unsigned int regno1,
unsigned int regno2, int split_cost, bool has_scale)
{
int dist_define, dist_use;
false otherwise. */
static bool
-ix86_ok_to_clobber_flags (rtx insn)
+ix86_ok_to_clobber_flags (rtx_insn *insn)
{
basic_block bb = BLOCK_FOR_INSN (insn);
df_ref use;
move and add to avoid AGU stalls. */
bool
-ix86_avoid_lea_for_add (rtx insn, rtx operands[])
+ix86_avoid_lea_for_add (rtx_insn *insn, rtx operands[])
{
unsigned int regno0, regno1, regno2;
instruction. */
bool
-ix86_use_lea_for_mov (rtx insn, rtx operands[])
+ix86_use_lea_for_mov (rtx_insn *insn, rtx operands[])
{
unsigned int regno0, regno1;
instructions to avoid AGU stalls. */
bool
-ix86_avoid_lea_for_addr (rtx insn, rtx operands[])
+ix86_avoid_lea_for_addr (rtx_insn *insn, rtx operands[])
{
unsigned int regno0, regno1, regno2;
int split_cost;
/* Return true if regno1 def is nearest to the insn. */
static bool
-find_nearest_reg_def (rtx insn, int regno1, int regno2)
+find_nearest_reg_def (rtx_insn *insn, int regno1, int regno2)
{
- rtx prev = insn;
- rtx start = BB_HEAD (BLOCK_FOR_INSN (insn));
+ rtx_insn *prev = insn;
+ rtx_insn *start = BB_HEAD (BLOCK_FOR_INSN (insn));
if (insn == start)
return false;
at lea position. */
void
-ix86_split_lea_for_addr (rtx insn, rtx operands[], enum machine_mode mode)
+ix86_split_lea_for_addr (rtx_insn *insn, rtx operands[], enum machine_mode mode)
{
unsigned int regno0, regno1, regno2;
struct ix86_address parts;
used soon, LEA is better and otherwise ADD is better. */
bool
-ix86_lea_for_add_ok (rtx insn, rtx operands[])
+ix86_lea_for_add_ok (rtx_insn *insn, rtx operands[])
{
unsigned int regno0 = true_regnum (operands[0]);
unsigned int regno1 = true_regnum (operands[1]);
if (SCALAR_FLOAT_MODE_P (mode))
{
- rtx compare_op, compare_seq;
+ rtx compare_op;
+ rtx_insn *compare_seq;
gcc_assert (!DECIMAL_FLOAT_MODE_P (mode));
ix86_expand_int_movcc (rtx operands[])
{
enum rtx_code code = GET_CODE (operands[1]), compare_code;
- rtx compare_seq, compare_op;
+ rtx_insn *compare_seq;
+ rtx compare_op;
enum machine_mode mode = GET_MODE (operands[0]);
bool sign_bit_compare_p = false;
rtx op0 = XEXP (operands[1], 0);
/* Output the assembly for a call instruction. */
const char *
-ix86_output_call_insn (rtx insn, rtx call_op)
+ix86_output_call_insn (rtx_insn *insn, rtx call_op)
{
bool direct_p = constant_call_address_operand (call_op, VOIDmode);
bool seh_nop_p = false;
circumstances. Determine if we have one of those. */
if (TARGET_SEH)
{
- rtx i;
+ rtx_insn *i;
for (i = NEXT_INSN (insn); i ; i = NEXT_INSN (i))
{
rtx this_param = x86_this_parameter (function);
rtx this_reg, tmp, fnaddr;
unsigned int tmp_regno;
+ rtx_insn *insn;
if (TARGET_64BIT)
tmp_regno = R10_REG;
/* Emit just enough of rest_of_compilation to get the insns emitted.
Note that use_thunk calls assemble_start_function et al. */
- tmp = get_insns ();
- shorten_branches (tmp);
- final_start_function (tmp, file, 1);
- final (tmp, file, 1);
+ insn = get_insns ();
+ shorten_branches (insn);
+ final_start_function (insn, file, 1);
+ final (insn, file, 1);
final_end_function ();
}
static void
ix86_avoid_jump_mispredicts (void)
{
- rtx insn, start = get_insns ();
+ rtx_insn *insn, *start = get_insns ();
int nbytes = 0, njumps = 0;
int isjump = 0;
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds)
{
basic_block bb = e->src;
- rtx ret = BB_END (bb);
- rtx prev;
+ rtx_insn *ret = BB_END (bb);
+ rtx_insn *prev;
bool replace = false;
if (!JUMP_P (ret) || !ANY_RETURN_P (PATTERN (ret))
static int
ix86_count_insn_bb (basic_block bb)
{
- rtx insn;
+ rtx_insn *insn;
int insn_count = 0;
/* Count number of instructions in this block. Return 4 if the number
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds)
{
- rtx ret = BB_END (e->src);
+ rtx_insn *ret = BB_END (e->src);
if (JUMP_P (ret) && ANY_RETURN_P (PATTERN (ret)))
{
int insn_count = ix86_count_insn (e->src);
/* Pad short function. */
if (insn_count < 4)
{
- rtx insn = ret;
+ rtx_insn *insn = ret;
/* Find epilogue. */
while (insn
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds)
{
- rtx insn, next;
+ rtx_insn *insn, *next;
/* Find the beginning of the epilogue. */
for (insn = BB_END (e->src); insn != NULL; insn = PREV_INSN (insn))
ix86_vector_duplicate_value (enum machine_mode mode, rtx target, rtx val)
{
bool ok;
- rtx insn, dup;
+ rtx_insn *insn;
+ rtx dup;
/* First attempt to recognize VAL as-is. */
dup = gen_rtx_VEC_DUPLICATE (mode, val);
insn = emit_insn (gen_rtx_SET (VOIDmode, target, dup));
if (recog_memoized (insn) < 0)
{
- rtx seq;
+ rtx_insn *seq;
/* If that fails, force VAL into a register. */
start_sequence ();
unsigned i, nelt = d->nelt, nelt2 = nelt / 2;
unsigned HOST_WIDE_INT contents;
unsigned char remap[2 * MAX_VECT_LEN];
- rtx seq;
+ rtx_insn *seq;
bool ok, same_halves = false;
if (GET_MODE_SIZE (d->vmode) == 16)
{
struct expand_vec_perm_d dfirst, dsecond;
unsigned i, j, msk, nelt = d->nelt, nelt2 = nelt / 2;
- rtx seq;
+ rtx_insn *seq;
bool ok;
rtx (*blend) (rtx, rtx, rtx, rtx) = NULL;
ix86_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
{
basic_block *bbs;
- rtx insn;
+ rtx_insn *insn;
unsigned i;
unsigned mem_count = 0;
{
for (insn = BB_HEAD (bbs[i]); insn != BB_END (bbs[i]); insn = NEXT_INSN (insn))
if (NONDEBUG_INSN_P (insn))
- for_each_rtx (&insn, (rtx_function) ix86_loop_memcount, &mem_count);
+ for_each_rtx_in_insn (&insn, (rtx_function) ix86_loop_memcount,
+ &mem_count);
}
free (bbs);