Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/transcoding/check_wo_qualifier.ll

raw
1 ; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: spirv-val %t.spv
4 ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
5 ; RUN: llvm-dis -opaque-pointers=0 < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
6
7 ; CHECK-LLVM: opencl.image2d_array_wo_t = type opaque
8 ; CHECK-LLVM: define spir_kernel void @sample_kernel(%opencl.image2d_array_wo_t addrspace(1)
9 ; CHECK-LLVM-SAME: !kernel_arg_access_qual [[AQ:![0-9]+]]
10 ; CHECK-LLVM-SAME: !kernel_arg_type [[TYPE:![0-9]+]]
11 ; CHECK-LLVM-SAME: !kernel_arg_base_type [[TYPE]]
12
13 ; CHECK-LLVM: call spir_func <2 x i32> @_Z13get_image_dim20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)
14 ; CHECK-LLVM: call spir_func i64 @_Z20get_image_array_size20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)
15 ; CHECK-LLVM: declare spir_func <2 x i32> @_Z13get_image_dim20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)
16 ; CHECK-LLVM: declare spir_func i64 @_Z20get_image_array_size20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)
17 ; CHECK-LLVM-DAG: [[AQ]] = !{!"write_only"}
18 ; CHECK-LLVM-DAG: [[TYPE]] = !{!"image2d_array_t"}
19
20 ; ModuleID = 'out.ll'
21 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
22 target triple = "spir64-unknown-unknown"
23
24 %opencl.image2d_array_wo_t = type opaque
25
26 ; Function Attrs: nounwind
27 define spir_kernel void @sample_kernel(%opencl.image2d_array_wo_t addrspace(1)* %input) #0 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !5 !kernel_arg_type_qual !4 {
28 entry:
29 %call.tmp1 = call spir_func <2 x i32> @_Z13get_image_dim20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)* %input)
30 %call.tmp2 = shufflevector <2 x i32> %call.tmp1, <2 x i32> undef, <3 x i32> <i32 0, i32 1, i32 2>
31 %call.tmp3 = call spir_func i64 @_Z20get_image_array_size20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)* %input)
32 %call.tmp4 = trunc i64 %call.tmp3 to i32
33 %call.tmp5 = insertelement <3 x i32> %call.tmp2, i32 %call.tmp4, i32 2
34 %call.old = extractelement <3 x i32> %call.tmp5, i32 0
35 ret void
36 }
37
38 ; Function Attrs: nounwind
39 declare spir_func <2 x i32> @_Z13get_image_dim20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)*) #0
40
41 ; Function Attrs: nounwind
42 declare spir_func i64 @_Z20get_image_array_size20ocl_image2d_array_wo(%opencl.image2d_array_wo_t addrspace(1)*) #0
43
44 attributes #0 = { nounwind }
45
46 !opencl.enable.FP_CONTRACT = !{}
47 !spirv.Source = !{!6}
48 !opencl.spir.version = !{!7}
49 !opencl.ocl.version = !{!7}
50 !opencl.used.extensions = !{!8}
51 !opencl.used.optional.core.features = !{!9}
52 !spirv.Generator = !{!10}
53
54 !1 = !{i32 1}
55 !2 = !{!"write_only"}
56 !3 = !{!"image2d_array_t"}
57 !4 = !{!""}
58 !5 = !{!"image2d_array_t"}
59 !6 = !{i32 3, i32 102000}
60 !7 = !{i32 1, i32 2}
61 !8 = !{}
62 !9 = !{!"cl_images"}
63 !10 = !{i16 6, i16 14}