Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/capbility-kernel.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -spirv-text -o %t
3 ; RUN: llvm-spirv %t.bc -o %t.spv
4 ; RUN: spirv-val %t.spv
5 ; RUN: FileCheck < %t %s
6
7 ; CHECK-DAG: {{[0-9]*}} Capability Addresses
8
9 ; ModuleID = 'capbility-kernel.bc'
10 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
11 target triple = "spir64-unknown-unknown"
12
13 ; CHECK-DAG: {{[0-9]*}} Capability Linkage
14 ; Function Attrs: nounwind
15 define spir_func void @func_export(i32 addrspace(1)* nocapture %a) #0 {
16 entry:
17 ; CHECK-DAG: {{[0-9]*}} Capability Int64
18 %call = tail call spir_func i64 @_Z13get_global_idj(i32 0) #3
19 %cmp = icmp eq i64 %call, 0
20 br i1 %cmp, label %if.then, label %if.end
21
22 if.then: ; preds = %entry
23 store i32 1, i32 addrspace(1)* %a, align 4, !tbaa !9
24 br label %if.end
25
26 if.end: ; preds = %if.then, %entry
27 ret void
28 }
29
30 ; Function Attrs: nounwind readnone
31 declare spir_func i64 @_Z13get_global_idj(i32) #1
32
33 ; CHECK-DAG: {{[0-9]*}} Capability Kernel
34 ; CHECK-NOT: {{[0-9]*}} Capability Shader
35 ; CHECK-NOT: {{[0-9]*}} Capability Float64
36 ; Function Attrs: nounwind
37 define spir_kernel void @func_kernel(i32 addrspace(1)* %a) #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 {
38 entry:
39 tail call spir_func void @func_import(i32 addrspace(1)* %a) #4
40 ret void
41 }
42
43 declare spir_func void @func_import(i32 addrspace(1)*) #2
44
45 attributes #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" }
46 attributes #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" }
47 attributes #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" }
48 attributes #3 = { nounwind readnone }
49 attributes #4 = { nounwind }
50
51 !opencl.enable.FP_CONTRACT = !{}
52 !opencl.spir.version = !{!6}
53 !opencl.ocl.version = !{!6}
54 !opencl.used.extensions = !{!7}
55 !opencl.used.optional.core.features = !{!7}
56 !opencl.compiler.options = !{!7}
57 !llvm.ident = !{!8}
58
59 !1 = !{i32 1}
60 !2 = !{!"none"}
61 !3 = !{!"int*"}
62 !4 = !{!""}
63 !5 = !{!"int*"}
64 !6 = !{i32 2, i32 0}
65 !7 = !{}
66 !8 = !{!"clang version 3.4 "}
67 !9 = !{!10, !10, i64 0}
68 !10 = !{!"int", !11, i64 0}
69 !11 = !{!"omnipotent char", !12, i64 0}
70 !12 = !{!"Simple C/C++ TBAA"}