@@ -49,3 +49,49 @@ define { ppc_fp128, ppc_fp128 } @test_sincospi_ppcf128(ppc_fp128 %a) {
49
49
%result = call { ppc_fp128 , ppc_fp128 } @llvm.sincospi.ppcf128 (ppc_fp128 %a )
50
50
ret { ppc_fp128 , ppc_fp128 } %result
51
51
}
52
+
53
+ ; FIXME: Recognise this as a tail call and omit the stack frame:
54
+ define void @test_sincos_ppcf128_tail_call (ppc_fp128 %a , ptr noalias %out_sin , ptr noalias %out_cos ) {
55
+ ; CHECK-LABEL: test_sincos_ppcf128_tail_call:
56
+ ; CHECK: # %bb.0:
57
+ ; CHECK-NEXT: mflr r0
58
+ ; CHECK-NEXT: stdu r1, -32(r1)
59
+ ; CHECK-NEXT: std r0, 48(r1)
60
+ ; CHECK-NEXT: .cfi_def_cfa_offset 32
61
+ ; CHECK-NEXT: .cfi_offset lr, 16
62
+ ; CHECK-NEXT: bl sincosl
63
+ ; CHECK-NEXT: nop
64
+ ; CHECK-NEXT: addi r1, r1, 32
65
+ ; CHECK-NEXT: ld r0, 16(r1)
66
+ ; CHECK-NEXT: mtlr r0
67
+ ; CHECK-NEXT: blr
68
+ %result = tail call { ppc_fp128 , ppc_fp128 } @llvm.sincos.ppcf128 (ppc_fp128 %a )
69
+ %result.0 = extractvalue { ppc_fp128 , ppc_fp128 } %result , 0
70
+ %result.1 = extractvalue { ppc_fp128 , ppc_fp128 } %result , 1
71
+ store ppc_fp128 %result.0 , ptr %out_sin , align 16
72
+ store ppc_fp128 %result.1 , ptr %out_cos , align 16
73
+ ret void
74
+ }
75
+
76
+ ; FIXME: Recognise this as a tail call and omit the stack frame:
77
+ define void @test_sincospi_ppcf128_tail_call (ppc_fp128 %a , ptr noalias %out_sin , ptr noalias %out_cos ) {
78
+ ; CHECK-LABEL: test_sincospi_ppcf128_tail_call:
79
+ ; CHECK: # %bb.0:
80
+ ; CHECK-NEXT: mflr r0
81
+ ; CHECK-NEXT: stdu r1, -32(r1)
82
+ ; CHECK-NEXT: std r0, 48(r1)
83
+ ; CHECK-NEXT: .cfi_def_cfa_offset 32
84
+ ; CHECK-NEXT: .cfi_offset lr, 16
85
+ ; CHECK-NEXT: bl sincospil
86
+ ; CHECK-NEXT: nop
87
+ ; CHECK-NEXT: addi r1, r1, 32
88
+ ; CHECK-NEXT: ld r0, 16(r1)
89
+ ; CHECK-NEXT: mtlr r0
90
+ ; CHECK-NEXT: blr
91
+ %result = tail call { ppc_fp128 , ppc_fp128 } @llvm.sincospi.ppcf128 (ppc_fp128 %a )
92
+ %result.0 = extractvalue { ppc_fp128 , ppc_fp128 } %result , 0
93
+ %result.1 = extractvalue { ppc_fp128 , ppc_fp128 } %result , 1
94
+ store ppc_fp128 %result.0 , ptr %out_sin , align 16
95
+ store ppc_fp128 %result.1 , ptr %out_cos , align 16
96
+ ret void
97
+ }
0 commit comments