This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What to do with new-ra for GCC 4.0
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: stevenb at suse dot de
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 4 Jan 05 12:17:32 EST
- Subject: Re: What to do with new-ra for GCC 4.0
I agree with all you say above, except that the things the existing
allocator does shouldn't be replicated, but moved to an earlier point
in the compilation process. Specifically, "instruction selection",
or in GCC terms alternative selection, should happen before regalloc
as much as possible,
But you can't. It's fairly common (especially on DSP-like machines)
to have a pseudo used in multiple instructions, each of which require
a different register class for that operand. If you define "register
allocation" as producing a single register to be allocated to a pseudo
(and I recognize that we may want to do splitting earlier), then you can't
do instruction selection too early. Consider the 68k, which has two add
instructions, one which operates only on data registers and one which
operates only on address register. You can't possibly decide which one to
use until you've allocate all the pseudos, though you certainly can (and
we do) use knowlege of those possibilities in deciding how to allocate the
pseudos.
and in general machine descriptions should not
rely on reload to fix all the silly insns that look nothing like the
actual machine instructions.
No debate on that. Indeed, making machine descriptions have
constraints that match predicates as closely as possible was perhaps
the major change between GCC 1 and GCC 2. The newer ports do this,
but the older ones tend not to.