About Regmove !!

tm tm@mail.kloo.net
Tue Nov 12 11:36:00 GMT 2002


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




More information about the Gcc mailing list