mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
d5840c476d
Summary: This patch implements the part of the calling convention where SVE Vectors are passed by reference. This means the caller must allocate stack space for these objects and pass the address to the callee. Reviewers: efriedma, rovka, cameron.mcinally, c-rhodes, rengolin Reviewed By: efriedma Subscribers: tschuett, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71216
30 lines
1.5 KiB
LLVM
30 lines
1.5 KiB
LLVM
; Because some arguments are passed by reference (through stack),
|
|
; the compiler should not do tail-call optimization.
|
|
; RUN: llc -mtriple=aarch64 -mattr=+sve < %s | FileCheck %s
|
|
|
|
; CHECK-LABEL: caller:
|
|
; CHECK: addvl sp, sp, #-[[STACKSIZE:[0-9]+]]
|
|
; CHECK-NOT: addvl sp
|
|
; CHECK: bl callee
|
|
; CHECK: addvl sp, sp, #[[STACKSIZE]]
|
|
; CHECK: ret
|
|
define <vscale x 16 x i8> @caller(<vscale x 16 x i8> %v) {
|
|
%1 = tail call <vscale x 16 x i8> @callee(<vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v, <vscale x 16 x i8> %v)
|
|
ret <vscale x 16 x i8> %1
|
|
}
|
|
|
|
declare <vscale x 16 x i8> @callee(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)
|
|
|
|
; CHECK-LABEL: caller_pred:
|
|
; CHECK: addvl sp, sp, #-[[STACKSIZE:[0-9]+]]
|
|
; CHECK-NOT: addvl sp
|
|
; CHECK: bl callee_pred
|
|
; CHECK: addvl sp, sp, #[[STACKSIZE]]
|
|
; CHECK: ret
|
|
define <vscale x 16 x i1> @caller_pred(<vscale x 16 x i1> %v) {
|
|
%1 = tail call <vscale x 16 x i1> @callee_pred(<vscale x 16 x i1> %v, <vscale x 16 x i1> %v, <vscale x 16 x i1> %v, <vscale x 16 x i1> %v, <vscale x 16 x i1> %v)
|
|
ret <vscale x 16 x i1> %1
|
|
}
|
|
|
|
declare <vscale x 16 x i1> @callee_pred(<vscale x 16 x i1>, <vscale x 16 x i1>, <vscale x 16 x i1>, <vscale x 16 x i1>, <vscale x 16 x i1>)
|