Commit 89bfd6f5 by David Malcolm Committed by David Malcolm

loop-invariant.c: Use rtx_insn in various places

gcc/
	* loop-invariant.c (struct use): Strengthen field "insn" from rtx
	to rtx_insn *.
	(struct invariant): Likewise.
	(hash_invariant_expr_1): Likewise for param "insn".
	(invariant_expr_equal_p): Likewise for param "insn1", "insn2".
	(find_exits): Likewise for local "insn".
	(create_new_invariant): Likewise for param "insn".
	(check_dependencies): Likewise.
	(find_invariant_insn): Likewise.
	(record_uses): Likewise.
	(find_invariants_insn): Likewise.
	(find_invariants_bb): Likewise for local "insn".
	(get_pressure_class_and_nregs): Likewise for param "insn".
	(calculate_loop_reg_pressure): Likewise for local "insn".

From-SVN: r214343
parent 871eb193
2014-08-22 David Malcolm <dmalcolm@redhat.com> 2014-08-22 David Malcolm <dmalcolm@redhat.com>
* loop-invariant.c (struct use): Strengthen field "insn" from rtx
to rtx_insn *.
(struct invariant): Likewise.
(hash_invariant_expr_1): Likewise for param "insn".
(invariant_expr_equal_p): Likewise for param "insn1", "insn2".
(find_exits): Likewise for local "insn".
(create_new_invariant): Likewise for param "insn".
(check_dependencies): Likewise.
(find_invariant_insn): Likewise.
(record_uses): Likewise.
(find_invariants_insn): Likewise.
(find_invariants_bb): Likewise for local "insn".
(get_pressure_class_and_nregs): Likewise for param "insn".
(calculate_loop_reg_pressure): Likewise for local "insn".
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* loop-doloop.c (doloop_valid_p): Strengthen local "insn" from rtx * loop-doloop.c (doloop_valid_p): Strengthen local "insn" from rtx
to rtx_insn *. to rtx_insn *.
(add_test): Likewise for locals "seq", "jump". (add_test): Likewise for locals "seq", "jump".
......
...@@ -78,7 +78,7 @@ struct loop_data ...@@ -78,7 +78,7 @@ struct loop_data
struct use struct use
{ {
rtx *pos; /* Position of the use. */ rtx *pos; /* Position of the use. */
rtx insn; /* The insn in that the use occurs. */ rtx_insn *insn; /* The insn in that the use occurs. */
unsigned addr_use_p; /* Whether the use occurs in an address. */ unsigned addr_use_p; /* Whether the use occurs in an address. */
struct use *next; /* Next use in the list. */ struct use *next; /* Next use in the list. */
}; };
...@@ -119,7 +119,7 @@ struct invariant ...@@ -119,7 +119,7 @@ struct invariant
struct def *def; struct def *def;
/* The insn in that it is defined. */ /* The insn in that it is defined. */
rtx insn; rtx_insn *insn;
/* Whether it is always executed. */ /* Whether it is always executed. */
bool always_executed; bool always_executed;
...@@ -289,7 +289,7 @@ invariant_for_use (df_ref use) ...@@ -289,7 +289,7 @@ invariant_for_use (df_ref use)
/* Computes hash value for invariant expression X in INSN. */ /* Computes hash value for invariant expression X in INSN. */
static hashval_t static hashval_t
hash_invariant_expr_1 (rtx insn, rtx x) hash_invariant_expr_1 (rtx_insn *insn, rtx x)
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
int i, j; int i, j;
...@@ -343,7 +343,7 @@ hash_invariant_expr_1 (rtx insn, rtx x) ...@@ -343,7 +343,7 @@ hash_invariant_expr_1 (rtx insn, rtx x)
and INSN2 have always the same value. */ and INSN2 have always the same value. */
static bool static bool
invariant_expr_equal_p (rtx insn1, rtx e1, rtx insn2, rtx e2) invariant_expr_equal_p (rtx_insn *insn1, rtx e1, rtx_insn *insn2, rtx e2)
{ {
enum rtx_code code = GET_CODE (e1); enum rtx_code code = GET_CODE (e1);
int i, j; int i, j;
...@@ -578,7 +578,7 @@ find_exits (struct loop *loop, basic_block *body, ...@@ -578,7 +578,7 @@ find_exits (struct loop *loop, basic_block *body,
edge e; edge e;
struct loop *outermost_exit = loop, *aexit; struct loop *outermost_exit = loop, *aexit;
bool has_call = false; bool has_call = false;
rtx insn; rtx_insn *insn;
for (i = 0; i < loop->num_nodes; i++) for (i = 0; i < loop->num_nodes; i++)
{ {
...@@ -689,7 +689,7 @@ find_defs (struct loop *loop) ...@@ -689,7 +689,7 @@ find_defs (struct loop *loop)
is returned. */ is returned. */
static struct invariant * static struct invariant *
create_new_invariant (struct def *def, rtx insn, bitmap depends_on, create_new_invariant (struct def *def, rtx_insn *insn, bitmap depends_on,
bool always_executed) bool always_executed)
{ {
struct invariant *inv = XNEW (struct invariant); struct invariant *inv = XNEW (struct invariant);
...@@ -833,7 +833,7 @@ check_dependency (basic_block bb, df_ref use, bitmap depends_on) ...@@ -833,7 +833,7 @@ check_dependency (basic_block bb, df_ref use, bitmap depends_on)
loop invariants, false otherwise. */ loop invariants, false otherwise. */
static bool static bool
check_dependencies (rtx insn, bitmap depends_on) check_dependencies (rtx_insn *insn, bitmap depends_on)
{ {
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn); struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
df_ref use; df_ref use;
...@@ -887,7 +887,7 @@ pre_check_invariant_p (bool simple, rtx dest) ...@@ -887,7 +887,7 @@ pre_check_invariant_p (bool simple, rtx dest)
unless the program ends due to a function call. */ unless the program ends due to a function call. */
static void static void
find_invariant_insn (rtx insn, bool always_reached, bool always_executed) find_invariant_insn (rtx_insn *insn, bool always_reached, bool always_executed)
{ {
df_ref ref; df_ref ref;
struct def *def; struct def *def;
...@@ -950,7 +950,7 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed) ...@@ -950,7 +950,7 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed)
/* Record registers used in INSN that have a unique invariant definition. */ /* Record registers used in INSN that have a unique invariant definition. */
static void static void
record_uses (rtx insn) record_uses (rtx_insn *insn)
{ {
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn); struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
df_ref use; df_ref use;
...@@ -975,7 +975,7 @@ record_uses (rtx insn) ...@@ -975,7 +975,7 @@ record_uses (rtx insn)
unless the program ends due to a function call. */ unless the program ends due to a function call. */
static void static void
find_invariants_insn (rtx insn, bool always_reached, bool always_executed) find_invariants_insn (rtx_insn *insn, bool always_reached, bool always_executed)
{ {
find_invariant_insn (insn, always_reached, always_executed); find_invariant_insn (insn, always_reached, always_executed);
record_uses (insn); record_uses (insn);
...@@ -989,7 +989,7 @@ find_invariants_insn (rtx insn, bool always_reached, bool always_executed) ...@@ -989,7 +989,7 @@ find_invariants_insn (rtx insn, bool always_reached, bool always_executed)
static void static void
find_invariants_bb (basic_block bb, bool always_reached, bool always_executed) find_invariants_bb (basic_block bb, bool always_reached, bool always_executed)
{ {
rtx insn; rtx_insn *insn;
FOR_BB_INSNS (bb, insn) FOR_BB_INSNS (bb, insn)
{ {
...@@ -1066,7 +1066,7 @@ free_use_list (struct use *use) ...@@ -1066,7 +1066,7 @@ free_use_list (struct use *use)
/* Return pressure class and number of hard registers (through *NREGS) /* Return pressure class and number of hard registers (through *NREGS)
for destination of INSN. */ for destination of INSN. */
static enum reg_class static enum reg_class
get_pressure_class_and_nregs (rtx insn, int *nregs) get_pressure_class_and_nregs (rtx_insn *insn, int *nregs)
{ {
rtx reg; rtx reg;
enum reg_class pressure_class; enum reg_class pressure_class;
...@@ -1878,7 +1878,8 @@ calculate_loop_reg_pressure (void) ...@@ -1878,7 +1878,8 @@ calculate_loop_reg_pressure (void)
unsigned int j; unsigned int j;
bitmap_iterator bi; bitmap_iterator bi;
basic_block bb; basic_block bb;
rtx insn, link; rtx_insn *insn;
rtx link;
struct loop *loop, *parent; struct loop *loop, *parent;
FOR_EACH_LOOP (loop, 0) FOR_EACH_LOOP (loop, 0)
......
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