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 %0 = bitcast [1 x i32]* %buffer to i8*
41 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0)
42 %arraydecay = getelementptr inbounds [1 x i32], [1 x i32]* %buffer, i64 0, i64 0
43 %call = call i32 @goo(i32* nonnull %arraydecay)
44 %sub = sub nsw i32 %c, %call
45 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0)
50 declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
51 declare i32 @goo(i32*)
52 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
54 ; CHECK-LABEL: _OUTLINED_FUNCTION_PROLOG_x30x29x19x20x21x22:
55 ; CHECK: stp x22, x21, [sp, #-32]!
56 ; CHECK-NEXT: stp x20, x19, [sp, #16]
59 ; CHECK-LABEL: _OUTLINED_FUNCTION_EPILOG_x30x29x19x20x21x22:
61 ; CHECK-NEXT: ldp x29, x30, [sp, #32]
62 ; CHECK-NEXT: ldp x20, x19, [sp, #16]
63 ; CHECK-NEXT: ldp x22, x21, [sp], #48
66 ; CHECK-LINUX-LABEL: OUTLINED_FUNCTION_PROLOG_x19x20x21x22x30x29:
67 ; CHECK-LINUX: stp x22, x21, [sp, #16]
68 ; CHECK-LINUX-NEXT: stp x20, x19, [sp, #32]
69 ; CHECK-LINUX-NEXT: ret
71 ; CHECK-LINUX-LABEL: OUTLINED_FUNCTION_EPILOG_x19x20x21x22x30x29:
72 ; CHECK-LINUX: mov x16, x30
73 ; CHECK-LINUX-NEXT: ldp x20, x19, [sp, #32]
74 ; CHECK-LINUX-NEXT: ldp x22, x21, [sp, #16]
75 ; CHECK-LINUX-NEXT: ldp x29, x30, [sp], #48
76 ; CHECK-LINUX-NEXT: ret x16