This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About Regmove !!
- From: tm <tm at mail dot kloo dot net>
- To: Michael Matz <matz at suse dot de>
- Cc: joern dot rennecke at superh dot com, gcc at gcc dot gnu dot org
- Date: Tue, 12 Nov 2002 11:14:27 -0800 (PST)
- Subject: Re: About Regmove !!
On Tue, 12 Nov 2002, Michael Matz wrote:
> Hi,
>
> On Mon, 11 Nov 2002, tm wrote:
>
> > Erm. Regmove does more than simple register-to-register copy elimination.
>
> Yes.
>
> > It also optimizes for address inheritance, which is critical for many
> > processors with short displacement addressing, such as the SH4.
>
> Are you talking about the combine_stack_adjustment() which just happens to
> be implemented in regmove.c also, or about the transformation of
> pX <= pA + N
> ...
> pX <= pA + M
> into
> pX <= pA + N
> ...
> pX <= pX + (M - N)
> ?
>
> I guess you meant the latter. Interestingly it isn't done generally, but
> only applies when pX and pA need to match in an insn. I.e. in that
> context it isn't used at all for shortening immediate constants. If it's
> an important optimization it should be implemented more generally,
> although this might not be easy if one want to take register pressure into
> account.
Yes, this latter optimization is address inheritance.
Code size can increase by a factor of two (or more, because of increased
spills) if this optimization is removed.
>
> > Does new-regalloc do address inheritance optimization?
>
> No (t yet?).
>
> > If not, can we retain the portion of regmove which implements this
> > optimization?
>
> Of course.
Okay. Please keep this in mind.
> Ciao,
> Michael.
Toshi