This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about register allocation (GCC 4.1)
- From: Jim Wilson <wilson at specifix dot com>
- To: Thomas Bernard <tbernard at science dot uva dot nl>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 16 Feb 2007 14:56:01 -0800
- Subject: Re: Question about register allocation (GCC 4.1)
- References: <45D5E851.40905@science.uva.nl>
Thomas Bernard wrote:
So basically this is known at compile-time. Such as "dynamic" register
allocator.
Is it that possible and what are the implications on the register
allocator ???
The IA-64 case is much simpler. We have variable sized overlapping
register windows. GCC already has register window support for sparc and
i960 (since obsoleted).
The dynamic part is hard though. I didn't try to solve that. I have at
most 96 locals, 8 inputs, and 8 outputs. The port is defined to have 80
locals, 8 inputs, and 8 outputs, i.e. the size of the input/output sets
is fixed at their maximums. After register allocation, I look through
the input/output register sets to see how many were actually used, and I
just allocate that many. The only down side is that if some inputs and
outputs are unused, then I can't add them to the local set. However,
given that I have 80 of them, it is very rare to run out. Also, since
input/output registers can be used for other stuff besides input/output
arguments, it is even rarer to run out of locals and still have unused
input/output regs left. So I don't worry about it.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com