This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SEQUENCEs
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: law at redhat dot com
- Cc: Marc Espie <espie at quatramaran dot ens dot fr>, gcc at gcc dot gnu dot org
- Date: Tue, 11 Jun 2002 11:57:53 +0100
- Subject: Re: SEQUENCEs
- Organization: SuperH UK Ltd.
> >it creates. For a bootstrap of i686-pc-linux-gnu, I simply recorded the le
> ngth
> >of each sequence closed in end_sequence.
> >
> ># insns 1 2 3 4 5 6 7 8 9 10+
> >%sequences 80 11 1.2 1.5 1.5 1.7 2.4 0.5 0.4 0.2
> >
> >
> >This clearly shows that most sequences are very short -- so the cost of
> >find the end really should not be that high in few those cases where we
> >actually
Note that the picture is likely to be different for targets that need to
synthesize
lots of operations, e.g. do divide by inverse multiply, and multiply by
shifts & adds, and do shifts in serveral steps.
> I thought briefly about how to optimize for the 2 insn case, but it's
> really no different than the 3, 4 or 5 insn case, except that the list you
> have to traverse to get the last insn (those few times you actually need it)
> is smaller.
If you go with my scheme to make end_sequence return the struct sequence, the
case of one insn is just like the case of 2, 3, 4 or whatever amount of insns.
The only sepcial case is 0 insns.
void
add_sequence (seq)
{
rtx first = seq->first;
rtx last = seq->last;
/* We save this in end_sequence. */
memset (seq, 0, sizeof (*seq));
seq->next = free_sequence_stack;
free_sequence_stack = seq;
if (! first)
return;
PREV_INSN (first) = last_insn;
if (last_insn)
NEXT_INSN (last_insn) = first;
else if (! first_insn)
first_insn = first;
last_insn = last;
}
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330