annotate llvm/test/CodeGen/AMDGPU/sibling-call.ll @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 0572611fdcc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -mattr=-flat-for-global -enable-ipra=0 -amdgpu-sroa=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VI,CIVI,MESA %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -enable-ipra=0 -amdgpu-sroa=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CI,CIVI,MESA %s
anatofuz
parents:
diff changeset
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -mattr=-flat-for-global -enable-ipra=0 -amdgpu-sroa=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9,MESA %s
anatofuz
parents:
diff changeset
4 target datalayout = "A5"
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 ; FIXME: Why is this commuted only sometimes?
anatofuz
parents:
diff changeset
7 ; GCN-LABEL: {{^}}i32_fastcc_i32_i32:
anatofuz
parents:
diff changeset
8 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
9 ; CIVI-NEXT: v_add_{{i|u}}32_e32 v0, vcc, v0, v1
anatofuz
parents:
diff changeset
10 ; GFX9-NEXT: v_add_u32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
11 ; GCN-NEXT: s_setpc_b64
anatofuz
parents:
diff changeset
12 define fastcc i32 @i32_fastcc_i32_i32(i32 %arg0, i32 %arg1) #1 {
anatofuz
parents:
diff changeset
13 %add0 = add i32 %arg0, %arg1
anatofuz
parents:
diff changeset
14 ret i32 %add0
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 ; GCN-LABEL: {{^}}i32_fastcc_i32_i32_stack_object:
anatofuz
parents:
diff changeset
18 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
19 ; GCN-NEXT: v_mov_b32_e32 [[K:v[0-9]+]], 9
anatofuz
parents:
diff changeset
20 ; CIVI-NEXT: v_add_{{i|u}}32_e32 v0, vcc, v0, v1
anatofuz
parents:
diff changeset
21 ; GFX9-NEXT: v_add_u32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
22 ; GCN: buffer_store_dword [[K]], off, s[0:3], s32 offset:20
anatofuz
parents:
diff changeset
23 ; GCN: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
24 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
25 ; GCN: ; ScratchSize: 68
anatofuz
parents:
diff changeset
26 define fastcc i32 @i32_fastcc_i32_i32_stack_object(i32 %arg0, i32 %arg1) #1 {
anatofuz
parents:
diff changeset
27 %alloca = alloca [16 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
28 %gep = getelementptr inbounds [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 5
anatofuz
parents:
diff changeset
29 store volatile i32 9, i32 addrspace(5)* %gep
anatofuz
parents:
diff changeset
30 %add0 = add i32 %arg0, %arg1
anatofuz
parents:
diff changeset
31 ret i32 %add0
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32:
anatofuz
parents:
diff changeset
35 define hidden fastcc i32 @sibling_call_i32_fastcc_i32_i32(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
36 entry:
anatofuz
parents:
diff changeset
37 %ret = tail call fastcc i32 @i32_fastcc_i32_i32(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
38 ret i32 %ret
anatofuz
parents:
diff changeset
39 }
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32_stack_object:
anatofuz
parents:
diff changeset
42 ; GCN: v_mov_b32_e32 [[NINE:v[0-9]+]], 9
anatofuz
parents:
diff changeset
43 ; GCN: buffer_store_dword [[NINE]], off, s[0:3], s32 offset:20
anatofuz
parents:
diff changeset
44 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
45 ; GCN: ; ScratchSize: 68
anatofuz
parents:
diff changeset
46 define fastcc i32 @sibling_call_i32_fastcc_i32_i32_stack_object(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
47 entry:
anatofuz
parents:
diff changeset
48 %alloca = alloca [16 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
49 %gep = getelementptr inbounds [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 5
anatofuz
parents:
diff changeset
50 store volatile i32 9, i32 addrspace(5)* %gep
anatofuz
parents:
diff changeset
51 %ret = tail call fastcc i32 @i32_fastcc_i32_i32(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
52 ret i32 %ret
anatofuz
parents:
diff changeset
53 }
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32_callee_stack_object:
anatofuz
parents:
diff changeset
56 ; GCN: v_mov_b32_e32 [[NINE:v[0-9]+]], 9
anatofuz
parents:
diff changeset
57 ; GCN: buffer_store_dword [[NINE]], off, s[0:3], s32 offset:20
anatofuz
parents:
diff changeset
58 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
59 ; GCN: ; ScratchSize: 136
anatofuz
parents:
diff changeset
60 define fastcc i32 @sibling_call_i32_fastcc_i32_i32_callee_stack_object(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
61 entry:
anatofuz
parents:
diff changeset
62 %alloca = alloca [16 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
63 %gep = getelementptr inbounds [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 5
anatofuz
parents:
diff changeset
64 store volatile i32 9, i32 addrspace(5)* %gep
anatofuz
parents:
diff changeset
65 %ret = tail call fastcc i32 @i32_fastcc_i32_i32_stack_object(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
66 ret i32 %ret
anatofuz
parents:
diff changeset
67 }
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32_unused_result:
anatofuz
parents:
diff changeset
70 define fastcc void @sibling_call_i32_fastcc_i32_i32_unused_result(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
71 entry:
anatofuz
parents:
diff changeset
72 %ret = tail call fastcc i32 @i32_fastcc_i32_i32(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
73 ret void
anatofuz
parents:
diff changeset
74 }
anatofuz
parents:
diff changeset
75
anatofuz
parents:
diff changeset
76 ; It doesn't make sense to do a tail from a kernel
anatofuz
parents:
diff changeset
77 ; GCN-LABEL: {{^}}kernel_call_i32_fastcc_i32_i32_unused_result:
anatofuz
parents:
diff changeset
78 ;define amdgpu_kernel void @kernel_call_i32_fastcc_i32_i32_unused_result(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
79 define amdgpu_kernel void @kernel_call_i32_fastcc_i32_i32_unused_result(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
80 entry:
anatofuz
parents:
diff changeset
81 %ret = tail call fastcc i32 @i32_fastcc_i32_i32(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
82 ret void
anatofuz
parents:
diff changeset
83 }
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 ; GCN-LABEL: {{^}}i32_fastcc_i32_byval_i32:
anatofuz
parents:
diff changeset
86 ; GCN: s_waitcnt
anatofuz
parents:
diff changeset
87 ; GCN-NEXT: buffer_load_dword v1, off, s[0:3], s32{{$}}
anatofuz
parents:
diff changeset
88 ; GCN-NEXT: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
89
anatofuz
parents:
diff changeset
90 ; CIVI-NEXT: v_add_{{i|u}}32_e32 v0, vcc, v0, v1
anatofuz
parents:
diff changeset
91 ; GFX9-NEXT: v_add_u32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
92
anatofuz
parents:
diff changeset
93 ; GCN-NEXT: s_setpc_b64 s[30:31]
anatofuz
parents:
diff changeset
94 define hidden fastcc i32 @i32_fastcc_i32_byval_i32(i32 %arg0, i32 addrspace(5)* byval align 4 %arg1) #1 {
anatofuz
parents:
diff changeset
95 %arg1.load = load i32, i32 addrspace(5)* %arg1, align 4
anatofuz
parents:
diff changeset
96 %add0 = add i32 %arg0, %arg1.load
anatofuz
parents:
diff changeset
97 ret i32 %add0
anatofuz
parents:
diff changeset
98 }
anatofuz
parents:
diff changeset
99
anatofuz
parents:
diff changeset
100 ; Tail call disallowed with byval in parent.
anatofuz
parents:
diff changeset
101 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_byval_i32_byval_parent:
anatofuz
parents:
diff changeset
102 ; GCN-NOT: v_writelane_b32 v{{[0-9]+}}, s32
anatofuz
parents:
diff changeset
103 ; GCN: buffer_store_dword v{{[0-9]+}}, off, s[0:3], s32{{$}}
anatofuz
parents:
diff changeset
104 ; GCN: s_swappc_b64
anatofuz
parents:
diff changeset
105 ; GCN-NOT: v_readlane_b32 s32
anatofuz
parents:
diff changeset
106 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
107 define fastcc i32 @sibling_call_i32_fastcc_i32_byval_i32_byval_parent(i32 %a, i32 addrspace(5)* byval %b.byval, i32 %c) #1 {
anatofuz
parents:
diff changeset
108 entry:
anatofuz
parents:
diff changeset
109 %ret = tail call fastcc i32 @i32_fastcc_i32_byval_i32(i32 %a, i32 addrspace(5)* %b.byval)
anatofuz
parents:
diff changeset
110 ret i32 %ret
anatofuz
parents:
diff changeset
111 }
anatofuz
parents:
diff changeset
112
anatofuz
parents:
diff changeset
113 ; Tail call disallowed with byval in parent, not callee. The stack
anatofuz
parents:
diff changeset
114 ; usage of incoming arguments must be <= the outgoing stack
anatofuz
parents:
diff changeset
115 ; arguments.
anatofuz
parents:
diff changeset
116
anatofuz
parents:
diff changeset
117 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_byval_i32:
anatofuz
parents:
diff changeset
118 ; GCN-NOT: v0
anatofuz
parents:
diff changeset
119 ; GCN-NOT: s32
anatofuz
parents:
diff changeset
120 ; GCN: buffer_load_dword v1, off, s[0:3], s33 offset:16
anatofuz
parents:
diff changeset
121 ; GCN: buffer_store_dword v1, off, s[0:3], s32{{$}}
anatofuz
parents:
diff changeset
122 ; GCN-NEXT: s_setpc_b64
anatofuz
parents:
diff changeset
123 define fastcc i32 @sibling_call_i32_fastcc_i32_byval_i32(i32 %a, [32 x i32] %large) #1 {
anatofuz
parents:
diff changeset
124 entry:
anatofuz
parents:
diff changeset
125 %ret = tail call fastcc i32 @i32_fastcc_i32_byval_i32(i32 %a, i32 addrspace(5)* inttoptr (i32 16 to i32 addrspace(5)*))
anatofuz
parents:
diff changeset
126 ret i32 %ret
anatofuz
parents:
diff changeset
127 }
anatofuz
parents:
diff changeset
128
anatofuz
parents:
diff changeset
129 ; GCN-LABEL: {{^}}i32_fastcc_i32_i32_a32i32:
anatofuz
parents:
diff changeset
130 ; GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
anatofuz
parents:
diff changeset
131 ; GCN-DAG: buffer_load_dword [[LOAD_0:v[0-9]+]], off, s[0:3], s32{{$}}
anatofuz
parents:
diff changeset
132 ; GCN-DAG: buffer_load_dword [[LOAD_1:v[0-9]+]], off, s[0:3], s32 offset:4
anatofuz
parents:
diff changeset
133
anatofuz
parents:
diff changeset
134 ; CIVI-NEXT: v_add_{{i|u}}32_e32 v0, vcc, v0, v1
anatofuz
parents:
diff changeset
135 ; CIVI: v_add_{{i|u}}32_e32 v0, vcc, v0, [[LOAD_0]]
anatofuz
parents:
diff changeset
136 ; CIVI: v_add_{{i|u}}32_e32 v0, vcc, v0, [[LOAD_1]]
anatofuz
parents:
diff changeset
137
anatofuz
parents:
diff changeset
138
anatofuz
parents:
diff changeset
139 ; GFX9-NEXT: v_add_u32_e32 v0, v0, v1
anatofuz
parents:
diff changeset
140 ; GFX9: v_add3_u32 v0, v0, v3, v2
anatofuz
parents:
diff changeset
141
anatofuz
parents:
diff changeset
142 ; GCN-NEXT: s_setpc_b64
anatofuz
parents:
diff changeset
143 define fastcc i32 @i32_fastcc_i32_i32_a32i32(i32 %arg0, i32 %arg1, [32 x i32] %large) #1 {
anatofuz
parents:
diff changeset
144 %val_firststack = extractvalue [32 x i32] %large, 30
anatofuz
parents:
diff changeset
145 %val_laststack = extractvalue [32 x i32] %large, 31
anatofuz
parents:
diff changeset
146 %add0 = add i32 %arg0, %arg1
anatofuz
parents:
diff changeset
147 %add1 = add i32 %add0, %val_firststack
anatofuz
parents:
diff changeset
148 %add2 = add i32 %add1, %val_laststack
anatofuz
parents:
diff changeset
149 ret i32 %add2
anatofuz
parents:
diff changeset
150 }
anatofuz
parents:
diff changeset
151
anatofuz
parents:
diff changeset
152 ; FIXME: Why load and store same location for stack args?
anatofuz
parents:
diff changeset
153 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32_a32i32:
anatofuz
parents:
diff changeset
154
anatofuz
parents:
diff changeset
155 ; GCN-DAG: buffer_store_dword v32, off, s[0:3], s32 offset:12 ; 4-byte Folded Spill
anatofuz
parents:
diff changeset
156 ; GCN-DAG: buffer_store_dword v33, off, s[0:3], s32 offset:8 ; 4-byte Folded Spill
anatofuz
parents:
diff changeset
157
anatofuz
parents:
diff changeset
158 ; GCN-DAG: buffer_load_dword [[LOAD_0:v[0-9]+]], off, s[0:3], s32{{$}}
anatofuz
parents:
diff changeset
159 ; GCN-DAG: buffer_load_dword [[LOAD_1:v[0-9]+]], off, s[0:3], s32 offset:4
anatofuz
parents:
diff changeset
160
anatofuz
parents:
diff changeset
161 ; GCN-NOT: s32
anatofuz
parents:
diff changeset
162
anatofuz
parents:
diff changeset
163 ; GCN-DAG: buffer_store_dword [[LOAD_0]], off, s[0:3], s32{{$}}
anatofuz
parents:
diff changeset
164 ; GCN-DAG: buffer_store_dword [[LOAD_1]], off, s[0:3], s32 offset:4
anatofuz
parents:
diff changeset
165
anatofuz
parents:
diff changeset
166 ; GCN-DAG: buffer_load_dword v32, off, s[0:3], s32 offset:12 ; 4-byte Folded Reload
anatofuz
parents:
diff changeset
167 ; GCN-DAG: buffer_load_dword v33, off, s[0:3], s32 offset:8 ; 4-byte Folded Reload
anatofuz
parents:
diff changeset
168
anatofuz
parents:
diff changeset
169 ; GCN-NOT: s32
anatofuz
parents:
diff changeset
170 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
171 define fastcc i32 @sibling_call_i32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] %c) #1 {
anatofuz
parents:
diff changeset
172 entry:
anatofuz
parents:
diff changeset
173 %ret = tail call fastcc i32 @i32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] %c)
anatofuz
parents:
diff changeset
174 ret i32 %ret
anatofuz
parents:
diff changeset
175 }
anatofuz
parents:
diff changeset
176
anatofuz
parents:
diff changeset
177 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32_a32i32_stack_object:
anatofuz
parents:
diff changeset
178 ; GCN-DAG: v_mov_b32_e32 [[NINE:v[0-9]+]], 9
anatofuz
parents:
diff changeset
179 ; GCN: buffer_store_dword [[NINE]], off, s[0:3], s32 offset:40
anatofuz
parents:
diff changeset
180 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
181 define fastcc i32 @sibling_call_i32_fastcc_i32_i32_a32i32_stack_object(i32 %a, i32 %b, [32 x i32] %c) #1 {
anatofuz
parents:
diff changeset
182 entry:
anatofuz
parents:
diff changeset
183 %alloca = alloca [16 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
184 %gep = getelementptr inbounds [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 5
anatofuz
parents:
diff changeset
185 store volatile i32 9, i32 addrspace(5)* %gep
anatofuz
parents:
diff changeset
186 %ret = tail call fastcc i32 @i32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] %c)
anatofuz
parents:
diff changeset
187 ret i32 %ret
anatofuz
parents:
diff changeset
188 }
anatofuz
parents:
diff changeset
189
anatofuz
parents:
diff changeset
190 ; If the callee requires more stack argument space than the caller,
anatofuz
parents:
diff changeset
191 ; don't do a tail call.
anatofuz
parents:
diff changeset
192 ; TODO: Do we really need this restriction?
anatofuz
parents:
diff changeset
193
anatofuz
parents:
diff changeset
194 ; GCN-LABEL: {{^}}no_sibling_call_callee_more_stack_space:
anatofuz
parents:
diff changeset
195 ; GCN: s_swappc_b64
anatofuz
parents:
diff changeset
196 ; GCN: s_setpc_b64
anatofuz
parents:
diff changeset
197 define fastcc i32 @no_sibling_call_callee_more_stack_space(i32 %a, i32 %b) #1 {
anatofuz
parents:
diff changeset
198 entry:
anatofuz
parents:
diff changeset
199 %ret = tail call fastcc i32 @i32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] zeroinitializer)
anatofuz
parents:
diff changeset
200 ret i32 %ret
anatofuz
parents:
diff changeset
201 }
anatofuz
parents:
diff changeset
202
anatofuz
parents:
diff changeset
203 ; Have another non-tail in the function
anatofuz
parents:
diff changeset
204 ; GCN-LABEL: {{^}}sibling_call_i32_fastcc_i32_i32_other_call:
anatofuz
parents:
diff changeset
205 ; GCN: s_or_saveexec_b64 s{{\[[0-9]+:[0-9]+\]}}, -1
anatofuz
parents:
diff changeset
206 ; GCN-NEXT: buffer_store_dword v34, off, s[0:3], s32 offset:8 ; 4-byte Folded Spill
anatofuz
parents:
diff changeset
207 ; GCN-NEXT: s_mov_b64 exec
anatofuz
parents:
diff changeset
208 ; GCN: s_mov_b32 s34, s32
anatofuz
parents:
diff changeset
209 ; GCN-DAG: s_add_u32 s32, s32, 0x400
anatofuz
parents:
diff changeset
210
anatofuz
parents:
diff changeset
211 ; GCN-DAG: buffer_store_dword v32, off, s[0:3], s34 offset:4 ; 4-byte Folded Spill
anatofuz
parents:
diff changeset
212 ; GCN-DAG: buffer_store_dword v33, off, s[0:3], s34 ; 4-byte Folded Spill
anatofuz
parents:
diff changeset
213 ; GCN-DAG: v_writelane_b32 v34, s36, 0
anatofuz
parents:
diff changeset
214 ; GCN-DAG: v_writelane_b32 v34, s37, 1
anatofuz
parents:
diff changeset
215
anatofuz
parents:
diff changeset
216 ; GCN-DAG: s_getpc_b64 s[4:5]
anatofuz
parents:
diff changeset
217 ; GCN-DAG: s_add_u32 s4, s4, i32_fastcc_i32_i32@gotpcrel32@lo+4
anatofuz
parents:
diff changeset
218 ; GCN-DAG: s_addc_u32 s5, s5, i32_fastcc_i32_i32@gotpcrel32@hi+4
anatofuz
parents:
diff changeset
219
anatofuz
parents:
diff changeset
220
anatofuz
parents:
diff changeset
221 ; GCN: s_swappc_b64
anatofuz
parents:
diff changeset
222
anatofuz
parents:
diff changeset
223 ; GCN-DAG: v_readlane_b32 s36, v34, 0
anatofuz
parents:
diff changeset
224 ; GCN-DAG: v_readlane_b32 s37, v34, 1
anatofuz
parents:
diff changeset
225
anatofuz
parents:
diff changeset
226 ; GCN: buffer_load_dword v33, off, s[0:3], s34 ; 4-byte Folded Reload
anatofuz
parents:
diff changeset
227 ; GCN: buffer_load_dword v32, off, s[0:3], s34 offset:4 ; 4-byte Folded Reload
anatofuz
parents:
diff changeset
228
anatofuz
parents:
diff changeset
229 ; GCN: s_getpc_b64 s[4:5]
anatofuz
parents:
diff changeset
230 ; GCN-NEXT: s_add_u32 s4, s4, sibling_call_i32_fastcc_i32_i32@rel32@lo+4
anatofuz
parents:
diff changeset
231 ; GCN-NEXT: s_addc_u32 s5, s5, sibling_call_i32_fastcc_i32_i32@rel32@hi+4
anatofuz
parents:
diff changeset
232
anatofuz
parents:
diff changeset
233 ; GCN: s_sub_u32 s32, s32, 0x400
anatofuz
parents:
diff changeset
234 ; GCN-NEXT: v_readlane_b32 s34,
anatofuz
parents:
diff changeset
235 ; GCN-NEXT: s_or_saveexec_b64 s[6:7], -1
anatofuz
parents:
diff changeset
236 ; GCN-NEXT: buffer_load_dword v34, off, s[0:3], s32 offset:8 ; 4-byte Folded Reload
anatofuz
parents:
diff changeset
237 ; GCN-NEXT: s_mov_b64 exec, s[6:7]
anatofuz
parents:
diff changeset
238 ; GCN-NEXT: s_setpc_b64 s[4:5]
anatofuz
parents:
diff changeset
239 define fastcc i32 @sibling_call_i32_fastcc_i32_i32_other_call(i32 %a, i32 %b, i32 %c) #1 {
anatofuz
parents:
diff changeset
240 entry:
anatofuz
parents:
diff changeset
241 %other.call = tail call fastcc i32 @i32_fastcc_i32_i32(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
242 %ret = tail call fastcc i32 @sibling_call_i32_fastcc_i32_i32(i32 %a, i32 %b, i32 %other.call)
anatofuz
parents:
diff changeset
243 ret i32 %ret
anatofuz
parents:
diff changeset
244 }
anatofuz
parents:
diff changeset
245
anatofuz
parents:
diff changeset
246 ; Have stack object in caller and stack passed arguments. SP should be
anatofuz
parents:
diff changeset
247 ; in same place at function exit.
anatofuz
parents:
diff changeset
248
anatofuz
parents:
diff changeset
249 ; GCN-LABEL: {{^}}sibling_call_stack_objecti32_fastcc_i32_i32_a32i32:
anatofuz
parents:
diff changeset
250 ; GCN-NOT: s33
anatofuz
parents:
diff changeset
251 ; GCN: buffer_store_dword v{{[0-9]+}}, off, s[0:3], s32 offset:
anatofuz
parents:
diff changeset
252
anatofuz
parents:
diff changeset
253 ; GCN-NOT: s33
anatofuz
parents:
diff changeset
254
anatofuz
parents:
diff changeset
255 ; GCN: buffer_load_dword v{{[0-9]+}}, off, s[0:3], s32 offset:
anatofuz
parents:
diff changeset
256 ; GCN: s_setpc_b64 s[4:5]
anatofuz
parents:
diff changeset
257 define fastcc i32 @sibling_call_stack_objecti32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] %c) #1 {
anatofuz
parents:
diff changeset
258 entry:
anatofuz
parents:
diff changeset
259 %alloca = alloca [16 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
260 %gep = getelementptr inbounds [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 5
anatofuz
parents:
diff changeset
261 store volatile i32 9, i32 addrspace(5)* %gep
anatofuz
parents:
diff changeset
262 %ret = tail call fastcc i32 @i32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] %c)
anatofuz
parents:
diff changeset
263 ret i32 %ret
anatofuz
parents:
diff changeset
264 }
anatofuz
parents:
diff changeset
265
anatofuz
parents:
diff changeset
266 ; GCN-LABEL: {{^}}sibling_call_stack_objecti32_fastcc_i32_i32_a32i32_larger_arg_area:
anatofuz
parents:
diff changeset
267 ; GCN-NOT: s33
anatofuz
parents:
diff changeset
268 ; GCN: buffer_store_dword v{{[0-9]+}}, off, s[0:3], s32 offset:44
anatofuz
parents:
diff changeset
269
anatofuz
parents:
diff changeset
270 ; GCN-NOT: s33
anatofuz
parents:
diff changeset
271 ; GCN: s_setpc_b64 s[4:5]
anatofuz
parents:
diff changeset
272 define fastcc i32 @sibling_call_stack_objecti32_fastcc_i32_i32_a32i32_larger_arg_area(i32 %a, i32 %b, [36 x i32] %c) #1 {
anatofuz
parents:
diff changeset
273 entry:
anatofuz
parents:
diff changeset
274 %alloca = alloca [16 x i32], align 4, addrspace(5)
anatofuz
parents:
diff changeset
275 %gep = getelementptr inbounds [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 5
anatofuz
parents:
diff changeset
276 store volatile i32 9, i32 addrspace(5)* %gep
anatofuz
parents:
diff changeset
277 %ret = tail call fastcc i32 @i32_fastcc_i32_i32_a32i32(i32 %a, i32 %b, [32 x i32] zeroinitializer)
anatofuz
parents:
diff changeset
278 ret i32 %ret
anatofuz
parents:
diff changeset
279 }
anatofuz
parents:
diff changeset
280
anatofuz
parents:
diff changeset
281 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
282 attributes #1 = { nounwind noinline }