1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib %s | FileCheck %s
4 ; Make sure we can produce a valid FunctionType for the expected
5 ; signature of image functions.
7 define i32 @test_get_image_width_ro_image1d_t(ptr addrspace(4) readnone %img) {
8 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image1d_t(
9 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
10 ; CHECK-NEXT: [[ENTRY:.*:]]
11 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image1d_ro(ptr addrspace(4) [[IMG]])
12 ; CHECK-NEXT: ret i32 [[CALL]]
15 %call = tail call i32 @_Z15get_image_width14ocl_image1d_ro(ptr addrspace(4) %img)
19 declare i32 @_Z15get_image_width14ocl_image1d_ro(ptr addrspace(4)) #1
21 define i32 @test_get_image_width_wo_image1d_t(ptr addrspace(4) readnone %img) {
22 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image1d_t(
23 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
24 ; CHECK-NEXT: [[ENTRY:.*:]]
25 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image1d_wo(ptr addrspace(4) [[IMG]])
26 ; CHECK-NEXT: ret i32 [[CALL]]
29 %call = tail call i32 @_Z15get_image_width14ocl_image1d_wo(ptr addrspace(4) %img)
33 declare i32 @_Z15get_image_width14ocl_image1d_wo(ptr addrspace(4)) #1
35 define i32 @test_get_image_width_rw_image1d_t(ptr addrspace(4) readnone %img) {
36 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image1d_t(
37 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
38 ; CHECK-NEXT: [[ENTRY:.*:]]
39 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image1d_rw(ptr addrspace(4) [[IMG]])
40 ; CHECK-NEXT: ret i32 [[CALL]]
43 %call = tail call i32 @_Z15get_image_width14ocl_image1d_rw(ptr addrspace(4) %img)
47 declare i32 @_Z15get_image_width14ocl_image1d_rw(ptr addrspace(4)) #1
49 define i32 @test_get_image_width_ro_image1d_buffer_t(ptr addrspace(4) readnone %img) {
50 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image1d_buffer_t(
51 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
52 ; CHECK-NEXT: [[ENTRY:.*:]]
53 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_ro(ptr addrspace(4) [[IMG]])
54 ; CHECK-NEXT: ret i32 [[CALL]]
57 %call = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_ro(ptr addrspace(4) %img)
61 declare i32 @_Z15get_image_width21ocl_image1d_buffer_ro(ptr addrspace(4)) #1
63 define i32 @test_get_image_width_wo_image1d_buffer_t(ptr addrspace(4) readnone %img) {
64 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image1d_buffer_t(
65 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
66 ; CHECK-NEXT: [[ENTRY:.*:]]
67 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_wo(ptr addrspace(4) [[IMG]])
68 ; CHECK-NEXT: ret i32 [[CALL]]
71 %call = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_wo(ptr addrspace(4) %img)
75 declare i32 @_Z15get_image_width21ocl_image1d_buffer_wo(ptr addrspace(4)) #1
77 define i32 @test_get_image_width_rw_image1d_buffer_t(ptr addrspace(4) readnone %img) {
78 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image1d_buffer_t(
79 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
80 ; CHECK-NEXT: [[ENTRY:.*:]]
81 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_rw(ptr addrspace(4) [[IMG]])
82 ; CHECK-NEXT: ret i32 [[CALL]]
85 %call = tail call i32 @_Z15get_image_width21ocl_image1d_buffer_rw(ptr addrspace(4) %img)
89 declare i32 @_Z15get_image_width21ocl_image1d_buffer_rw(ptr addrspace(4)) #1
91 define i32 @test_get_image_width_ro_image2d_t(ptr addrspace(4) readnone %img) {
92 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_t(
93 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
94 ; CHECK-NEXT: [[ENTRY:.*:]]
95 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image2d_ro(ptr addrspace(4) [[IMG]])
96 ; CHECK-NEXT: ret i32 [[CALL]]
99 %call = tail call i32 @_Z15get_image_width14ocl_image2d_ro(ptr addrspace(4) %img)
103 declare i32 @_Z15get_image_width14ocl_image2d_ro(ptr addrspace(4)) #1
105 define i32 @test_get_image_width_wo_image2d_t(ptr addrspace(4) readnone %img) {
106 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_t(
107 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
108 ; CHECK-NEXT: [[ENTRY:.*:]]
109 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image2d_wo(ptr addrspace(4) [[IMG]])
110 ; CHECK-NEXT: ret i32 [[CALL]]
113 %call = tail call i32 @_Z15get_image_width14ocl_image2d_wo(ptr addrspace(4) %img)
117 declare i32 @_Z15get_image_width14ocl_image2d_wo(ptr addrspace(4)) #1
119 define i32 @test_get_image_width_rw_image2d_t(ptr addrspace(4) readnone %img) {
120 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_t(
121 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
122 ; CHECK-NEXT: [[ENTRY:.*:]]
123 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image2d_rw(ptr addrspace(4) [[IMG]])
124 ; CHECK-NEXT: ret i32 [[CALL]]
127 %call = tail call i32 @_Z15get_image_width14ocl_image2d_rw(ptr addrspace(4) %img)
131 declare i32 @_Z15get_image_width14ocl_image2d_rw(ptr addrspace(4)) #1
133 define i32 @test_get_image_width_ro_image3d_t(ptr addrspace(4) readnone %img) {
134 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image3d_t(
135 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
136 ; CHECK-NEXT: [[ENTRY:.*:]]
137 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image3d_ro(ptr addrspace(4) [[IMG]])
138 ; CHECK-NEXT: ret i32 [[CALL]]
141 %call = tail call i32 @_Z15get_image_width14ocl_image3d_ro(ptr addrspace(4) %img)
145 declare i32 @_Z15get_image_width14ocl_image3d_ro(ptr addrspace(4)) #1
147 define i32 @test_get_image_width_wo_image3d_t(ptr addrspace(4) readnone %img) {
148 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image3d_t(
149 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
150 ; CHECK-NEXT: [[ENTRY:.*:]]
151 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image3d_wo(ptr addrspace(4) [[IMG]])
152 ; CHECK-NEXT: ret i32 [[CALL]]
155 %call = tail call i32 @_Z15get_image_width14ocl_image3d_wo(ptr addrspace(4) %img)
159 declare i32 @_Z15get_image_width14ocl_image3d_wo(ptr addrspace(4)) #1
161 define i32 @test_get_image_width_rw_image3d_t(ptr addrspace(4) readnone %img) {
162 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image3d_t(
163 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
164 ; CHECK-NEXT: [[ENTRY:.*:]]
165 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width14ocl_image3d_rw(ptr addrspace(4) [[IMG]])
166 ; CHECK-NEXT: ret i32 [[CALL]]
169 %call = tail call i32 @_Z15get_image_width14ocl_image3d_rw(ptr addrspace(4) %img)
173 declare i32 @_Z15get_image_width14ocl_image3d_rw(ptr addrspace(4)) #1
175 define i32 @test_get_image_width_ro_image1d_array_t(ptr addrspace(4) readnone %img) {
176 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image1d_array_t(
177 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
178 ; CHECK-NEXT: [[ENTRY:.*:]]
179 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image1d_array_ro(ptr addrspace(4) [[IMG]])
180 ; CHECK-NEXT: ret i32 [[CALL]]
183 %call = tail call i32 @_Z15get_image_width20ocl_image1d_array_ro(ptr addrspace(4) %img)
187 declare i32 @_Z15get_image_width20ocl_image1d_array_ro(ptr addrspace(4)) #1
189 define i32 @test_get_image_width_wo_image1d_array_t(ptr addrspace(4) readnone %img) {
190 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image1d_array_t(
191 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
192 ; CHECK-NEXT: [[ENTRY:.*:]]
193 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image1d_array_wo(ptr addrspace(4) [[IMG]])
194 ; CHECK-NEXT: ret i32 [[CALL]]
197 %call = tail call i32 @_Z15get_image_width20ocl_image1d_array_wo(ptr addrspace(4) %img)
201 declare i32 @_Z15get_image_width20ocl_image1d_array_wo(ptr addrspace(4)) #1
203 define i32 @test_get_image_width_rw_image1d_array_t(ptr addrspace(4) readnone %img) {
204 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image1d_array_t(
205 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
206 ; CHECK-NEXT: [[ENTRY:.*:]]
207 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image1d_array_rw(ptr addrspace(4) [[IMG]])
208 ; CHECK-NEXT: ret i32 [[CALL]]
211 %call = tail call i32 @_Z15get_image_width20ocl_image1d_array_rw(ptr addrspace(4) %img)
215 declare i32 @_Z15get_image_width20ocl_image1d_array_rw(ptr addrspace(4)) #1
217 define i32 @test_get_image_width_ro_image2d_array_t(ptr addrspace(4) readnone %img) {
218 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_array_t(
219 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
220 ; CHECK-NEXT: [[ENTRY:.*:]]
221 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_array_ro(ptr addrspace(4) [[IMG]])
222 ; CHECK-NEXT: ret i32 [[CALL]]
225 %call = tail call i32 @_Z15get_image_width20ocl_image2d_array_ro(ptr addrspace(4) %img)
229 declare i32 @_Z15get_image_width20ocl_image2d_array_ro(ptr addrspace(4)) #1
231 define i32 @test_get_image_width_wo_image2d_array_t(ptr addrspace(4) readnone %img) {
232 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_array_t(
233 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
234 ; CHECK-NEXT: [[ENTRY:.*:]]
235 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_array_wo(ptr addrspace(4) [[IMG]])
236 ; CHECK-NEXT: ret i32 [[CALL]]
239 %call = tail call i32 @_Z15get_image_width20ocl_image2d_array_wo(ptr addrspace(4) %img)
243 declare i32 @_Z15get_image_width20ocl_image2d_array_wo(ptr addrspace(4)) #1
245 define i32 @test_get_image_width_rw_image2d_array_t(ptr addrspace(4) readnone %img) {
246 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_array_t(
247 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
248 ; CHECK-NEXT: [[ENTRY:.*:]]
249 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_array_rw(ptr addrspace(4) [[IMG]])
250 ; CHECK-NEXT: ret i32 [[CALL]]
253 %call = tail call i32 @_Z15get_image_width20ocl_image2d_array_rw(ptr addrspace(4) %img)
257 declare i32 @_Z15get_image_width20ocl_image2d_array_rw(ptr addrspace(4)) #1
259 define i32 @test_get_image_width_ro_image2d_depth_t(ptr addrspace(4) readnone %img) {
260 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_depth_t(
261 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
262 ; CHECK-NEXT: [[ENTRY:.*:]]
263 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_depth_ro(ptr addrspace(4) [[IMG]])
264 ; CHECK-NEXT: ret i32 [[CALL]]
267 %call = tail call i32 @_Z15get_image_width20ocl_image2d_depth_ro(ptr addrspace(4) %img)
271 declare i32 @_Z15get_image_width20ocl_image2d_depth_ro(ptr addrspace(4)) #1
273 define i32 @test_get_image_width_wo_image2d_depth_t(ptr addrspace(4) readnone %img) {
274 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_depth_t(
275 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
276 ; CHECK-NEXT: [[ENTRY:.*:]]
277 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_depth_wo(ptr addrspace(4) [[IMG]])
278 ; CHECK-NEXT: ret i32 [[CALL]]
281 %call = tail call i32 @_Z15get_image_width20ocl_image2d_depth_wo(ptr addrspace(4) %img)
285 declare i32 @_Z15get_image_width20ocl_image2d_depth_wo(ptr addrspace(4)) #1
287 define i32 @test_get_image_width_rw_image2d_depth_t(ptr addrspace(4) readnone %img) {
288 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_depth_t(
289 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
290 ; CHECK-NEXT: [[ENTRY:.*:]]
291 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width20ocl_image2d_depth_rw(ptr addrspace(4) [[IMG]])
292 ; CHECK-NEXT: ret i32 [[CALL]]
295 %call = tail call i32 @_Z15get_image_width20ocl_image2d_depth_rw(ptr addrspace(4) %img)
299 declare i32 @_Z15get_image_width20ocl_image2d_depth_rw(ptr addrspace(4)) #1
301 define i32 @test_get_image_width_ro_image2d_array_depth_t(ptr addrspace(4) readnone %img) {
302 ; CHECK-LABEL: define i32 @test_get_image_width_ro_image2d_array_depth_t(
303 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
304 ; CHECK-NEXT: [[ENTRY:.*:]]
305 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_ro(ptr addrspace(4) [[IMG]])
306 ; CHECK-NEXT: ret i32 [[CALL]]
309 %call = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_ro(ptr addrspace(4) %img)
313 declare i32 @_Z15get_image_width26ocl_image2d_array_depth_ro(ptr addrspace(4)) #1
315 define i32 @test_get_image_width_wo_image2d_array_depth_t(ptr addrspace(4) readnone %img) {
316 ; CHECK-LABEL: define i32 @test_get_image_width_wo_image2d_array_depth_t(
317 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
318 ; CHECK-NEXT: [[ENTRY:.*:]]
319 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_wo(ptr addrspace(4) [[IMG]])
320 ; CHECK-NEXT: ret i32 [[CALL]]
323 %call = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_wo(ptr addrspace(4) %img)
327 declare i32 @_Z15get_image_width26ocl_image2d_array_depth_wo(ptr addrspace(4)) #1
329 define i32 @test_get_image_width_rw_image2d_array_depth_t(ptr addrspace(4) readnone %img) {
330 ; CHECK-LABEL: define i32 @test_get_image_width_rw_image2d_array_depth_t(
331 ; CHECK-SAME: ptr addrspace(4) readnone [[IMG:%.*]]) {
332 ; CHECK-NEXT: [[ENTRY:.*:]]
333 ; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_rw(ptr addrspace(4) [[IMG]])
334 ; CHECK-NEXT: ret i32 [[CALL]]
337 %call = tail call i32 @_Z15get_image_width26ocl_image2d_array_depth_rw(ptr addrspace(4) %img)
341 declare i32 @_Z15get_image_width26ocl_image2d_array_depth_rw(ptr addrspace(4)) #1