1 ; RUN: llc -mtriple=x86_64-apple-darwin -stop-after finalize-isel <%s | FileCheck %s
3 ; Check that the callee doesn't have calleeSavedRegisters.
4 define preserve_nonecc i64 @callee1(i64 %a0, i64 %b0, i64 %c0, i64 %d0, i64 %e0) nounwind {
11 ; CHECK: name: callee1
12 ; CHECK-NOT: calleeSavedRegisters:
15 ; Check that RegMask is csr_64_noneregs.
16 define i64 @caller1(i64 %a0) nounwind {
17 %b1 = call preserve_nonecc i64 @callee1(i64 %a0, i64 %a0, i64 %a0, i64 %a0, i64 %a0)
18 %b2 = add i64 %b1, %a0
21 ; CHECK: name: caller1
22 ; CHECK: CALL64pcrel32 @callee1, csr_64_noneregs
26 ; Check that the callee doesn't have calleeSavedRegisters.
27 define preserve_nonecc {i64, i64} @callee2(i64 %a0, i64 %b0, i64 %c0, i64 %d0, i64 %e0) nounwind {
28 %a1 = mul i64 %a0, %b0
29 %a2 = mul i64 %a1, %c0
30 %a3 = mul i64 %a2, %d0
31 %a4 = mul i64 %a3, %e0
32 %b4 = insertvalue {i64, i64} undef, i64 %a3, 0
33 %b5 = insertvalue {i64, i64} %b4, i64 %a4, 1
36 ; CHECK: name: callee2
37 ; CHECK-NOT: calleeSavedRegisters:
38 ; CHECK: RET 0, $rax, $rdx
41 ; Check that RegMask is csr_64_noneregs.
42 define {i64, i64} @caller2(i64 %a0) nounwind {
43 %b1 = call preserve_nonecc {i64, i64} @callee2(i64 %a0, i64 %a0, i64 %a0, i64 %a0, i64 %a0)
46 ; CHECK: name: caller2
47 ; CHECK: CALL64pcrel32 @callee2, csr_64_noneregs
48 ; CHECK: RET 0, $rax, $rdx
51 %struct.Large = type { i64, double, double }
53 ; Declare the callee with a sret parameter.
54 declare preserve_nonecc void @callee3(ptr noalias nocapture writeonly sret(%struct.Large) align 4 %a0, i64 %b0) nounwind;
56 ; Check that RegMask is csr_64_noneregs.
57 define void @caller3(i64 %a0) nounwind {
58 %a1 = alloca %struct.Large, align 8
59 call preserve_nonecc void @callee3(ptr nonnull sret(%struct.Large) align 8 %a1, i64 %a0)
62 ; CHECK: name: caller3
63 ; CHECK: CALL64pcrel32 @callee3, csr_64_noneregs
67 ; Check that the callee doesn't have calleeSavedRegisters.
68 define preserve_nonecc {i64, double} @callee4(i64 %a0, i64 %b0, i64 %c0, i64 %d0, i64 %e0) nounwind {
69 %a1 = mul i64 %a0, %b0
70 %a2 = mul i64 %a1, %c0
71 %a3 = mul i64 %a2, %d0
72 %a4 = mul i64 %a3, %e0
73 %b4 = insertvalue {i64, double} undef, i64 %a3, 0
74 %b5 = insertvalue {i64, double} %b4, double 1.2, 1
77 ; CHECK: name: callee4
78 ; CHECK-NOT: calleeSavedRegisters:
79 ; CHECK: RET 0, $rax, $xmm0
81 ; Check that RegMask is csr_64_noneregs.
82 define {i64, double} @caller4(i64 %a0) nounwind {
83 %b1 = call preserve_nonecc {i64, double} @callee4(i64 %a0, i64 %a0, i64 %a0, i64 %a0, i64 %a0)
86 ; CHECK: name: caller4
87 ; CHECK: CALL64pcrel32 @callee4, csr_64_noneregs
88 ; CHECK: RET 0, $rax, $xmm0