#include "except.h"
#include "toplev.h"
+
/* Vector mapping INSN_UIDs to luids.
The luids are like uids but increase monotonically always.
We use them to see whether a jump comes from outside a given loop. */
or consec_sets_invariant_p returned 2
(only conditionally invariant). */
m->cond = ((tem | tem1 | tem2) > 1);
- m->global = (uid_luid[REGNO_LAST_UID (regno)]
+ m->global = (REGNO_LAST_LUID (regno)
> INSN_LUID (loop_end)
- || uid_luid[REGNO_FIRST_UID (regno)] < INSN_LUID (loop_start));
+ || REGNO_FIRST_LUID (regno) < INSN_LUID (loop_start));
m->match = 0;
- m->lifetime = (uid_luid[REGNO_LAST_UID (regno)]
- - uid_luid[REGNO_FIRST_UID (regno)]);
+ m->lifetime = (REGNO_LAST_LUID (regno)
+ - REGNO_FIRST_LUID (regno));
m->savings = VARRAY_INT (regs->n_times_set, regno);
if (find_reg_note (p, REG_RETVAL, NULL_RTX))
m->savings += libcall_benefit (p);
INSN_LUID and hence must make a conservative
assumption. */
m->global = (INSN_UID (p) >= max_uid_for_loop
- || (uid_luid[REGNO_LAST_UID (regno)]
+ || (REGNO_LAST_LUID (regno)
> INSN_LUID (loop_end))
- || (uid_luid[REGNO_FIRST_UID (regno)]
+ || (REGNO_FIRST_LUID (regno)
< INSN_LUID (p))
|| (labels_in_range_p
- (p, uid_luid[REGNO_FIRST_UID (regno)])));
+ (p, REGNO_FIRST_LUID (regno))));
if (maybe_never && m->global)
m->savemode = GET_MODE (SET_SRC (set1));
else
m->regno = regno;
m->cond = 0;
m->match = 0;
- m->lifetime = (uid_luid[REGNO_LAST_UID (regno)]
- - uid_luid[REGNO_FIRST_UID (regno)]);
+ m->lifetime = (REGNO_LAST_LUID (regno)
+ - REGNO_FIRST_LUID (regno));
m->savings = 1;
VARRAY_INT (regs->set_in_loop, regno) = -1;
/* Add M to the end of the chain MOVABLES. */
&& mode == GET_MODE (SET_SRC (PATTERN (NEXT_INSN (m->insn)))))
{
register struct movable *m1;
- int first = uid_luid[REGNO_FIRST_UID (m->regno)];
- int last = uid_luid[REGNO_LAST_UID (m->regno)];
+ int first = REGNO_FIRST_LUID (m->regno);
+ int last = REGNO_LAST_LUID (m->regno);
if (m0 == 0)
{
already combined together. */
for (m1 = movables->head; m1 != m; m1 = m1->next)
if (m1 == m0 || (m1->partial && m1->match == m0))
- if (! (uid_luid[REGNO_FIRST_UID (m1->regno)] > last
- || uid_luid[REGNO_LAST_UID (m1->regno)] < first))
+ if (! (REGNO_FIRST_LUID (m1->regno) > last
+ || REGNO_LAST_LUID (m1->regno) < first))
goto overlap;
/* No overlap: we can combine this with the others. */
to say it lives at least the full length of this loop.
This will help guide optimizations in outer loops. */
- if (uid_luid[REGNO_FIRST_UID (regno)] > INSN_LUID (loop_start))
+ if (REGNO_FIRST_LUID (regno) > INSN_LUID (loop_start))
/* This is the old insn before all the moved insns.
We can't use the moved insn because it is out of range
in uid_luid. Only the old insns have luids. */
REGNO_FIRST_UID (regno) = INSN_UID (loop_start);
- if (uid_luid[REGNO_LAST_UID (regno)] < INSN_LUID (loop_end))
+ if (REGNO_LAST_LUID (regno) < INSN_LUID (loop_end))
REGNO_LAST_UID (regno) = INSN_UID (loop_end);
/* Combine with this moved insn any other matching movables. */
long as init_insn doesn't use the biv itself.
March 14, 1989 -- self@bayes.arc.nasa.gov */
- if ((uid_luid[REGNO_LAST_UID (bl->regno)] < INSN_LUID (loop_end)
+ if ((REGNO_LAST_LUID (bl->regno) < INSN_LUID (loop_end)
&& bl->init_insn
&& INSN_UID (bl->init_insn) < max_uid_for_loop
- && uid_luid[REGNO_FIRST_UID (bl->regno)] >= INSN_LUID (bl->init_insn)
+ && REGNO_FIRST_LUID (bl->regno) >= INSN_LUID (bl->init_insn)
#ifdef HAVE_decrement_and_branch_until_zero
&& ! bl->nonneg
#endif
{
v->mode = GET_MODE (SET_DEST (set));
- v->lifetime = (uid_luid[REGNO_LAST_UID (REGNO (dest_reg))]
- - uid_luid[REGNO_FIRST_UID (REGNO (dest_reg))]);
+ v->lifetime = (REGNO_LAST_LUID (REGNO (dest_reg))
+ - REGNO_FIRST_LUID (REGNO (dest_reg)));
/* If the lifetime is zero, it means that this register is
really a dead store. So mark this as a giv that can be
if (REGNO_FIRST_UID (REGNO (dest_reg)) == INSN_UID (insn)
/* Previous line always fails if INSN was moved by loop opt. */
- && uid_luid[REGNO_LAST_UID (REGNO (dest_reg))]
+ && REGNO_LAST_LUID (REGNO (dest_reg))
< INSN_LUID (loop->end)
&& (! not_every_iteration
|| last_use_this_basic_block (dest_reg, insn)))
for (b = bl->biv; b; b = b->next_iv)
{
if (INSN_UID (b->insn) >= max_uid_for_loop
- || ((uid_luid[INSN_UID (b->insn)]
- >= uid_luid[REGNO_FIRST_UID (REGNO (dest_reg))])
- && (uid_luid[INSN_UID (b->insn)]
- <= uid_luid[REGNO_LAST_UID (REGNO (dest_reg))])))
+ || ((INSN_LUID (b->insn)
+ >= REGNO_FIRST_LUID (REGNO (dest_reg)))
+ && (INSN_LUID (b->insn)
+ <= REGNO_LAST_LUID (REGNO (dest_reg)))))
{
v->replaceable = 0;
v->not_replaceable = 1;
and hence this insn will never be the last use of x. */
if (GET_CODE (x) == REG && REGNO (x) < max_reg_before_loop
&& INSN_UID (insn) < max_uid_for_loop
- && uid_luid[REGNO_LAST_UID (REGNO (x))] < uid_luid[INSN_UID (insn)])
+ && REGNO_LAST_LUID (REGNO (x)) < INSN_LUID (insn))
REGNO_LAST_UID (REGNO (x)) = INSN_UID (insn);
else
{
these pseudo registers have valid regno_first_uid info. */
for (r = FIRST_PSEUDO_REGISTER; r < max_reg_before_loop; ++r)
if (REGNO_FIRST_UID (r) > 0 && REGNO_FIRST_UID (r) <= max_uid_for_loop
- && uid_luid[REGNO_FIRST_UID (r)] >= copy_start_luid
+ && REGNO_FIRST_LUID (r) >= copy_start_luid
&& REGNO_LAST_UID (r) > 0 && REGNO_LAST_UID (r) <= max_uid_for_loop
- && uid_luid[REGNO_LAST_UID (r)] <= copy_end_luid)
+ && REGNO_LAST_LUID (r) <= copy_end_luid)
{
/* However, we must also check for loop-carried dependencies.
If the value the pseudo has at the end of iteration X is
/* Fail if loop_info->iteration_var is not live before loop_start,
since we need to test its value in the preconditioning code. */
- if (uid_luid[REGNO_FIRST_UID (REGNO (loop_info->iteration_var))]
+ if (REGNO_FIRST_LUID (REGNO (loop_info->iteration_var))
> INSN_LUID (loop_start))
{
if (loop_dump_stream)
biv_final_value = 0;
if (unroll_type != UNROLL_COMPLETELY
&& (loop->exit_count || unroll_type == UNROLL_NAIVE)
- && (uid_luid[REGNO_LAST_UID (bl->regno)] >= INSN_LUID (loop_end)
+ && (REGNO_LAST_LUID (bl->regno) >= INSN_LUID (loop_end)
|| ! bl->init_insn
|| INSN_UID (bl->init_insn) >= max_uid_for_loop
- || (uid_luid[REGNO_FIRST_UID (bl->regno)]
+ || (REGNO_FIRST_LUID (bl->regno)
< INSN_LUID (bl->init_insn))
|| reg_mentioned_p (bl->biv->dest_reg, SET_SRC (bl->init_set)))
&& ! (biv_final_value = final_biv_value (loop, bl)))
|| (REGNO_FIRST_UID (REGNO (v->dest_reg))
!= INSN_UID (XEXP (tem, 0)))))
/* Line above always fails if INSN was moved by loop opt. */
- || (uid_luid[REGNO_LAST_UID (REGNO (v->dest_reg))]
+ || (REGNO_LAST_LUID (REGNO (v->dest_reg))
>= INSN_LUID (loop->end)))
&& ! (final_value = v->final_value))
continue;