I'm looking at a problem with the gcc 4.4.0 port I'm supporting where
the architecture has separate address and data registers. In order to
get good code generation we need a single cover class to cover both the
data and address register classes as moving between them is no more
expensive than moving between registers of the same type.
The problem is that in order to get good general code generation I have
to have the data registers listed first in the reg alloc order but if I
do that then the IRA pass tries to put addresses into those data
registers even though during the early phases it has recognized that the
preferred register class is actually the one used for address registers.
What happens now is that reload tries to fix this up but it generates
terrible code at times, adding copies between data and address registers
and then copying things back (it gets even worse if the address was
using an auto-inc/dec mode).
I would have hoped that having done the analysis early on that the
register allocator would try to allocate from the preferred register
class rather than the cover class but it seems that doesn't happen?
Curiously the problem is much worse with smaller, simpler functions -
once a function starts to generate conflicts then the register allocator
starts to assign registers to the ideal class.
Anyone have any ideas other than writing a pass that runs before reload
and tries to fix this up?
Thanks,
Dave
- Any ideas how to get the IRA to choose one subclass of registe... Dave Hudson
-