This is the mail archive of the
mailing list for the GCC project.
Re: Problems with the way we calculate costs
> Date: Mon, 11 Sep 2000 10:15:25 +0100 (BST)
> From: Bernd Schmidt <firstname.lastname@example.org>
> cc: email@example.com
> On Mon, 11 Sep 2000, Geoff Keating wrote:
> > It'd probably be better if it worked like the original code; that is,
> > the cost of a non-fixed hard register is 2, compared to 1 for a
> > pseudo. This ensures a pseudo gets preference, which would be the
> > usual case because such hard registers should be copied into pseudos
> > immediately after they appear.
> The original code mixed up these register pressure considerations with
> the calculation of the cost of an operation. I still think this is a
> bad idea. It also won't reliably prevent lifetimes of hard registers
> from being lenghtened (think of computing the cost of a shift of a
> hardreg as opposed to multiplication of a pseudo).
I don't mind hard register lifetimes being lengthened if it really
makes the program faster; what I was complaining about is when a
hardreg and a pseudo are equivalent and the hardreg gets preference.
[I claim, though, that in at least the rs6000 backend it will _always_
be true that a hard reg is either fixed or equivalent to a pseudo.]
Probably the macro to consider is SMALL_REGISTER_CLASSES.
- Geoffrey Keating <firstname.lastname@example.org>