Commit bd96e53c by David Malcolm Committed by David Malcolm

config/bfin: Use rtx_insn

gcc/
	* config/bfin/bfin-protos.h (asm_conditional_branch): Strengthen
	param 1 from rtx to rtx_insn *.
	* config/bfin/bfin.c (expand_prologue_reg_save): Likewise for
	the various locals named "insn".
	(expand_epilogue_reg_restore): Likewise.
	(frame_related_constant_load): Likewise.
	(add_to_reg): Likewise.
	(emit_link_insn): Likewise.
	(do_link): Likewise.
	(expand_interrupt_handler_prologue): Likewise.
	(branch_dest): Likewise for param "branch".
	(asm_conditional_branch): Likewise for param "insn".
	(gen_one_bundle): Likewise for elements of param "slot" and local
	"t".
	(bfin_gen_bundles): Likewise for locals "insn", "next" and
	elements of local "slot".
	(reorder_var_tracking_notes): Likewise for locals "insn", "next",
	"queue", "next_queue", "prev".
	(workaround_rts_anomaly): Likewise for locals "insn", "first_insn".
	(add_sched_insns_for_speculation): Likewise for local "insn".

From-SVN: r214439
parent 98024b4e
2014-08-25 David Malcolm <dmalcolm@redhat.com> 2014-08-25 David Malcolm <dmalcolm@redhat.com>
* config/bfin/bfin-protos.h (asm_conditional_branch): Strengthen
param 1 from rtx to rtx_insn *.
* config/bfin/bfin.c (expand_prologue_reg_save): Likewise for
the various locals named "insn".
(expand_epilogue_reg_restore): Likewise.
(frame_related_constant_load): Likewise.
(add_to_reg): Likewise.
(emit_link_insn): Likewise.
(do_link): Likewise.
(expand_interrupt_handler_prologue): Likewise.
(branch_dest): Likewise for param "branch".
(asm_conditional_branch): Likewise for param "insn".
(gen_one_bundle): Likewise for elements of param "slot" and local
"t".
(bfin_gen_bundles): Likewise for locals "insn", "next" and
elements of local "slot".
(reorder_var_tracking_notes): Likewise for locals "insn", "next",
"queue", "next_queue", "prev".
(workaround_rts_anomaly): Likewise for locals "insn", "first_insn".
(add_sched_insns_for_speculation): Likewise for local "insn".
2014-08-25 David Malcolm <dmalcolm@redhat.com>
* config/avr/avr-protos.h (output_movqi): Strengthen first param * config/avr/avr-protos.h (output_movqi): Strengthen first param
from rtx to rtx_insn *. from rtx to rtx_insn *.
(output_movhi): Likewise. (output_movhi): Likewise.
......
...@@ -97,7 +97,7 @@ extern void print_address_operand (FILE *, rtx); ...@@ -97,7 +97,7 @@ extern void print_address_operand (FILE *, rtx);
extern void split_di (rtx [], int, rtx [], rtx []); extern void split_di (rtx [], int, rtx [], rtx []);
extern int split_load_immediate (rtx []); extern int split_load_immediate (rtx []);
extern void emit_pic_move (rtx *, enum machine_mode); extern void emit_pic_move (rtx *, enum machine_mode);
extern void asm_conditional_branch (rtx, rtx *, int, int); extern void asm_conditional_branch (rtx_insn *, rtx *, int, int);
extern rtx bfin_gen_compare (rtx, enum machine_mode); extern rtx bfin_gen_compare (rtx, enum machine_mode);
extern unsigned bfin_local_alignment (tree, unsigned); extern unsigned bfin_local_alignment (tree, unsigned);
......
...@@ -346,7 +346,7 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler) ...@@ -346,7 +346,7 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler)
if (saveall || is_inthandler) if (saveall || is_inthandler)
{ {
rtx insn = emit_move_insn (predec, gen_rtx_REG (SImode, REG_ASTAT)); rtx_insn *insn = emit_move_insn (predec, gen_rtx_REG (SImode, REG_ASTAT));
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
for (dregno = REG_LT0; dregno <= REG_LB1; dregno++) for (dregno = REG_LT0; dregno <= REG_LB1; dregno++)
...@@ -363,7 +363,7 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler) ...@@ -363,7 +363,7 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler)
if (total_consec != 0) if (total_consec != 0)
{ {
rtx insn; rtx_insn *insn;
rtx val = GEN_INT (-total_consec * 4); rtx val = GEN_INT (-total_consec * 4);
rtx pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_consec + 2)); rtx pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total_consec + 2));
...@@ -405,7 +405,8 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler) ...@@ -405,7 +405,8 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler)
{ {
if (must_save_p (is_inthandler, dregno)) if (must_save_p (is_inthandler, dregno))
{ {
rtx insn = emit_move_insn (predec, gen_rtx_REG (word_mode, dregno)); rtx_insn *insn =
emit_move_insn (predec, gen_rtx_REG (word_mode, dregno));
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
ndregs--; ndregs--;
} }
...@@ -414,7 +415,8 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler) ...@@ -414,7 +415,8 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler)
{ {
if (must_save_p (is_inthandler, pregno)) if (must_save_p (is_inthandler, pregno))
{ {
rtx insn = emit_move_insn (predec, gen_rtx_REG (word_mode, pregno)); rtx_insn *insn =
emit_move_insn (predec, gen_rtx_REG (word_mode, pregno));
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
npregs--; npregs--;
} }
...@@ -425,7 +427,7 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler) ...@@ -425,7 +427,7 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler)
&& (df_regs_ever_live_p (i) && (df_regs_ever_live_p (i)
|| (!leaf_function_p () && call_used_regs[i])))) || (!leaf_function_p () && call_used_regs[i]))))
{ {
rtx insn; rtx_insn *insn;
if (i == REG_A0 || i == REG_A1) if (i == REG_A0 || i == REG_A1)
insn = emit_move_insn (gen_rtx_MEM (PDImode, predec1), insn = emit_move_insn (gen_rtx_MEM (PDImode, predec1),
gen_rtx_REG (PDImode, i)); gen_rtx_REG (PDImode, i));
...@@ -452,7 +454,7 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler) ...@@ -452,7 +454,7 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler)
int npregs_consec = saveall ? 6 : n_pregs_to_save (is_inthandler, true); int npregs_consec = saveall ? 6 : n_pregs_to_save (is_inthandler, true);
int total_consec = ndregs_consec + npregs_consec; int total_consec = ndregs_consec + npregs_consec;
int i, regno; int i, regno;
rtx insn; rtx_insn *insn;
/* A slightly crude technique to stop flow from trying to delete "dead" /* A slightly crude technique to stop flow from trying to delete "dead"
insns. */ insns. */
...@@ -706,7 +708,7 @@ bfin_initial_elimination_offset (int from, int to) ...@@ -706,7 +708,7 @@ bfin_initial_elimination_offset (int from, int to)
static void static void
frame_related_constant_load (rtx reg, HOST_WIDE_INT constant, bool related) frame_related_constant_load (rtx reg, HOST_WIDE_INT constant, bool related)
{ {
rtx insn; rtx_insn *insn;
rtx cst = GEN_INT (constant); rtx cst = GEN_INT (constant);
if (constant >= -32768 && constant < 65536) if (constant >= -32768 && constant < 65536)
...@@ -743,7 +745,7 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p) ...@@ -743,7 +745,7 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p)
{ {
rtx tmpreg; rtx tmpreg;
rtx tmpreg2; rtx tmpreg2;
rtx insn; rtx_insn *insn;
tmpreg2 = NULL_RTX; tmpreg2 = NULL_RTX;
...@@ -792,7 +794,7 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p) ...@@ -792,7 +794,7 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p)
do do
{ {
int size = value; int size = value;
rtx insn; rtx_insn *insn;
if (size > 60) if (size > 60)
size = 60; size = 60;
...@@ -817,7 +819,7 @@ static void ...@@ -817,7 +819,7 @@ static void
emit_link_insn (rtx spreg, HOST_WIDE_INT frame_size) emit_link_insn (rtx spreg, HOST_WIDE_INT frame_size)
{ {
HOST_WIDE_INT link_size = frame_size; HOST_WIDE_INT link_size = frame_size;
rtx insn; rtx_insn *insn;
int i; int i;
if (link_size > 262140) if (link_size > 262140)
...@@ -884,7 +886,7 @@ do_link (rtx spreg, HOST_WIDE_INT frame_size, bool all) ...@@ -884,7 +886,7 @@ do_link (rtx spreg, HOST_WIDE_INT frame_size, bool all)
rtx pat = gen_movsi (gen_rtx_MEM (Pmode, rtx pat = gen_movsi (gen_rtx_MEM (Pmode,
gen_rtx_PRE_DEC (Pmode, spreg)), gen_rtx_PRE_DEC (Pmode, spreg)),
bfin_rets_rtx); bfin_rets_rtx);
rtx insn = emit_insn (pat); rtx_insn *insn = emit_insn (pat);
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
} }
if (must_save_fp_p ()) if (must_save_fp_p ())
...@@ -892,7 +894,7 @@ do_link (rtx spreg, HOST_WIDE_INT frame_size, bool all) ...@@ -892,7 +894,7 @@ do_link (rtx spreg, HOST_WIDE_INT frame_size, bool all)
rtx pat = gen_movsi (gen_rtx_MEM (Pmode, rtx pat = gen_movsi (gen_rtx_MEM (Pmode,
gen_rtx_PRE_DEC (Pmode, spreg)), gen_rtx_PRE_DEC (Pmode, spreg)),
gen_rtx_REG (Pmode, REG_FP)); gen_rtx_REG (Pmode, REG_FP));
rtx insn = emit_insn (pat); rtx_insn *insn = emit_insn (pat);
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
} }
add_to_reg (spreg, -frame_size, 1, 0); add_to_reg (spreg, -frame_size, 1, 0);
...@@ -940,7 +942,7 @@ expand_interrupt_handler_prologue (rtx spreg, e_funkind fkind, bool all) ...@@ -940,7 +942,7 @@ expand_interrupt_handler_prologue (rtx spreg, e_funkind fkind, bool all)
HOST_WIDE_INT frame_size = get_frame_size (); HOST_WIDE_INT frame_size = get_frame_size ();
rtx predec1 = gen_rtx_PRE_DEC (SImode, spreg); rtx predec1 = gen_rtx_PRE_DEC (SImode, spreg);
rtx predec = gen_rtx_MEM (SImode, predec1); rtx predec = gen_rtx_MEM (SImode, predec1);
rtx insn; rtx_insn *insn;
tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)); tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl));
tree kspisusp = lookup_attribute ("kspisusp", attrs); tree kspisusp = lookup_attribute ("kspisusp", attrs);
...@@ -2416,7 +2418,7 @@ bfin_option_override (void) ...@@ -2416,7 +2418,7 @@ bfin_option_override (void)
we still prefer to use shorter sequences. */ we still prefer to use shorter sequences. */
static int static int
branch_dest (rtx branch) branch_dest (rtx_insn *branch)
{ {
rtx dest; rtx dest;
int dest_uid; int dest_uid;
...@@ -2470,7 +2472,7 @@ static const char *ccbranch_templates[][3] = { ...@@ -2470,7 +2472,7 @@ static const char *ccbranch_templates[][3] = {
anyway. */ anyway. */
void void
asm_conditional_branch (rtx insn, rtx *operands, int n_nops, int predict_taken) asm_conditional_branch (rtx_insn *insn, rtx *operands, int n_nops, int predict_taken)
{ {
int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn)); int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
/* Note : offset for instructions like if cc jmp; jump.[sl] offset /* Note : offset for instructions like if cc jmp; jump.[sl] offset
...@@ -3895,7 +3897,7 @@ bfin_reorg_loops (void) ...@@ -3895,7 +3897,7 @@ bfin_reorg_loops (void)
/* Possibly generate a SEQUENCE out of three insns found in SLOT. /* Possibly generate a SEQUENCE out of three insns found in SLOT.
Returns true if we modified the insn chain, false otherwise. */ Returns true if we modified the insn chain, false otherwise. */
static bool static bool
gen_one_bundle (rtx slot[3]) gen_one_bundle (rtx_insn *slot[3])
{ {
gcc_assert (slot[1] != NULL_RTX); gcc_assert (slot[1] != NULL_RTX);
...@@ -3917,7 +3919,7 @@ gen_one_bundle (rtx slot[3]) ...@@ -3917,7 +3919,7 @@ gen_one_bundle (rtx slot[3])
} }
if (slot[2]) if (slot[2])
{ {
rtx t = NEXT_INSN (slot[1]); rtx_insn *t = NEXT_INSN (slot[1]);
while (t != slot[2]) while (t != slot[2])
{ {
if (! NOTE_P (t) || NOTE_KIND (t) != NOTE_INSN_DELETED) if (! NOTE_P (t) || NOTE_KIND (t) != NOTE_INSN_DELETED)
...@@ -3963,11 +3965,11 @@ bfin_gen_bundles (void) ...@@ -3963,11 +3965,11 @@ bfin_gen_bundles (void)
basic_block bb; basic_block bb;
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
rtx insn, next; rtx_insn *insn, *next;
rtx slot[3]; rtx_insn *slot[3];
int n_filled = 0; int n_filled = 0;
slot[0] = slot[1] = slot[2] = NULL_RTX; slot[0] = slot[1] = slot[2] = NULL;
for (insn = BB_HEAD (bb);; insn = next) for (insn = BB_HEAD (bb);; insn = next)
{ {
int at_end; int at_end;
...@@ -4023,7 +4025,7 @@ bfin_gen_bundles (void) ...@@ -4023,7 +4025,7 @@ bfin_gen_bundles (void)
} }
} }
n_filled = 0; n_filled = 0;
slot[0] = slot[1] = slot[2] = NULL_RTX; slot[0] = slot[1] = slot[2] = NULL;
} }
if (delete_this != NULL_RTX) if (delete_this != NULL_RTX)
delete_insn (delete_this); delete_insn (delete_this);
...@@ -4042,8 +4044,8 @@ reorder_var_tracking_notes (void) ...@@ -4042,8 +4044,8 @@ reorder_var_tracking_notes (void)
basic_block bb; basic_block bb;
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
rtx insn, next; rtx_insn *insn, *next;
rtx queue = NULL_RTX; rtx_insn *queue = NULL;
bool in_bundle = false; bool in_bundle = false;
for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = next) for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = next)
...@@ -4057,7 +4059,7 @@ reorder_var_tracking_notes (void) ...@@ -4057,7 +4059,7 @@ reorder_var_tracking_notes (void)
{ {
while (queue) while (queue)
{ {
rtx next_queue = PREV_INSN (queue); rtx_insn *next_queue = PREV_INSN (queue);
SET_PREV_INSN (NEXT_INSN (insn)) = queue; SET_PREV_INSN (NEXT_INSN (insn)) = queue;
SET_NEXT_INSN (queue) = NEXT_INSN (insn); SET_NEXT_INSN (queue) = NEXT_INSN (insn);
SET_NEXT_INSN (insn) = queue; SET_NEXT_INSN (insn) = queue;
...@@ -4073,7 +4075,7 @@ reorder_var_tracking_notes (void) ...@@ -4073,7 +4075,7 @@ reorder_var_tracking_notes (void)
{ {
if (in_bundle) if (in_bundle)
{ {
rtx prev = PREV_INSN (insn); rtx_insn *prev = PREV_INSN (insn);
SET_PREV_INSN (next) = prev; SET_PREV_INSN (next) = prev;
SET_NEXT_INSN (prev) = next; SET_NEXT_INSN (prev) = next;
...@@ -4091,7 +4093,7 @@ reorder_var_tracking_notes (void) ...@@ -4091,7 +4093,7 @@ reorder_var_tracking_notes (void)
static void static void
workaround_rts_anomaly (void) workaround_rts_anomaly (void)
{ {
rtx insn, first_insn = NULL_RTX; rtx_insn *insn, *first_insn = NULL;
int cycles = 4; int cycles = 4;
if (! ENABLE_WA_RETS) if (! ENABLE_WA_RETS)
...@@ -4526,7 +4528,7 @@ workaround_speculation (void) ...@@ -4526,7 +4528,7 @@ workaround_speculation (void)
static void static void
add_sched_insns_for_speculation (void) add_sched_insns_for_speculation (void)
{ {
rtx insn; rtx_insn *insn;
if (! ENABLE_WA_SPECULATIVE_LOADS && ! ENABLE_WA_SPECULATIVE_SYNCS if (! ENABLE_WA_SPECULATIVE_LOADS && ! ENABLE_WA_SPECULATIVE_SYNCS
&& ! ENABLE_WA_INDIRECT_CALLS) && ! ENABLE_WA_INDIRECT_CALLS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment