Changing number of registers

Dear llvmers,

    I am testing my register allocator, and I want to reduce the number of
registers in the target architecture, to force spilling. Is there a simple
way of doing this?

best,

Fernando

Dear llvmers,

    I am testing my register allocator, and I want to reduce the number of
registers in the target architecture, to force spilling. Is there a simple
way of doing this?

There sure is - inside the <target>RegsterInfo.td file just grep for
'RegisterClass' - the last parameter of which is a list of registers. Just
commenting some out is one dodgy way to avoid them being used. More polite
is to explicitly exclude some registers from the "allocation order" - see
IA64RegisterInfo.td:443 for an example of this (there, "numReservedRegs"
worth of registers are hidden.)

HTH,
Duraid