[PATCH] D65448: [AArch64] Implement initial SVE calling convention support

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 06:50:16 PDT 2019


c-rhodes created this revision.
c-rhodes added reviewers: sdesmalen, huntergr, SjoerdMeijer, t.p.northover.
Herald added subscribers: kristof.beyls, tschuett, javed.absar.
Herald added a reviewer: rengolin.
Herald added a project: LLVM.
c-rhodes added a parent revision: D47770: [MVT][SVE] Add EVT strings and Type mapping.

This patch adds initial support for the SVE calling convention such that
SVE types can be passed as arguments and return values to/from a
subroutine.

The SVE AAPCS states [1]:

  z0-z7 are used to pass scalable vector arguments to a subroutine,
  and to return scalable vector results from a function. If a
  subroutine takes arguments in scalable vector or predicate
  registers, or if it is a function that returns results in such
  registers, it must ensure that the entire contents of z8-z23 are
  preserved across the call. In other cases it need only preserve the
  low 64 bits of z8-z15, as described in ยง5.1.2.
  
  p0-p3 are used to pass scalable predicate arguments to a subroutine
  and to return scalable predicate results from a function. If a
  subroutine takes arguments in scalable vector or predicate
  registers, or if it is a function that returns results in these
  registers, it must ensure that p4-p15 are preserved across the call.
  In other cases it need not preserve any scalable predicate register
  contents.

SVE predicate and data registers are passed indirectly (i.e. spilled to the
stack and pass the address) if they exceed the registers used for argument
passing defined by the PCS referenced above.  Until SVE stack support is merged
we can't spill SVE registers to the stack, so currently an llvm_unreachable is
used where we will eventually handle this.

[1] https://static.docs.arm.com/100986/0000/100986_0000.pdf


Repository:
  rL LLVM

https://reviews.llvm.org/D65448

Files:
  include/llvm/IR/CallingConv.h
  lib/Target/AArch64/AArch64CallingConvention.td
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/AArch64/AArch64RegisterInfo.cpp
  test/CodeGen/AArch64/sve-calling-convention.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65448.212324.patch
Type: text/x-patch
Size: 9763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190730/17028066/attachment.bin>


More information about the llvm-commits mailing list