Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/image-user-sampler-args.ll

raw
1 ; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2 ; RUN: llvm-spirv -opaque-pointers=0 %t.bc
3 ; RUN: spirv-val %t.spv
4
5 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
6 target triple = "spirv64"
7
8 %opencl.image2d_ro_t = type opaque
9 %opencl.sampler_t = type opaque
10
11 define internal spir_func <4 x float> @user_fn(%opencl.image2d_ro_t addrspace(1)* %I, %opencl.sampler_t addrspace(2)* %S, <2 x float> %Pos) {
12 entry:
13 %call = tail call spir_func <4 x float> @_Z11read_imagef14ocl_image2d_ro11ocl_samplerDv2_f(%opencl.image2d_ro_t addrspace(1)* %I, %opencl.sampler_t addrspace(2)* %S, <2 x float> noundef %Pos) #0
14 ret <4 x float> %call
15 }
16
17 declare spir_func <4 x float> @_Z11read_imagef14ocl_image2d_ro11ocl_samplerDv2_f(%opencl.image2d_ro_t addrspace(1)*, %opencl.sampler_t addrspace(2)*, <2 x float>) local_unnamed_addr
18
19 define hidden spir_kernel void @kernel_fn(float addrspace(1)* %0, %opencl.image2d_ro_t addrspace(1)* %1, %opencl.sampler_t addrspace(2)* %2, i32 %3, i32 %4) local_unnamed_addr {
20 entry:
21 %5 = call spir_func <4 x float> @user_fn(%opencl.image2d_ro_t addrspace(1)* %1, %opencl.sampler_t addrspace(2)* %2, <2 x float> undef)
22 %add16 = add nsw i32 undef, undef
23 ret void
24 }
25
26 attributes #0 = { convergent nounwind readonly willreturn }
27
28 !opencl.ocl.version = !{!0}
29
30 !0 = !{i32 2, i32 0}