1 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
3 ; CHECK-SPIRV: %[[#IntTy:]] = OpTypeInt
4 ; CHECK-SPIRV: %[[#IVecTy:]] = OpTypeVector %[[#IntTy]]
5 ; CHECK-SPIRV: %[[#FloatTy:]] = OpTypeFloat
6 ; CHECK-SPIRV: %[[#FVecTy:]] = OpTypeVector %[[#FloatTy]]
7 ; CHECK-SPIRV: OpImageRead %[[#IVecTy]]
8 ; CHECK-SPIRV: OpImageRead %[[#FVecTy]]
10 ;; __kernel void kernelA(__read_only image3d_t input) {
11 ;; uint4 c = read_imageui(input, (int4)(0, 0, 0, 0));
14 ;; __kernel void kernelB(__read_only image3d_t input) {
15 ;; float4 f = read_imagef(input, (int4)(0, 0, 0, 0));
18 define dso_local spir_kernel void @kernelA(target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %input) {
20 %input.addr = alloca target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0), align 8
21 %c = alloca <4 x i32>, align 16
22 %.compoundliteral = alloca <4 x i32>, align 16
23 store target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %input, ptr %input.addr, align 8
24 %0 = load target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0), ptr %input.addr, align 8
25 store <4 x i32> zeroinitializer, ptr %.compoundliteral, align 16
26 %1 = load <4 x i32>, ptr %.compoundliteral, align 16
27 %call = call spir_func <4 x i32> @_Z12read_imageui14ocl_image3d_roDv4_i(target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %0, <4 x i32> noundef %1)
28 store <4 x i32> %call, ptr %c, align 16
32 declare spir_func <4 x i32> @_Z12read_imageui14ocl_image3d_roDv4_i(target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %0, <4 x i32> noundef %1)
34 define dso_local spir_kernel void @kernelB(target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %input) {
36 %input.addr = alloca target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0), align 8
37 %f = alloca <4 x float>, align 16
38 %.compoundliteral = alloca <4 x i32>, align 16
39 store target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %input, ptr %input.addr, align 8
40 %0 = load target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0), ptr %input.addr, align 8
41 store <4 x i32> zeroinitializer, ptr %.compoundliteral, align 16
42 %1 = load <4 x i32>, ptr %.compoundliteral, align 16
43 %call = call spir_func <4 x float> @_Z11read_imagef14ocl_image3d_roDv4_i(target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %0, <4 x i32> noundef %1)
44 store <4 x float> %call, ptr %f, align 16
48 declare spir_func <4 x float> @_Z11read_imagef14ocl_image3d_roDv4_i(target("spirv.Image", void, 2, 0, 0, 0, 0, 0, 0) %0, <4 x i32> noundef %1)