Speed up register allocation by removing some register classes.
authorGeorge Koehler <xkernigh@netscape.net>
Mon, 13 Feb 2017 22:44:46 +0000 (17:44 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Mon, 13 Feb 2017 22:44:46 +0000 (17:44 -0500)
commitc5bb3be495a6deda4c00a64f3cb73478ede7e5e4
tree65448990167e9cabab196049c6f6a9ce6b9b42e8
parentdc05cb2dc84851ae9eedfde7da04a50e7dd41c1f
Speed up register allocation by removing some register classes.

The table for PowerPC had placed each GPR and FPR into an individual
register class (like GPR3, GPR4, FPR1, FPR2), and had used these
classes to coerce stack values into specific registers.  But ncg does
not like having many register classes.

In http://tack.sourceforge.net/olddocs/ncg.pdf
Hans van Staveren wrote:

> Every extra property means the register set is more unorthogonal and
> *cg* execution time is influenced by that, because it has to take
> into account a larger set of registers that are not equivalent.  So
> try to keep the number of different register classes to a minimum.

Recent changes to the PowerPC table have removed many coercions to
specific registers.  Many functions in libem switched from taking
values in registers to taking them from the stack (see dc05cb2).

I now remove all 64 individual register classes of GPR and FPR.  In
the few cases where I need a stack value in a specific register, I now
do a move (as the arm and m68020 tables do).

This commit speeds the compilation of some files.  For my test file
fconv.c, the compilation time goes from over 20 seconds to under 1
second.  My fconv.c has 4 conversions from floats to integers, and the
table has my experimental rules that do the conversions by allocating
4 or 5 registers.
mach/powerpc/ncg/table