This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New Regalloc Branch
- From: Michael Matz <matz at kde dot org>
- To: Erwin Ingris <erwiningris at yahoo dot com dot au>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 27 May 2002 16:25:49 +0200 (MET DST)
- Subject: Re: New Regalloc Branch
Hi,
On Mon, 27 May 2002, Erwin Ingris wrote:
> I noticed that GCC is going to have a new-register allocator.
> However I could not find out why? or what are the known deficiencies
> with existing register allocator. Could the community enlighten me!!
The current allocator (which really works in three passes) doesn't work
really globally, and the algorithms it uses are failry adhoc. It can't
split pseudo registers, or coalesce them (although it has something like
preferences to get rid of copies, which is something like coalescing).
It doesn't use exact live-ness information to the full extent. And
spill-code is inserted by a different pass (reload), which means it can't
be taken into account by the allocator. To not produce bad code, reload
has wonderfull and big chunks of code, making it barely maintainable.
Of course it's also fun to write a register allocator for something
with such diverse needs like gcc's architectures ;)
> and I am also curious about when it will be in a position to bootstrap
> for other ports except x86 and ppc-linux.
It once bootstrapped also on alpha and sparc. I'm currenly looking why
it doesn't anymore (on ppc, s390x, alpha and sparc).
> (and if I want to help, can some one roughly tell me how to do it)
checkout the branch, and figure out how and where it does miscompile your
favourite sources S (although it compiled correctly with -fno-new-ra),
simplify it to a small testcase T, and send that to me. Bonus points if S
is gcc itself on a different architecture than x86 (currently I'm fighting
with alphaev67 and powerpc), for the bootstrap. ;) Even more points for
also providing a patch which fixes the problem. But for that you need a
fairly good understanding of ra.c, which isn't exactly easy sometimes,
because of the lack of comments in strategic places.
Ciao,
Michael.