[llvm-dev] How to implement spills into a second bank of registers (?)
Joan Lluch via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 15 08:16:45 PDT 2019
For my processor ABI, I have a second bank of registers. The instruction set has ‘mov’ instructions to copy to and from the two register banks. The registers in the second bank have no regular use in instructions, however they are there for temporary storage purposes and it would be desirable that they could be used as spills when there’s shortage of primary registers.
The second bank of registers is defined as a belonging to a separate register class. I have defined the required ‘mov' instructions to move between register classes in tablegen. I also updated copyPhysReg to account for these moves.
However, LLVM does not seem to use the second register bank at all.
As a side note, the spills to the stack are implemented and they work fine. I would have expected that LLVM would use the second register bank as backup storage before creating actual stack spills, but this does not happen.
Why is that?. Should I implement this in some custom way?
any help would be appreciated
More information about the llvm-dev