1 ; Because some arguments are passed by reference (through stack),
2 ; the compiler should not do tail-call optimization.
3 ; RUN: llc -mtriple=aarch64 -mattr=+sve < %s | FileCheck %s
6 ; CHECK: addvl sp, sp, #-[[STACKSIZE:[0-9]+]]
9 ; CHECK: addvl sp, sp, #[[STACKSIZE]]
11 define <vscale x 16 x i8> @caller(<vscale x 16 x i8> %v) {
12 %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)
13 ret <vscale x 16 x i8> %1
16 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>)
18 ; CHECK-LABEL: caller_pred:
19 ; CHECK: addvl sp, sp, #-[[STACKSIZE:[0-9]+]]
21 ; CHECK: bl callee_pred
22 ; CHECK: addvl sp, sp, #[[STACKSIZE]]
24 define <vscale x 16 x i1> @caller_pred(<vscale x 16 x i1> %v) {
25 %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)
26 ret <vscale x 16 x i1> %1
29 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>)