[llvm-commits] [patch] Refactor getCalleeSavedRegClasses and getCalleeSavedRegs

Rafael Espindola espindola at google.com
Tue Jun 1 21:11:50 PDT 2010

> The function is evil because there is no right answer - a register can be in multiple register classes. It is double evil because the answer is usually used to pass back to the target anyway. The target already knows all it needs to know about R4.
> It is the same nonsense with PEI - it just needs something to pass back into storeRegToStackSlot() / loadRegFromStackSlot().
> The really dangerous bit here is PowerPC. It has callee-saved floating point registers, and it makes a difference if they are spilled as floats or doubles. Again, the LEAST super register class would be the right choice (F8RC is a subclass of F4RC, based on the substitution principle).

Thanks a lot for the info! There is one more case that causes
problems: win64. It defines some xmm registers to be callee saved. We
have the classes FR32, FR64 and VR12. They all contain the same

getPhysicalRegisterRegClass is truly evil! The ARM backend partially
overrides it. It still expects the old behaviour for floating point

Thanks a lot for the pointers. I have some ideas on how to improve
things, will give it a try tomorrow and post a new patch if it works.

> /jakob

Rafael Ávila de Espíndola

More information about the llvm-commits mailing list