• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llvm-as < %s | llvm-spirv -spirv-text -o %t
2; RUN: FileCheck < %t %s
3
4; CHECK-DAG: 10 TypeImage {{[0-9]*}} 6 1 0 0 0 0 0 0
5; CHECK-DAG: 10 TypeImage {{[0-9]*}} 6 1 0 0 0 0 0 1
6; CHECK-NOT: 10 TypeImage {{[0-9]*}} 6 1 0 0 0 0 0 0
7
8; ModuleID = 'image.bc'
9target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
10target triple = "spir64-unknown-unknown"
11
12%opencl.image2d_t = type opaque
13
14; Function Attrs: nounwind
15define spir_kernel void @image_copy(%opencl.image2d_t addrspace(1)* readnone %image1, %opencl.image2d_t addrspace(1)* %image2) #0 {
16entry:
17  %call = tail call spir_func i64 @_Z13get_global_idj(i32 0) #3
18  %conv = trunc i64 %call to i32
19  %call1 = tail call spir_func i64 @_Z13get_global_idj(i32 1) #3
20  %conv2 = trunc i64 %call1 to i32
21  %vecinit = insertelement <2 x i32> undef, i32 %conv, i32 0
22  %vecinit3 = insertelement <2 x i32> %vecinit, i32 %conv2, i32 1
23  %call4 = tail call spir_func <4 x float> @_Z11read_imagef11ocl_image2d11ocl_samplerDv2_i(%opencl.image2d_t addrspace(1)* %image1, i32 20, <2 x i32> %vecinit3) #3
24  tail call spir_func void @_Z12write_imagef11ocl_image2dDv2_iDv4_f(%opencl.image2d_t addrspace(1)* %image2, <2 x i32> %vecinit3, <4 x float> %call4) #4
25  ret void
26}
27
28; Function Attrs: nounwind readnone
29declare spir_func i64 @_Z13get_global_idj(i32) #1
30
31; Function Attrs: nounwind readnone
32declare spir_func <4 x float> @_Z11read_imagef11ocl_image2d11ocl_samplerDv2_i(%opencl.image2d_t addrspace(1)*, i32, <2 x i32>) #1
33
34declare spir_func void @_Z12write_imagef11ocl_image2dDv2_iDv4_f(%opencl.image2d_t addrspace(1)*, <2 x i32>, <4 x float>) #2
35
36attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
37attributes #1 = { nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
38attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
39attributes #3 = { nounwind readnone }
40attributes #4 = { nounwind }
41
42!opencl.kernels = !{!0}
43!opencl.enable.FP_CONTRACT = !{}
44!opencl.spir.version = !{!6}
45!opencl.ocl.version = !{!6}
46!opencl.used.extensions = !{!7}
47!opencl.used.optional.core.features = !{!8}
48!opencl.compiler.options = !{!7}
49!llvm.ident = !{!9}
50
51!0 = !{void (%opencl.image2d_t addrspace(1)*, %opencl.image2d_t addrspace(1)*)* @image_copy, !1, !2, !3, !4, !5}
52!1 = !{!"kernel_arg_addr_space", i32 1, i32 1}
53!2 = !{!"kernel_arg_access_qual", !"read_only", !"write_only"}
54!3 = !{!"kernel_arg_type", !"image2d_t", !"image2d_t"}
55!4 = !{!"kernel_arg_type_qual", !"", !""}
56!5 = !{!"kernel_arg_base_type", !"image2d_t", !"image2d_t"}
57!6 = !{i32 2, i32 0}
58!7 = !{}
59!8 = !{!"cl_images"}
60!9 = !{!"clang version 3.4 "}
61