Commit 070a1983 by David Malcolm Committed by David Malcolm

ira: Use rtx_insn in various places

gcc/
	* ira-int.h (struct ira_allocno_copy): Strengthen field "insn"
	from rtx to rtx_insn *insn.
	(ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *.
	(ira_add_allocno_copy): Likewise.
	* ira-build.c (find_allocno_copy): Strengthen param "insn" from
	rtx to rtx_insn *.
	(ira_create_copy): Likewise.
	(ira_add_allocno_copy): Likewise.
	(create_bb_allocnos): Likewise for local "insn".
	* ira-conflicts.c (process_regs_for_copy): Likewise for param "insn".
	(process_reg_shuffles): Update NULL_RTX to NULL in invocation of
	process_regs_for_copy for rtx_insn * param.
	(add_insn_allocno_copies): Strengthen param "insn" from rtx to
	rtx_insn *insn.  Update NULL_RTX to NULL in invocation of
	process_regs_for_copy for rtx_insn * param.
	(add_copies): Strengthen local "insn" from rtx to rtx_insn *insn.
	* ira-costs.c (record_reg_classes): Likewise for param "insn".
	(record_operand_costs): Likewise.
	(scan_one_insn): Likewise for return type, and for param "insn".
	(process_bb_for_costs): Likewise for local "insn".
	(process_bb_node_for_hard_reg_moves): Likewise.
	* ira-emit.c (struct move): Likewise for field "insn".
	(create_move): Eliminate use of NULL_RTX when dealing with an
	rtx_insn *.
	(emit_move_list): Strengthen return type and locals "result",
	"insn" from rtx to rtx_insn *insn.
	(emit_moves): Likewise for locals "insns", "tmp".
	(ira_emit): Likewise for local "insn".
	* ira-lives.c (mark_hard_reg_early_clobbers): Likewise for param
	"insn".
	(find_call_crossed_cheap_reg): Likewise.
	(process_bb_node_lives): Likewise for local "insn".
	* ira.c (decrease_live_ranges_number): Likewise.
	(compute_regs_asm_clobbered): Likewise.
	(build_insn_chain): Likewise.
	(find_moveable_pseudos): Likewise, also locals "def_insn",
	"use_insn", "x".  Also strengthen local "closest_uses" from rtx *
	to rtx_insn **.  Add a checked cast when assigning from
	"closest_use" into closest_uses array in a region where we know
	it's a non-NULL insn.
	(interesting_dest_for_shprep): Strengthen param "insn" from rtx
	to rtx_insn *.
	(split_live_ranges_for_shrink_wrap): Likewise for locals "insn",
	"last_interesting_insn", "uin".
	(move_unallocated_pseudos): Likewise for locals "def_insn",
	"move_insn", "newinsn".

From-SVN: r214339
parent da664544
2014-08-22 David Malcolm <dmalcolm@redhat.com> 2014-08-22 David Malcolm <dmalcolm@redhat.com>
* ira-int.h (struct ira_allocno_copy): Strengthen field "insn"
from rtx to rtx_insn *insn.
(ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *.
(ira_add_allocno_copy): Likewise.
* ira-build.c (find_allocno_copy): Strengthen param "insn" from
rtx to rtx_insn *.
(ira_create_copy): Likewise.
(ira_add_allocno_copy): Likewise.
(create_bb_allocnos): Likewise for local "insn".
* ira-conflicts.c (process_regs_for_copy): Likewise for param "insn".
(process_reg_shuffles): Update NULL_RTX to NULL in invocation of
process_regs_for_copy for rtx_insn * param.
(add_insn_allocno_copies): Strengthen param "insn" from rtx to
rtx_insn *insn. Update NULL_RTX to NULL in invocation of
process_regs_for_copy for rtx_insn * param.
(add_copies): Strengthen local "insn" from rtx to rtx_insn *insn.
* ira-costs.c (record_reg_classes): Likewise for param "insn".
(record_operand_costs): Likewise.
(scan_one_insn): Likewise for return type, and for param "insn".
(process_bb_for_costs): Likewise for local "insn".
(process_bb_node_for_hard_reg_moves): Likewise.
* ira-emit.c (struct move): Likewise for field "insn".
(create_move): Eliminate use of NULL_RTX when dealing with an
rtx_insn *.
(emit_move_list): Strengthen return type and locals "result",
"insn" from rtx to rtx_insn *insn.
(emit_moves): Likewise for locals "insns", "tmp".
(ira_emit): Likewise for local "insn".
* ira-lives.c (mark_hard_reg_early_clobbers): Likewise for param
"insn".
(find_call_crossed_cheap_reg): Likewise.
(process_bb_node_lives): Likewise for local "insn".
* ira.c (decrease_live_ranges_number): Likewise.
(compute_regs_asm_clobbered): Likewise.
(build_insn_chain): Likewise.
(find_moveable_pseudos): Likewise, also locals "def_insn",
"use_insn", "x". Also strengthen local "closest_uses" from rtx *
to rtx_insn **. Add a checked cast when assigning from
"closest_use" into closest_uses array in a region where we know
it's a non-NULL insn.
(interesting_dest_for_shprep): Strengthen param "insn" from rtx
to rtx_insn *.
(split_live_ranges_for_shrink_wrap): Likewise for locals "insn",
"last_interesting_insn", "uin".
(move_unallocated_pseudos): Likewise for locals "def_insn",
"move_insn", "newinsn".
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* internal-fn.c (ubsan_expand_si_overflow_addsub_check): * internal-fn.c (ubsan_expand_si_overflow_addsub_check):
Strengthen locals "done_label", "do_error" from rtx to Strengthen locals "done_label", "do_error" from rtx to
rtx_code_label *. rtx_code_label *.
......
...@@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "ira-int.h" #include "ira-int.h"
#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */ #include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
static ira_copy_t find_allocno_copy (ira_allocno_t, ira_allocno_t, rtx, static ira_copy_t find_allocno_copy (ira_allocno_t, ira_allocno_t, rtx_insn *,
ira_loop_tree_node_t); ira_loop_tree_node_t);
/* The root of the loop tree corresponding to the all function. */ /* The root of the loop tree corresponding to the all function. */
...@@ -1385,7 +1385,7 @@ initiate_copies (void) ...@@ -1385,7 +1385,7 @@ initiate_copies (void)
/* Return copy connecting A1 and A2 and originated from INSN of /* Return copy connecting A1 and A2 and originated from INSN of
LOOP_TREE_NODE if any. */ LOOP_TREE_NODE if any. */
static ira_copy_t static ira_copy_t
find_allocno_copy (ira_allocno_t a1, ira_allocno_t a2, rtx insn, find_allocno_copy (ira_allocno_t a1, ira_allocno_t a2, rtx_insn *insn,
ira_loop_tree_node_t loop_tree_node) ira_loop_tree_node_t loop_tree_node)
{ {
ira_copy_t cp, next_cp; ira_copy_t cp, next_cp;
...@@ -1416,7 +1416,7 @@ find_allocno_copy (ira_allocno_t a1, ira_allocno_t a2, rtx insn, ...@@ -1416,7 +1416,7 @@ find_allocno_copy (ira_allocno_t a1, ira_allocno_t a2, rtx insn,
SECOND, FREQ, CONSTRAINT_P, and INSN. */ SECOND, FREQ, CONSTRAINT_P, and INSN. */
ira_copy_t ira_copy_t
ira_create_copy (ira_allocno_t first, ira_allocno_t second, int freq, ira_create_copy (ira_allocno_t first, ira_allocno_t second, int freq,
bool constraint_p, rtx insn, bool constraint_p, rtx_insn *insn,
ira_loop_tree_node_t loop_tree_node) ira_loop_tree_node_t loop_tree_node)
{ {
ira_copy_t cp; ira_copy_t cp;
...@@ -1493,7 +1493,7 @@ swap_allocno_copy_ends_if_necessary (ira_copy_t cp) ...@@ -1493,7 +1493,7 @@ swap_allocno_copy_ends_if_necessary (ira_copy_t cp)
LOOP_TREE_NODE. */ LOOP_TREE_NODE. */
ira_copy_t ira_copy_t
ira_add_allocno_copy (ira_allocno_t first, ira_allocno_t second, int freq, ira_add_allocno_copy (ira_allocno_t first, ira_allocno_t second, int freq,
bool constraint_p, rtx insn, bool constraint_p, rtx_insn *insn,
ira_loop_tree_node_t loop_tree_node) ira_loop_tree_node_t loop_tree_node)
{ {
ira_copy_t cp; ira_copy_t cp;
...@@ -1927,7 +1927,7 @@ static void ...@@ -1927,7 +1927,7 @@ static void
create_bb_allocnos (ira_loop_tree_node_t bb_node) create_bb_allocnos (ira_loop_tree_node_t bb_node)
{ {
basic_block bb; basic_block bb;
rtx insn; rtx_insn *insn;
unsigned int i; unsigned int i;
bitmap_iterator bi; bitmap_iterator bi;
......
...@@ -244,7 +244,7 @@ go_through_subreg (rtx x, int *offset) ...@@ -244,7 +244,7 @@ go_through_subreg (rtx x, int *offset)
FALSE. */ FALSE. */
static bool static bool
process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p, process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p,
rtx insn, int freq) rtx_insn *insn, int freq)
{ {
int allocno_preferenced_hard_regno, cost, index, offset1, offset2; int allocno_preferenced_hard_regno, cost, index, offset1, offset2;
bool only_regs_p; bool only_regs_p;
...@@ -345,7 +345,7 @@ process_reg_shuffles (rtx reg, int op_num, int freq, bool *bound_p) ...@@ -345,7 +345,7 @@ process_reg_shuffles (rtx reg, int op_num, int freq, bool *bound_p)
|| bound_p[i]) || bound_p[i])
continue; continue;
process_regs_for_copy (reg, another_reg, false, NULL_RTX, freq); process_regs_for_copy (reg, another_reg, false, NULL, freq);
} }
} }
...@@ -353,7 +353,7 @@ process_reg_shuffles (rtx reg, int op_num, int freq, bool *bound_p) ...@@ -353,7 +353,7 @@ process_reg_shuffles (rtx reg, int op_num, int freq, bool *bound_p)
it might be because INSN is a pseudo-register move or INSN is two it might be because INSN is a pseudo-register move or INSN is two
operand insn. */ operand insn. */
static void static void
add_insn_allocno_copies (rtx insn) add_insn_allocno_copies (rtx_insn *insn)
{ {
rtx set, operand, dup; rtx set, operand, dup;
bool bound_p[MAX_RECOG_OPERANDS]; bool bound_p[MAX_RECOG_OPERANDS];
...@@ -396,7 +396,7 @@ add_insn_allocno_copies (rtx insn) ...@@ -396,7 +396,7 @@ add_insn_allocno_copies (rtx insn)
REG_P (operand) REG_P (operand)
? operand ? operand
: SUBREG_REG (operand)) != NULL_RTX) : SUBREG_REG (operand)) != NULL_RTX)
process_regs_for_copy (operand, dup, true, NULL_RTX, process_regs_for_copy (operand, dup, true, NULL,
freq); freq);
} }
} }
...@@ -421,7 +421,7 @@ static void ...@@ -421,7 +421,7 @@ static void
add_copies (ira_loop_tree_node_t loop_tree_node) add_copies (ira_loop_tree_node_t loop_tree_node)
{ {
basic_block bb; basic_block bb;
rtx insn; rtx_insn *insn;
bb = loop_tree_node->bb; bb = loop_tree_node->bb;
if (bb == NULL) if (bb == NULL)
......
...@@ -403,7 +403,7 @@ copy_cost (rtx x, enum machine_mode mode, reg_class_t rclass, bool to_p, ...@@ -403,7 +403,7 @@ copy_cost (rtx x, enum machine_mode mode, reg_class_t rclass, bool to_p,
static void static void
record_reg_classes (int n_alts, int n_ops, rtx *ops, record_reg_classes (int n_alts, int n_ops, rtx *ops,
enum machine_mode *modes, const char **constraints, enum machine_mode *modes, const char **constraints,
rtx insn, enum reg_class *pref) rtx_insn *insn, enum reg_class *pref)
{ {
int alt; int alt;
int i, j, k; int i, j, k;
...@@ -1168,7 +1168,7 @@ record_address_regs (enum machine_mode mode, addr_space_t as, rtx x, ...@@ -1168,7 +1168,7 @@ record_address_regs (enum machine_mode mode, addr_space_t as, rtx x,
/* Calculate the costs of insn operands. */ /* Calculate the costs of insn operands. */
static void static void
record_operand_costs (rtx insn, enum reg_class *pref) record_operand_costs (rtx_insn *insn, enum reg_class *pref)
{ {
const char *constraints[MAX_RECOG_OPERANDS]; const char *constraints[MAX_RECOG_OPERANDS];
enum machine_mode modes[MAX_RECOG_OPERANDS]; enum machine_mode modes[MAX_RECOG_OPERANDS];
...@@ -1312,8 +1312,8 @@ record_operand_costs (rtx insn, enum reg_class *pref) ...@@ -1312,8 +1312,8 @@ record_operand_costs (rtx insn, enum reg_class *pref)
/* Process one insn INSN. Scan it and record each time it would save /* Process one insn INSN. Scan it and record each time it would save
code to put a certain allocnos in a certain class. Return the last code to put a certain allocnos in a certain class. Return the last
insn processed, so that the scan can be continued from there. */ insn processed, so that the scan can be continued from there. */
static rtx static rtx_insn *
scan_one_insn (rtx insn) scan_one_insn (rtx_insn *insn)
{ {
enum rtx_code pat_code; enum rtx_code pat_code;
rtx set, note; rtx set, note;
...@@ -1496,7 +1496,7 @@ print_pseudo_costs (FILE *f) ...@@ -1496,7 +1496,7 @@ print_pseudo_costs (FILE *f)
static void static void
process_bb_for_costs (basic_block bb) process_bb_for_costs (basic_block bb)
{ {
rtx insn; rtx_insn *insn;
frequency = REG_FREQ_FROM_BB (bb); frequency = REG_FREQ_FROM_BB (bb);
if (frequency == 0) if (frequency == 0)
...@@ -1903,7 +1903,8 @@ process_bb_node_for_hard_reg_moves (ira_loop_tree_node_t loop_tree_node) ...@@ -1903,7 +1903,8 @@ process_bb_node_for_hard_reg_moves (ira_loop_tree_node_t loop_tree_node)
ira_loop_tree_node_t curr_loop_tree_node; ira_loop_tree_node_t curr_loop_tree_node;
enum reg_class rclass; enum reg_class rclass;
basic_block bb; basic_block bb;
rtx insn, set, src, dst; rtx_insn *insn;
rtx set, src, dst;
bb = loop_tree_node->bb; bb = loop_tree_node->bb;
if (bb == NULL) if (bb == NULL)
......
...@@ -172,7 +172,7 @@ struct move ...@@ -172,7 +172,7 @@ struct move
dependencies. */ dependencies. */
move_t *deps; move_t *deps;
/* First insn generated for the move. */ /* First insn generated for the move. */
rtx insn; rtx_insn *insn;
}; };
/* Array of moves (indexed by BB index) which should be put at the /* Array of moves (indexed by BB index) which should be put at the
...@@ -196,7 +196,7 @@ create_move (ira_allocno_t to, ira_allocno_t from) ...@@ -196,7 +196,7 @@ create_move (ira_allocno_t to, ira_allocno_t from)
move->to = to; move->to = to;
move->from = from; move->from = from;
move->next = NULL; move->next = NULL;
move->insn = NULL_RTX; move->insn = NULL;
move->visited_p = false; move->visited_p = false;
return move; return move;
} }
...@@ -893,12 +893,13 @@ modify_move_list (move_t list) ...@@ -893,12 +893,13 @@ modify_move_list (move_t list)
/* Generate RTX move insns from the move list LIST. This updates /* Generate RTX move insns from the move list LIST. This updates
allocation cost using move execution frequency FREQ. */ allocation cost using move execution frequency FREQ. */
static rtx static rtx_insn *
emit_move_list (move_t list, int freq) emit_move_list (move_t list, int freq)
{ {
rtx to, from, dest; rtx to, from, dest;
int to_regno, from_regno, cost, regno; int to_regno, from_regno, cost, regno;
rtx result, insn, set; rtx_insn *result, *insn;
rtx set;
enum machine_mode mode; enum machine_mode mode;
enum reg_class aclass; enum reg_class aclass;
...@@ -984,7 +985,7 @@ emit_moves (void) ...@@ -984,7 +985,7 @@ emit_moves (void)
basic_block bb; basic_block bb;
edge_iterator ei; edge_iterator ei;
edge e; edge e;
rtx insns, tmp; rtx_insn *insns, *tmp;
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
...@@ -1234,7 +1235,7 @@ void ...@@ -1234,7 +1235,7 @@ void
ira_emit (bool loops_p) ira_emit (bool loops_p)
{ {
basic_block bb; basic_block bb;
rtx insn; rtx_insn *insn;
edge_iterator ei; edge_iterator ei;
edge e; edge e;
ira_allocno_t a; ira_allocno_t a;
......
...@@ -571,7 +571,7 @@ struct ira_allocno_copy ...@@ -571,7 +571,7 @@ struct ira_allocno_copy
for the copy created to remove register shuffle is NULL. In last for the copy created to remove register shuffle is NULL. In last
case the copy frequency is smaller than the corresponding insn case the copy frequency is smaller than the corresponding insn
execution frequency. */ execution frequency. */
rtx insn; rtx_insn *insn;
/* All copies with the same allocno as FIRST are linked by the two /* All copies with the same allocno as FIRST are linked by the two
following members. */ following members. */
ira_copy_t prev_first_allocno_copy, next_first_allocno_copy; ira_copy_t prev_first_allocno_copy, next_first_allocno_copy;
...@@ -1009,9 +1009,11 @@ extern void ira_add_allocno_pref (ira_allocno_t, int, int); ...@@ -1009,9 +1009,11 @@ extern void ira_add_allocno_pref (ira_allocno_t, int, int);
extern void ira_remove_pref (ira_pref_t); extern void ira_remove_pref (ira_pref_t);
extern void ira_remove_allocno_prefs (ira_allocno_t); extern void ira_remove_allocno_prefs (ira_allocno_t);
extern ira_copy_t ira_create_copy (ira_allocno_t, ira_allocno_t, extern ira_copy_t ira_create_copy (ira_allocno_t, ira_allocno_t,
int, bool, rtx, ira_loop_tree_node_t); int, bool, rtx_insn *,
ira_loop_tree_node_t);
extern ira_copy_t ira_add_allocno_copy (ira_allocno_t, ira_allocno_t, int, extern ira_copy_t ira_add_allocno_copy (ira_allocno_t, ira_allocno_t, int,
bool, rtx, ira_loop_tree_node_t); bool, rtx_insn *,
ira_loop_tree_node_t);
extern int *ira_allocate_cost_vector (reg_class_t); extern int *ira_allocate_cost_vector (reg_class_t);
extern void ira_free_cost_vector (int *, reg_class_t); extern void ira_free_cost_vector (int *, reg_class_t);
......
...@@ -723,7 +723,7 @@ make_early_clobber_and_input_conflicts (void) ...@@ -723,7 +723,7 @@ make_early_clobber_and_input_conflicts (void)
/* Mark early clobber hard registers of the current INSN as live (if /* Mark early clobber hard registers of the current INSN as live (if
LIVE_P) or dead. Return true if there are such registers. */ LIVE_P) or dead. Return true if there are such registers. */
static bool static bool
mark_hard_reg_early_clobbers (rtx insn, bool live_p) mark_hard_reg_early_clobbers (rtx_insn *insn, bool live_p)
{ {
df_ref def; df_ref def;
bool set_p = false; bool set_p = false;
...@@ -985,7 +985,7 @@ bb_has_abnormal_call_pred (basic_block bb) ...@@ -985,7 +985,7 @@ bb_has_abnormal_call_pred (basic_block bb)
we find a SET rtx that we can use to deduce that a register can be cheaply we find a SET rtx that we can use to deduce that a register can be cheaply
caller-saved. Return such a register, or NULL_RTX if none is found. */ caller-saved. Return such a register, or NULL_RTX if none is found. */
static rtx static rtx
find_call_crossed_cheap_reg (rtx insn) find_call_crossed_cheap_reg (rtx_insn *insn)
{ {
rtx cheap_reg = NULL_RTX; rtx cheap_reg = NULL_RTX;
rtx exp = CALL_INSN_FUNCTION_USAGE (insn); rtx exp = CALL_INSN_FUNCTION_USAGE (insn);
...@@ -1052,7 +1052,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) ...@@ -1052,7 +1052,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
int i, freq; int i, freq;
unsigned int j; unsigned int j;
basic_block bb; basic_block bb;
rtx insn; rtx_insn *insn;
bitmap_iterator bi; bitmap_iterator bi;
bitmap reg_live_out; bitmap reg_live_out;
unsigned int px; unsigned int px;
......
...@@ -2014,7 +2014,8 @@ static void ...@@ -2014,7 +2014,8 @@ static void
decrease_live_ranges_number (void) decrease_live_ranges_number (void)
{ {
basic_block bb; basic_block bb;
rtx insn, set, src, dest, dest_death, p, q, note; rtx_insn *insn;
rtx set, src, dest, dest_death, p, q, note;
int sregno, dregno; int sregno, dregno;
if (! flag_expensive_optimizations) if (! flag_expensive_optimizations)
...@@ -2229,7 +2230,7 @@ compute_regs_asm_clobbered (void) ...@@ -2229,7 +2230,7 @@ compute_regs_asm_clobbered (void)
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
rtx insn; rtx_insn *insn;
FOR_BB_INSNS_REVERSE (bb, insn) FOR_BB_INSNS_REVERSE (bb, insn)
{ {
df_ref def; df_ref def;
...@@ -3998,7 +3999,7 @@ build_insn_chain (void) ...@@ -3998,7 +3999,7 @@ build_insn_chain (void)
FOR_EACH_BB_REVERSE_FN (bb, cfun) FOR_EACH_BB_REVERSE_FN (bb, cfun)
{ {
bitmap_iterator bi; bitmap_iterator bi;
rtx insn; rtx_insn *insn;
CLEAR_REG_SET (live_relevant_regs); CLEAR_REG_SET (live_relevant_regs);
bitmap_clear (live_subregs_used); bitmap_clear (live_subregs_used);
...@@ -4370,7 +4371,7 @@ find_moveable_pseudos (void) ...@@ -4370,7 +4371,7 @@ find_moveable_pseudos (void)
int max_uid = get_max_uid (); int max_uid = get_max_uid ();
basic_block bb; basic_block bb;
int *uid_luid = XNEWVEC (int, max_uid); int *uid_luid = XNEWVEC (int, max_uid);
rtx *closest_uses = XNEWVEC (rtx, max_regs); rtx_insn **closest_uses = XNEWVEC (rtx_insn *, max_regs);
/* A set of registers which are live but not modified throughout a block. */ /* A set of registers which are live but not modified throughout a block. */
bitmap_head *bb_transp_live = XNEWVEC (bitmap_head, bitmap_head *bb_transp_live = XNEWVEC (bitmap_head,
last_basic_block_for_fn (cfun)); last_basic_block_for_fn (cfun));
...@@ -4399,7 +4400,7 @@ find_moveable_pseudos (void) ...@@ -4399,7 +4400,7 @@ find_moveable_pseudos (void)
bitmap_initialize (&unusable_as_input, 0); bitmap_initialize (&unusable_as_input, 0);
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
rtx insn; rtx_insn *insn;
bitmap transp = bb_transp_live + bb->index; bitmap transp = bb_transp_live + bb->index;
bitmap moveable = bb_moveable_reg_sets + bb->index; bitmap moveable = bb_moveable_reg_sets + bb->index;
bitmap local = bb_local + bb->index; bitmap local = bb_local + bb->index;
...@@ -4462,13 +4463,14 @@ find_moveable_pseudos (void) ...@@ -4462,13 +4463,14 @@ find_moveable_pseudos (void)
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
bitmap local = bb_local + bb->index; bitmap local = bb_local + bb->index;
rtx insn; rtx_insn *insn;
FOR_BB_INSNS (bb, insn) FOR_BB_INSNS (bb, insn)
if (NONDEBUG_INSN_P (insn)) if (NONDEBUG_INSN_P (insn))
{ {
df_insn_info *insn_info = DF_INSN_INFO_GET (insn); df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
rtx def_insn, closest_use, note; rtx_insn *def_insn;
rtx closest_use, note;
df_ref def, use; df_ref def, use;
unsigned regno; unsigned regno;
bool all_dominated, all_local; bool all_dominated, all_local;
...@@ -4510,7 +4512,7 @@ find_moveable_pseudos (void) ...@@ -4510,7 +4512,7 @@ find_moveable_pseudos (void)
closest_use = NULL_RTX; closest_use = NULL_RTX;
for (; use; use = DF_REF_NEXT_REG (use)) for (; use; use = DF_REF_NEXT_REG (use))
{ {
rtx insn; rtx_insn *insn;
if (!DF_REF_INSN_INFO (use)) if (!DF_REF_INSN_INFO (use))
{ {
all_dominated = false; all_dominated = false;
...@@ -4562,7 +4564,9 @@ find_moveable_pseudos (void) ...@@ -4562,7 +4564,9 @@ find_moveable_pseudos (void)
} }
#endif #endif
bitmap_set_bit (&interesting, regno); bitmap_set_bit (&interesting, regno);
closest_uses[regno] = closest_use; /* If we get here, we know closest_use is a non-NULL insn
(as opposed to const_0_rtx). */
closest_uses[regno] = as_a <rtx_insn *> (closest_use);
if (dump_file && (all_local || all_dominated)) if (dump_file && (all_local || all_dominated))
{ {
...@@ -4581,13 +4585,13 @@ find_moveable_pseudos (void) ...@@ -4581,13 +4585,13 @@ find_moveable_pseudos (void)
EXECUTE_IF_SET_IN_BITMAP (&interesting, 0, i, bi) EXECUTE_IF_SET_IN_BITMAP (&interesting, 0, i, bi)
{ {
df_ref def = DF_REG_DEF_CHAIN (i); df_ref def = DF_REG_DEF_CHAIN (i);
rtx def_insn = DF_REF_INSN (def); rtx_insn *def_insn = DF_REF_INSN (def);
basic_block def_block = BLOCK_FOR_INSN (def_insn); basic_block def_block = BLOCK_FOR_INSN (def_insn);
bitmap def_bb_local = bb_local + def_block->index; bitmap def_bb_local = bb_local + def_block->index;
bitmap def_bb_moveable = bb_moveable_reg_sets + def_block->index; bitmap def_bb_moveable = bb_moveable_reg_sets + def_block->index;
bitmap def_bb_transp = bb_transp_live + def_block->index; bitmap def_bb_transp = bb_transp_live + def_block->index;
bool local_to_bb_p = bitmap_bit_p (def_bb_local, i); bool local_to_bb_p = bitmap_bit_p (def_bb_local, i);
rtx use_insn = closest_uses[i]; rtx_insn *use_insn = closest_uses[i];
df_ref use; df_ref use;
bool all_ok = true; bool all_ok = true;
bool all_transp = true; bool all_transp = true;
...@@ -4640,7 +4644,7 @@ find_moveable_pseudos (void) ...@@ -4640,7 +4644,7 @@ find_moveable_pseudos (void)
{ {
if (modified_between_p (DF_REF_REG (use), def_insn, use_insn)) if (modified_between_p (DF_REF_REG (use), def_insn, use_insn))
{ {
rtx x = NEXT_INSN (def_insn); rtx_insn *x = NEXT_INSN (def_insn);
while (!modified_in_p (DF_REF_REG (use), x)) while (!modified_in_p (DF_REF_REG (use), x))
{ {
gcc_assert (x != use_insn); gcc_assert (x != use_insn);
...@@ -4733,7 +4737,7 @@ interesting_dest_for_shprep_1 (rtx set, basic_block call_dom) ...@@ -4733,7 +4737,7 @@ interesting_dest_for_shprep_1 (rtx set, basic_block call_dom)
Otherwise return NULL. */ Otherwise return NULL. */
static rtx static rtx
interesting_dest_for_shprep (rtx insn, basic_block call_dom) interesting_dest_for_shprep (rtx_insn *insn, basic_block call_dom)
{ {
if (!INSN_P (insn)) if (!INSN_P (insn))
return NULL; return NULL;
...@@ -4771,7 +4775,7 @@ split_live_ranges_for_shrink_wrap (void) ...@@ -4771,7 +4775,7 @@ split_live_ranges_for_shrink_wrap (void)
{ {
basic_block bb, call_dom = NULL; basic_block bb, call_dom = NULL;
basic_block first = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)); basic_block first = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun));
rtx insn, last_interesting_insn = NULL; rtx_insn *insn, *last_interesting_insn = NULL;
bitmap_head need_new, reachable; bitmap_head need_new, reachable;
vec<basic_block> queue; vec<basic_block> queue;
...@@ -4888,7 +4892,7 @@ split_live_ranges_for_shrink_wrap (void) ...@@ -4888,7 +4892,7 @@ split_live_ranges_for_shrink_wrap (void)
df_ref use, next; df_ref use, next;
for (use = DF_REG_USE_CHAIN (REGNO (dest)); use; use = next) for (use = DF_REG_USE_CHAIN (REGNO (dest)); use; use = next)
{ {
rtx uin = DF_REF_INSN (use); rtx_insn *uin = DF_REF_INSN (use);
next = DF_REF_NEXT_REG (use); next = DF_REF_NEXT_REG (use);
basic_block ubb = BLOCK_FOR_INSN (uin); basic_block ubb = BLOCK_FOR_INSN (uin);
...@@ -4934,12 +4938,12 @@ move_unallocated_pseudos (void) ...@@ -4934,12 +4938,12 @@ move_unallocated_pseudos (void)
{ {
int idx = i - first_moveable_pseudo; int idx = i - first_moveable_pseudo;
rtx other_reg = pseudo_replaced_reg[idx]; rtx other_reg = pseudo_replaced_reg[idx];
rtx def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (i)); rtx_insn *def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (i));
/* The use must follow all definitions of OTHER_REG, so we can /* The use must follow all definitions of OTHER_REG, so we can
insert the new definition immediately after any of them. */ insert the new definition immediately after any of them. */
df_ref other_def = DF_REG_DEF_CHAIN (REGNO (other_reg)); df_ref other_def = DF_REG_DEF_CHAIN (REGNO (other_reg));
rtx move_insn = DF_REF_INSN (other_def); rtx_insn *move_insn = DF_REF_INSN (other_def);
rtx newinsn = emit_insn_after (PATTERN (def_insn), move_insn); rtx_insn *newinsn = emit_insn_after (PATTERN (def_insn), move_insn);
rtx set; rtx set;
int success; int success;
......
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