[llvm-dev] callee-save for register aliases

Davis, Alan via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 7 09:02:36 PDT 2017

We have vector registers and scalar registers that alias their low bits. That is

def ScalarSRI : SubRegIndex<32>
def Scalar<n> : Register<n>
def Vector<n, s> : Register<n> { let SubRegs = [s]; let SubRegIndices = ScalarSRI; }

If a function only defs the scalar part of a callee-saved vector register, the other bits are not affected and it would be desirable not to save and restore them.  But determineCalleeSaves() uses isPhysRegModified(), which returns true if that register or any of its aliases are defed.

Is there a way around this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170407/0be5be16/attachment.html>

More information about the llvm-dev mailing list