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
This commit is contained in:
Michael Hayes 2001-01-01 00:37:09 +00:00 committed by Michael Hayes
parent b4ae520152
commit 8b634749ab
4 changed files with 22 additions and 15 deletions

View File

@ -1,3 +1,9 @@
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>
* 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>
(loop_movables_add, loop_movables_free): New functions.
(scan_loop): Use xmalloc instead of alloca for movables.
Call loop_movables_free.
* loop.c (debug_loops): New.

View File

@ -3741,7 +3741,7 @@ loop_bivs_init_find (loop)
&& (test = get_condition_for_loop (loop, p)) != 0
&& GET_CODE (XEXP (test, 0)) == REG
&& 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)
&& bl->init_insn == 0)
{
@ -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
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)
{
/* Create and initialize new iv_class. */
@ -4946,7 +4946,7 @@ record_biv (loop, v, insn, dest_reg, inc_val, mult_val, location,
ivs->loop_iv_list = bl;
/* 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. */
@ -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. */
bl = ivs->reg_biv_class[REGNO (src_reg)];
bl = REG_IV_CLASS (ivs, REGNO (src_reg));
if (bl)
{
v->next_iv = bl->giv;
@ -5267,7 +5267,7 @@ check_final_value (loop, v)
struct iv_class *bl;
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
replaceable above in record_giv. */
@ -8225,7 +8225,8 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where)
if (v->ignore || v->maybe_dead || v->mode != mode)
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
&& rtx_equal_p (tv->mult_val, v->mult_val)
&& rtx_equal_p (tv->add_val, v->add_val)
@ -8323,7 +8324,7 @@ record_initial (dest, set, data)
|| REG_IV_TYPE (ivs, REGNO (dest)) != BASIC_INDUCT)
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 (bl->init_insn == 0)

View File

@ -363,6 +363,7 @@ extern FILE *loop_dump_stream;
(*(enum iv_mode *) &VARRAY_INT(ivs->reg_iv_type, (n)))
#define REG_IV_INFO(ivs, 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
unroll.c. */

View File

@ -1770,7 +1770,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
unsigned int regno = 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
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,
if (regno < max_reg_before_loop
&& 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;
}
@ -3030,7 +3030,7 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
{
int count = 1;
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;
}
@ -3226,7 +3226,7 @@ final_giv_value (loop, v)
rtx loop_end = loop->end;
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
differently than for ordinary givs. In this case, there is already an
@ -3598,7 +3598,7 @@ loop_iterations (loop)
abort ();
/* 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;
increment = biv_total_increment (bl);
@ -3612,7 +3612,7 @@ loop_iterations (loop)
if (REGNO (v->src_reg) >= max_reg_before_loop)
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. */
@ -4014,7 +4014,7 @@ remap_split_bivs (loop, x)
#endif
if (REGNO (x) < max_reg_before_loop
&& 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;
default: