This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [IRA] New register allocator question
Bingfeng Mei wrote:
Hello,
I recently ported our GCC to new IRA by following mainline development. The only interface I added is IRA_COVER_CLASSES. Our architecture has predicate register file. When predicate register has to be spilled, the new IRA produces inferior code to the old register allocator. The old allocator first tries to spill to general register file, which is far cheaper on our architecture than spilling to memory. The IRA always spills the predicate register to memory directly.
#define IRA_COVER_CLASSES \
{ \
GR_REGS, PR_REGS, M_REGS, BXBC_REGS, LIM_REG_CLASSES \
}
Apart from above macro, what other interfaces/parameters I can tune to change this behaviour in new IRA? Thanks in advance.
It is not necessary anymore to define macro IRA_COVER_CLASSES to use IRA
for a new target. But it is recommended for most targets to get a
better RA because without the macro only priority coloring will be
used. You could try priority coloring with defined IRA_COVER_CLASSES by
using option -fira-algorigthm=priority.
As for the problem about spilling predicate register to memory by IRA,
it seems to me that the old RA used union register class GR_REGS+PR_REGS
for the pseudos because reload pass does not spill into registers. So
to solve the problem, you could try
o to use union of GR_REGS and PR_REGS instead of separate GR_REGS and
PR_REGS in IRA_COVER_CLASSES
o to use priority coloring which can use the union classes automatically