[llvm-dev] CFI directives for callee saved registers

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 6 13:52:57 PDT 2017


(Adding llvm-dev back in case someone else comes along with similar
questions later).

On 6 October 2017 at 13:44, Zaara Syeda <syzaara at ca.ibm.com> wrote:
> Thanks for the suggestion. If I use the cfi_register directive, don't the
> registers need to be of the same register class? Otherwise, how will the
> value be moved out of the vector register back into the gpr?

LLVM itself doesn't care. It's just using these directives to emit
some metadata telling debuggers and unwinders where to find values.

As for those other components, just what .cfi_register means is a
matter for the platform's ABI to define in an ideal world. In the case
where the sizes mismatch (and possibly even otherwise) it should say
which bits of the source register correspond to those of the
destination. You'd then follow that spec when implementing your spill
code.

In the real world, hardly anyone uses this method of spilling and I'm
not aware of an ABI document that describes how it should be done. So
as the (possibly) first implementor on your platform you probably get
to choose what the convention is. Choose wisely.

Cheers.

Tim.


More information about the llvm-dev mailing list