File: multi_md.ll

package info (click to toggle)
spirv-llvm-translator-14 14.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,640 kB
  • sloc: cpp: 47,664; lisp: 3,704; sh: 153; python: 43; makefile: 33
file content (87 lines) | stat: -rw-r--r-- 3,704 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
; Check duplicate operands in opencl.ocl.version metadata is accepted without
; assertion.

; RUN: llvm-as %s -o %t.bc
; RUN: llvm-spirv %t.bc -spirv-text -o %t
; RUN: FileCheck < %t %s
; RUN: llvm-spirv %t.bc -o %t.spv
; RUN: spirv-val %t.spv

; ModuleID = 'clver.bc'
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir64-unknown-unknown"

%struct.my_struct_t = type { i8, i32 }

@var = addrspace(1) global %struct.my_struct_t { i8 97, i32 42 }, align 4

; Function Attrs: nounwind
define spir_kernel void @__OpenCL_writer_kernel(i8 zeroext %c, i32 %i) #0 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !4 !kernel_arg_type_qual !5 {
entry:
  %c.addr = alloca i8, align 1
  %i.addr = alloca i32, align 4
  store i8 %c, i8* %c.addr, align 1, !tbaa !14
  store i32 %i, i32* %i.addr, align 4, !tbaa !17
  %0 = load i8, i8* %c.addr, align 1, !tbaa !14
  store i8 %0, i8 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 0), align 1, !tbaa !19
  %1 = load i32, i32* %i.addr, align 4, !tbaa !17
  store i32 %1, i32 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 1), align 4, !tbaa !21
  ret void
}

; Function Attrs: nounwind
define spir_kernel void @__OpenCL_reader_kernel(i8 addrspace(1)* %C, i32 addrspace(1)* %I) #0 !kernel_arg_addr_space !8 !kernel_arg_access_qual !2 !kernel_arg_type !9 !kernel_arg_base_type !10 !kernel_arg_type_qual !5 {
entry:
  %C.addr = alloca i8 addrspace(1)*, align 8
  %I.addr = alloca i32 addrspace(1)*, align 8
  store i8 addrspace(1)* %C, i8 addrspace(1)** %C.addr, align 8, !tbaa !22
  store i32 addrspace(1)* %I, i32 addrspace(1)** %I.addr, align 8, !tbaa !22
  %0 = load i8, i8 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 0), align 1, !tbaa !19
  %1 = load i8 addrspace(1)*, i8 addrspace(1)** %C.addr, align 8, !tbaa !22
  store i8 %0, i8 addrspace(1)* %1, align 1, !tbaa !14
  %2 = load i32, i32 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 1), align 4, !tbaa !21
  %3 = load i32 addrspace(1)*, i32 addrspace(1)** %I.addr, align 8, !tbaa !22
  store i32 %2, i32 addrspace(1)* %3, align 4, !tbaa !17
  ret void
}

attributes #0 = { nounwind }

; "cl_images" should be encoded as BasicImage capability,
; but images are not used in this test case, so this capability is not required.
; CHECK-NOT: 4 Extension "cl_images"
; CHECK-DAG: 8 SourceExtension "cl_khr_int64_base_atomics"
; CHECK-DAG: 9 SourceExtension "cl_khr_int64_extended_atomics"
; CHECK: 3 Source 3 200000

!opencl.enable.FP_CONTRACT = !{}
!llvm.ident = !{!12, !12}
!opencl.ocl.version = !{!13, !13}
!opencl.spir.version = !{!13, !13}
!opencl.used.extensions = !{!24, !25}
!opencl.used.optional.core.features = !{!26, !27}

!1 = !{i32 0, i32 0}
!2 = !{!"none", !"none"}
!3 = !{!"uchar", !"uint"}
!4 = !{!"uchar", !"uint"}
!5 = !{!"", !""}
!8 = !{i32 1, i32 1}
!9 = !{!"uchar*", !"uint*"}
!10 = !{!"uchar*", !"uint*"}
!12 = !{!"clang version 3.6 (tags/RELEASE_361/rc1)"}
!13 = !{i32 2, i32 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"omnipotent char", !16, i64 0}
!16 = !{!"Simple C/C++ TBAA"}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !15, i64 0}
!19 = !{!20, !15, i64 0}
!20 = !{!"", !15, i64 0, !18, i64 4}
!21 = !{!20, !18, i64 4}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !15, i64 0}
!24 = !{!"cl_khr_int64_base_atomics"}
!25 = !{!"cl_khr_int64_base_atomics", !"cl_khr_int64_extended_atomics"}
!26 = !{!"cl_images"}
!27 = !{!""}