1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -homogeneous-prolog-epilog| FileCheck %s
2 ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -homogeneous-prolog-epilog | FileCheck %s --check-prefixes=CHECK-LINUX
4 ; CHECK-LABEL: __Z3hooii:
5 ; CHECK: stp x29, x30, [sp, #-16]!
6 ; CHECK-NEXT: bl _OUTLINED_FUNCTION_PROLOG_x30x29x19x20x21x22
9 ; CHECK: bl _OUTLINED_FUNCTION_EPILOG_x30x29x19x20x21x22
10 ; CHECK-NEXT: b __Z3gooi
12 ; CHECK-LINUX-LABEL: _Z3hooii:
13 ; CHECK-LINUX: stp x29, x30, [sp, #-48]!
14 ; CHECK-LINUX-NEXT: bl OUTLINED_FUNCTION_PROLOG_x19x20x21x22x30x29
15 ; CHECK-LINUX: bl _Z3gooi
16 ; CHECK-LINUX: bl _Z3gooi
17 ; CHECK-LINUX: bl OUTLINED_FUNCTION_EPILOG_x19x20x21x22x30x29
18 ; CHECK-LINUX-NEXT: b _Z3gooi
20 define i32 @_Z3hooii(i32 %b, i32 %a) nounwind ssp minsize {
21 %1 = tail call i32 @_Z3gooi(i32 %b)
22 %2 = tail call i32 @_Z3gooi(i32 %a)
26 %6 = tail call i32 @_Z3gooi(i32 %5)
30 declare i32 @_Z3gooi(i32);
33 ; CHECK: sub sp, sp, #16
35 ; CHECK: add sp, sp, #16
37 define i32 @foo(i32 %c) nounwind minsize {
39 %buffer = alloca [1 x i32], align 4
40 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %buffer)
41 %call = call i32 @goo(ptr nonnull %buffer)
42 %sub = sub nsw i32 %c, %call
43 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %buffer)
48 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
50 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
52 ; CHECK-LABEL: _OUTLINED_FUNCTION_PROLOG_x30x29x19x20x21x22:
53 ; CHECK: stp x22, x21, [sp, #-32]!
54 ; CHECK-NEXT: stp x20, x19, [sp, #16]
57 ; CHECK-LABEL: _OUTLINED_FUNCTION_EPILOG_x30x29x19x20x21x22:
59 ; CHECK-NEXT: ldp x29, x30, [sp, #32]
60 ; CHECK-NEXT: ldp x20, x19, [sp, #16]
61 ; CHECK-NEXT: ldp x22, x21, [sp], #48
64 ; CHECK-LINUX-LABEL: OUTLINED_FUNCTION_PROLOG_x19x20x21x22x30x29:
65 ; CHECK-LINUX: stp x22, x21, [sp, #16]
66 ; CHECK-LINUX-NEXT: stp x20, x19, [sp, #32]
67 ; CHECK-LINUX-NEXT: ret
69 ; CHECK-LINUX-LABEL: OUTLINED_FUNCTION_EPILOG_x19x20x21x22x30x29:
70 ; CHECK-LINUX: mov x16, x30
71 ; CHECK-LINUX-NEXT: ldp x20, x19, [sp, #32]
72 ; CHECK-LINUX-NEXT: ldp x22, x21, [sp, #16]
73 ; CHECK-LINUX-NEXT: ldp x29, x30, [sp], #48
74 ; CHECK-LINUX-NEXT: ret x16