Kill recombine_givs.

From-SVN: r36536
This commit is contained in:
Bernd Schmidt 2000-09-19 09:01:13 -07:00 committed by Richard Henderson
parent 0f80560663
commit b4f75276d6
4 changed files with 43 additions and 1070 deletions

View File

@ -1,3 +1,27 @@
2000-09-19 Bernd Schmidt <bernds@redhat.co.uk>
Undo most of the Wed Jan 27 23:39:53 1999 patch:
* loop.h (struct induction): Delete members derived, ix and last_use.
(struct loop_ivs): Delete members first_increment_giv and
last_increment_giv.
* loop.c (verify_dominator, find_life_end, cmp_recombine_givs_stats,
recombine_givs): Delete functions.
(find_and_verify_loops): Don't initialize cont_dominator.
(strength_reduce): Lose code to try to find bivs that can be
expressed as givs of another biv, and to convert biv increments
into givs.
Lose loop_scan_start variable, always use loop->scan_start.
Don't call recombine_givs. Don't handle derived givs.
(record_giv): Don't initialize derived and last_use fields.
(biv_eliminiation_giv_has_0_offset): Lose code to handle derived
givs.
* unroll.c (derived_regs): Delete static variable.
(unroll_loop): Don't initialize it.
(copy_loop_body): Lose code to handle derived givs.
(find_splittable_givs): Don't check for givs made from biv
increments.
Don't set derived_regs.
2000-09-19 Bernd Schmidt <bernds@redhat.co.uk>
Fix misapplied earlier patch:
@ -76,7 +100,7 @@
Mon 18-Sep-2000 22:12:44 BST Neil Booth <NeilB@earthling.net>
* cpp.texi: Update documentation, including some clarifications,
* cpp.texi: Update documentation, including some clarifications,
the treatment of various newline combinations, and space between
backslash and newline.

File diff suppressed because it is too large Load Diff

View File

@ -133,14 +133,10 @@ struct induction
struct induction *same; /* If this giv has been combined with another
giv, this points to the base giv. The base
giv will have COMBINED_WITH non-zero. */
struct induction *derived_from;/* For a giv, if we decided to derive this
giv from another one. */
HOST_WIDE_INT const_adjust; /* Used by loop unrolling, when an address giv
is split, and a constant is eliminated from
the address, the -constant is stored here
for later use. */
int ix; /* Used by recombine_givs, as n index into
the stats array. */
struct induction *same_insn; /* If there are multiple identical givs in
the same insn, then all but one have this
field set, and they all point to the giv
@ -201,12 +197,6 @@ struct loop_ivs
/* The head of a list which links together (via the next field)
every iv class for the current loop. */
struct iv_class *loop_iv_list;
/* Givs made from biv increments are always splittable for loop
unrolling. Since there is no regscan info for them, we have to
keep track of them separately. */
unsigned int first_increment_giv;
unsigned int last_increment_giv;
};
struct loop_regs

View File

@ -189,10 +189,6 @@ static struct induction **addr_combined_regs;
static rtx *splittable_regs;
/* Indexed by register number, if this is a splittable induction variable,
this indicates if it was made from a derived giv. */
static char *derived_regs;
/* Indexed by register number, if this is a splittable induction variable,
then this will hold the number of instructions in the loop that modify
the induction variable. Used to ensure that only the last insn modifying
@ -806,7 +802,6 @@ unroll_loop (loop, insn_count, end_insert_before, strength_reduce_p)
to access the splittable_regs[] and addr_combined_regs[] arrays. */
splittable_regs = (rtx *) xcalloc (maxregnum, sizeof (rtx));
derived_regs = (char *) xcalloc (maxregnum, sizeof (char));
splittable_regs_updates = (int *) xcalloc (maxregnum, sizeof (int));
addr_combined_regs
= (struct induction **) xcalloc (maxregnum, sizeof (struct induction *));
@ -872,14 +867,6 @@ unroll_loop (loop, insn_count, end_insert_before, strength_reduce_p)
r);
}
}
/* Givs that have been created from multiple biv increments always have
local registers. */
for (r = ivs->first_increment_giv; r <= ivs->last_increment_giv; r++)
{
local_regno[r] = 1;
if (loop_dump_stream)
fprintf (loop_dump_stream, "Marked reg %d as local\n", r);
}
}
/* If this loop requires exit tests when unrolled, check to see if we
@ -1346,7 +1333,6 @@ unroll_loop (loop, insn_count, end_insert_before, strength_reduce_p)
}
free (map->insn_map);
free (splittable_regs);
free (derived_regs);
free (splittable_regs_updates);
free (addr_combined_regs);
free (local_regno);
@ -1792,8 +1778,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
we might accidentally delete insns generated immediately
below by emit_unrolled_add. */
if (! derived_regs[regno])
giv_inc = calculate_giv_inc (set, insn, regno);
giv_inc = calculate_giv_inc (set, insn, regno);
/* Now find all address giv's that were combined with this
giv 'v'. */
@ -1880,23 +1865,12 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
dest_reg_was_split = 1;
giv_dest_reg = SET_DEST (set);
if (derived_regs[regno])
{
/* ??? This relies on SET_SRC (SET) to be of
the form (plus (reg) (const_int)), and thus
forces recombine_givs to restrict the kind
of giv derivations it does before unrolling. */
giv_src_reg = XEXP (SET_SRC (set), 0);
giv_inc = XEXP (SET_SRC (set), 1);
}
else
{
giv_src_reg = giv_dest_reg;
/* Compute the increment value for the giv, if it wasn't
already computed above. */
if (giv_inc == 0)
giv_inc = calculate_giv_inc (set, insn, regno);
}
giv_src_reg = giv_dest_reg;
/* Compute the increment value for the giv, if it wasn't
already computed above. */
if (giv_inc == 0)
giv_inc = calculate_giv_inc (set, insn, regno);
src_regno = REGNO (giv_src_reg);
if (unroll_type == UNROLL_COMPLETELY)
@ -2726,10 +2700,6 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
/* Line above always fails if INSN was moved by loop opt. */
|| (uid_luid[REGNO_LAST_UID (REGNO (v->dest_reg))]
>= INSN_LUID (loop->end)))
/* Givs made from biv increments are missed by the above test, so
test explicitly for them. */
&& (REGNO (v->dest_reg) < ivs->first_increment_giv
|| REGNO (v->dest_reg) > ivs->last_increment_giv)
&& ! (final_value = v->final_value))
continue;
@ -2831,7 +2801,6 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
}
splittable_regs[REGNO (v->new_reg)] = value;
derived_regs[REGNO (v->new_reg)] = v->derived_from != 0;
}
else
{
@ -2891,25 +2860,6 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
rtx new_reg = v->new_reg;
record_base_value (REGNO (tem), v->add_val, 0);
if (same && same->derived_from)
{
/* calculate_giv_inc doesn't work for derived givs.
copy_loop_body works around the problem for the
DEST_REG givs themselves, but it can't handle
DEST_ADDR givs that have been combined with
a derived DEST_REG giv.
So Handle V as if the giv from which V->SAME has
been derived has been combined with V.
recombine_givs only derives givs from givs that
are reduced the ordinary, so we need not worry
about same->derived_from being in turn derived. */
same = same->derived_from;
new_reg = express_from (same, v);
new_reg = replace_rtx (new_reg, same->dest_reg,
same->new_reg);
}
/* If the address giv has a constant in its new_reg value,
then this constant can be pulled out and put in value,
instead of being part of the initialization code. */
@ -3017,17 +2967,6 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
INSN_UID (v->insn));
continue;
}
if (v->same && v->same->derived_from)
{
/* Handle V as if the giv from which V->SAME has
been derived has been combined with V. */
v->same = v->same->derived_from;
v->new_reg = express_from (v->same, v);
v->new_reg = replace_rtx (v->new_reg, v->same->dest_reg,
v->same->new_reg);
}
}
/* Store the value of dest_reg into the insn. This sharing
@ -3050,7 +2989,6 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
Make sure that it's giv is marked as splittable here. */
splittable_regs[REGNO (v->new_reg)] = value;
derived_regs[REGNO (v->new_reg)] = v->derived_from != 0;
/* Make it appear to depend upon itself, so that the
giv will be properly split in the main loop above. */
@ -3094,11 +3032,6 @@ find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
if (! v->ignore)
count = ivs->reg_biv_class[REGNO (v->src_reg)]->biv_count;
if (count > 1 && v->derived_from)
/* In this case, there is one set where the giv insn was and one
set each after each biv increment. (Most are likely dead.) */
count++;
splittable_regs_updates[REGNO (v->new_reg)] = count;
}