Commit 8b634749 by Michael Hayes Committed by Michael Hayes

loop.h (REG_IV_CLASS): New accessor macro.

	* loop.h (REG_IV_CLASS): New accessor macro.
	* loop.c (REG_IV_CLASS): Use it instead of reg_iv_class array.
	* unroll.c (REG_IV_CLASS): Likewise.

From-SVN: r38580
parent b4ae5201
2001-01-01 Michael Hayes <mhayes@redhat.com>
* loop.h (REG_IV_CLASS): New accessor macro.
* loop.c (REG_IV_CLASS): Use it instead of reg_iv_class array.
* unroll.c (REG_IV_CLASS): Likewise.
Sun Dec 31 19:20:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Sun Dec 31 19:20:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* dwarf2out.c (loc_descriptor_from_tree, case WITH_RECORD_EXPR): New. * dwarf2out.c (loc_descriptor_from_tree, case WITH_RECORD_EXPR): New.
...@@ -33,7 +39,6 @@ Sun Dec 31 19:20:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -33,7 +39,6 @@ Sun Dec 31 19:20:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(loop_movables_add, loop_movables_free): New functions. (loop_movables_add, loop_movables_free): New functions.
(scan_loop): Use xmalloc instead of alloca for movables. (scan_loop): Use xmalloc instead of alloca for movables.
Call loop_movables_free. Call loop_movables_free.
* loop.c (debug_loops): New. * loop.c (debug_loops): New.
......
...@@ -3741,7 +3741,7 @@ loop_bivs_init_find (loop) ...@@ -3741,7 +3741,7 @@ loop_bivs_init_find (loop)
&& (test = get_condition_for_loop (loop, p)) != 0 && (test = get_condition_for_loop (loop, p)) != 0
&& GET_CODE (XEXP (test, 0)) == REG && GET_CODE (XEXP (test, 0)) == REG
&& REGNO (XEXP (test, 0)) < max_reg_before_loop && REGNO (XEXP (test, 0)) < max_reg_before_loop
&& (bl = ivs->reg_biv_class[REGNO (XEXP (test, 0))]) != 0 && (bl = REG_IV_CLASS (ivs, REGNO (XEXP (test, 0)))) != 0
&& valid_initial_value_p (XEXP (test, 1), p, call_seen, loop->start) && valid_initial_value_p (XEXP (test, 1), p, call_seen, loop->start)
&& bl->init_insn == 0) && bl->init_insn == 0)
{ {
...@@ -4915,7 +4915,7 @@ record_biv (loop, v, insn, dest_reg, inc_val, mult_val, location, ...@@ -4915,7 +4915,7 @@ record_biv (loop, v, insn, dest_reg, inc_val, mult_val, location,
/* Add this to the reg's iv_class, creating a class /* Add this to the reg's iv_class, creating a class
if this is the first incrementation of the reg. */ if this is the first incrementation of the reg. */
bl = ivs->reg_biv_class[REGNO (dest_reg)]; bl = REG_IV_CLASS (ivs, REGNO (dest_reg));
if (bl == 0) if (bl == 0)
{ {
/* Create and initialize new iv_class. */ /* Create and initialize new iv_class. */
...@@ -4946,7 +4946,7 @@ record_biv (loop, v, insn, dest_reg, inc_val, mult_val, location, ...@@ -4946,7 +4946,7 @@ record_biv (loop, v, insn, dest_reg, inc_val, mult_val, location,
ivs->loop_iv_list = bl; ivs->loop_iv_list = bl;
/* Put it in the array of biv register classes. */ /* Put it in the array of biv register classes. */
ivs->reg_biv_class[REGNO (dest_reg)] = bl; REG_IV_CLASS (ivs, REGNO (dest_reg)) = bl;
} }
/* Update IV_CLASS entry for this biv. */ /* Update IV_CLASS entry for this biv. */
...@@ -5075,7 +5075,7 @@ record_giv (loop, v, insn, src_reg, dest_reg, mult_val, add_val, ext_val, ...@@ -5075,7 +5075,7 @@ record_giv (loop, v, insn, src_reg, dest_reg, mult_val, add_val, ext_val,
/* Add the giv to the class of givs computed from one biv. */ /* Add the giv to the class of givs computed from one biv. */
bl = ivs->reg_biv_class[REGNO (src_reg)]; bl = REG_IV_CLASS (ivs, REGNO (src_reg));
if (bl) if (bl)
{ {
v->next_iv = bl->giv; v->next_iv = bl->giv;
...@@ -5267,7 +5267,7 @@ check_final_value (loop, v) ...@@ -5267,7 +5267,7 @@ check_final_value (loop, v)
struct iv_class *bl; struct iv_class *bl;
rtx final_value = 0; rtx final_value = 0;
bl = ivs->reg_biv_class[REGNO (v->src_reg)]; bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
/* DEST_ADDR givs will never reach here, because they are always marked /* DEST_ADDR givs will never reach here, because they are always marked
replaceable above in record_giv. */ replaceable above in record_giv. */
...@@ -8225,7 +8225,8 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where) ...@@ -8225,7 +8225,8 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
if (v->ignore || v->maybe_dead || v->mode != mode) if (v->ignore || v->maybe_dead || v->mode != mode)
continue; continue;
for (tv = ivs->reg_biv_class[REGNO (arg)]->giv; tv; tv = tv->next_iv) for (tv = REG_IV_CLASS (ivs, REGNO (arg))->giv; tv;
tv = tv->next_iv)
if (! tv->ignore && ! tv->maybe_dead if (! tv->ignore && ! tv->maybe_dead
&& rtx_equal_p (tv->mult_val, v->mult_val) && rtx_equal_p (tv->mult_val, v->mult_val)
&& rtx_equal_p (tv->add_val, v->add_val) && rtx_equal_p (tv->add_val, v->add_val)
...@@ -8323,7 +8324,7 @@ record_initial (dest, set, data) ...@@ -8323,7 +8324,7 @@ record_initial (dest, set, data)
|| REG_IV_TYPE (ivs, REGNO (dest)) != BASIC_INDUCT) || REG_IV_TYPE (ivs, REGNO (dest)) != BASIC_INDUCT)
return; return;
bl = ivs->reg_biv_class[REGNO (dest)]; bl = REG_IV_CLASS (ivs, REGNO (dest));
/* If this is the first set found, record it. */ /* If this is the first set found, record it. */
if (bl->init_insn == 0) if (bl->init_insn == 0)
......
...@@ -363,6 +363,7 @@ extern FILE *loop_dump_stream; ...@@ -363,6 +363,7 @@ extern FILE *loop_dump_stream;
(*(enum iv_mode *) &VARRAY_INT(ivs->reg_iv_type, (n))) (*(enum iv_mode *) &VARRAY_INT(ivs->reg_iv_type, (n)))
#define REG_IV_INFO(ivs, n) \ #define REG_IV_INFO(ivs, n) \
(*(struct induction **) &VARRAY_GENERIC_PTR(ivs->reg_iv_info, (n))) (*(struct induction **) &VARRAY_GENERIC_PTR(ivs->reg_iv_info, (n)))
#define REG_IV_CLASS(ivs, n) ivs->reg_biv_class[n]
/* Forward declarations for non-static functions declared in loop.c and /* Forward declarations for non-static functions declared in loop.c and
unroll.c. */ unroll.c. */
......
...@@ -1770,7 +1770,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration, ...@@ -1770,7 +1770,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
unsigned int regno = REGNO (SET_DEST (set)); unsigned int regno = REGNO (SET_DEST (set));
v = addr_combined_regs[REGNO (SET_DEST (set))]; v = addr_combined_regs[REGNO (SET_DEST (set))];
bl = ivs->reg_biv_class[REGNO (v->src_reg)]; bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
/* Although the giv_inc amount is not needed here, we must call /* Although the giv_inc amount is not needed here, we must call
calculate_giv_inc here since it might try to delete the calculate_giv_inc here since it might try to delete the
...@@ -1915,7 +1915,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration, ...@@ -1915,7 +1915,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
if (regno < max_reg_before_loop if (regno < max_reg_before_loop
&& REG_IV_TYPE (ivs, regno) == BASIC_INDUCT) && REG_IV_TYPE (ivs, regno) == BASIC_INDUCT)
{ {
giv_src_reg = ivs->reg_biv_class[regno]->biv->src_reg; giv_src_reg = REG_IV_CLASS (ivs, regno)->biv->src_reg;
giv_dest_reg = giv_src_reg; giv_dest_reg = giv_src_reg;
} }
...@@ -3030,7 +3030,7 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number) ...@@ -3030,7 +3030,7 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
{ {
int count = 1; int count = 1;
if (! v->ignore) if (! v->ignore)
count = ivs->reg_biv_class[REGNO (v->src_reg)]->biv_count; count = REG_IV_CLASS (ivs, REGNO (v->src_reg))->biv_count;
splittable_regs_updates[REGNO (v->new_reg)] = count; splittable_regs_updates[REGNO (v->new_reg)] = count;
} }
...@@ -3226,7 +3226,7 @@ final_giv_value (loop, v) ...@@ -3226,7 +3226,7 @@ final_giv_value (loop, v)
rtx loop_end = loop->end; rtx loop_end = loop->end;
unsigned HOST_WIDE_INT n_iterations = LOOP_INFO (loop)->n_iterations; unsigned HOST_WIDE_INT n_iterations = LOOP_INFO (loop)->n_iterations;
bl = ivs->reg_biv_class[REGNO (v->src_reg)]; bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
/* The final value for givs which depend on reversed bivs must be calculated /* The final value for givs which depend on reversed bivs must be calculated
differently than for ordinary givs. In this case, there is already an differently than for ordinary givs. In this case, there is already an
...@@ -3598,7 +3598,7 @@ loop_iterations (loop) ...@@ -3598,7 +3598,7 @@ loop_iterations (loop)
abort (); abort ();
/* Grab initial value, only useful if it is a constant. */ /* Grab initial value, only useful if it is a constant. */
bl = ivs->reg_biv_class[REGNO (iteration_var)]; bl = REG_IV_CLASS (ivs, REGNO (iteration_var));
initial_value = bl->initial_value; initial_value = bl->initial_value;
increment = biv_total_increment (bl); increment = biv_total_increment (bl);
...@@ -3612,7 +3612,7 @@ loop_iterations (loop) ...@@ -3612,7 +3612,7 @@ loop_iterations (loop)
if (REGNO (v->src_reg) >= max_reg_before_loop) if (REGNO (v->src_reg) >= max_reg_before_loop)
abort (); abort ();
bl = ivs->reg_biv_class[REGNO (v->src_reg)]; bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
/* Increment value is mult_val times the increment value of the biv. */ /* Increment value is mult_val times the increment value of the biv. */
...@@ -4014,7 +4014,7 @@ remap_split_bivs (loop, x) ...@@ -4014,7 +4014,7 @@ remap_split_bivs (loop, x)
#endif #endif
if (REGNO (x) < max_reg_before_loop if (REGNO (x) < max_reg_before_loop
&& REG_IV_TYPE (ivs, REGNO (x)) == BASIC_INDUCT) && REG_IV_TYPE (ivs, REGNO (x)) == BASIC_INDUCT)
return ivs->reg_biv_class[REGNO (x)]->biv->src_reg; return REG_IV_CLASS (ivs, REGNO (x))->biv->src_reg;
break; break;
default: default:
......
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