Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/NonSemantic/Shader200/DebugInfoSubrange.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv -spirv-text %t.bc -o %t.spt --spirv-debug-info-version=nonsemantic-shader-200
3 ; RUN: FileCheck < %t.spt %s -check-prefix=CHECK-SPIRV
4 ; RUN: llvm-spirv -to-binary %t.spt -o %t.spv
5
6 ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
7 ; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
8 ; RUN: FileCheck < %t.rev.ll %s -check-prefix=CHECK-LLVM
9
10 ; CHECK-SPIRV: ExtInstImport [[#EISId:]] "NonSemantic.Shader.DebugInfo.200"
11
12 ; CHECK-SPIRV: String [[#LocalVarNameId:]] "A$1$upperbound"
13 ; CHECK-SPIRV-DAG: TypeInt [[#TyInt32Id:]] 32 0
14 ; CHECK-SPIRV-DAG: TypeInt [[#TyInt64Id:]] 64 0
15 ; CHECK-NOT: THIS LINE IS USED TO SEPARATE DAGs
16 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant15Id:]] 15{{[[:space:]]}}
17 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant24Id:]] 24{{[[:space:]]}}
18 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant25Id:]] 25{{[[:space:]]}}
19 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant27Id:]] 27{{[[:space:]]}}
20 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant33Id:]] 33{{[[:space:]]}}
21 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant34Id:]] 34{{[[:space:]]}}
22 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant67Id:]] 67{{[[:space:]]}}
23 ; CHECK-SPIRV-DAG: Constant [[#TyInt32Id]] [[#Constant68Id:]] 68{{[[:space:]]}}
24 ; CHECK-SPIRV-DAG: Constant [[#TyInt64Id]] [[#Constant1Id:]] 1 0
25 ; CHECK-SPIRV-DAG: Constant [[#TyInt64Id]] [[#Constant1000Id:]] 1000 0
26 ; CHECK-SPIRV: [[#DINoneId:]] [[#EISId]] DebugInfoNone
27
28 ; CHECK-SPIRV: [[#DebugFuncId:]] [[#EISId]] DebugFunction
29 ; CHECK-SPIRV: [[#LocalVarId:]] [[#EISId]] DebugLocalVariable [[#LocalVarNameId]] [[#]] [[#]] [[#]] [[#]] [[#DebugFuncId]]
30 ; CHECK-SPIRV: [[#DebugTypeTemplate:]] [[#EISId]] DebugTypeTemplate [[#DebugFuncId]]
31 ; CHECK-SPIRV: [[#EISId]] DebugTypeSubrange [[#Constant1Id]] [[#LocalVarId]] [[#DINoneId]] {{$}}
32
33 ; CHECK-SPIRV: [[#DIExprId:]] [[#EISId]] DebugExpression
34 ; CHECK-SPIRV: [[#EISId]] DebugTypeSubrange [[#DIExprId]] [[#DIExprId]] [[#DINoneId]] {{$}}
35
36 ; CHECK-SPIRV: [[#EISId]] DebugTypeSubrange [[#Constant1Id]] [[#DINoneId]] [[#Constant1000Id]] {{$}}
37
38 ; CHECK-SPIRV: [[#EISId]] DebugLine [[#]] [[#Constant15Id]] [[#Constant15Id]] [[#Constant67Id]] [[#Constant68Id]]
39 ; CHECK-SPIRV: [[#EISId]] DebugLine [[#]] [[#Constant27Id]] [[#Constant27Id]] [[#Constant24Id]] [[#Constant25Id]]
40 ; CHECK-SPIRV: [[#EISId]] DebugLine [[#]] [[#Constant34Id]] [[#Constant34Id]] [[#Constant33Id]] [[#Constant34Id]]
41
42 ; CHECK-LLVM: ![[#Scope_A:]] = distinct !DISubprogram(name: "random_fill_sp.DIR.OMP.TARGET.8.split.split.split.split"
43 ; CHECK-LLVM: [[#Subrange1:]] = !DISubrange(lowerBound: 1, upperBound: ![[#UpperBound:]])
44 ; CHECK-LLVM: [[#UpperBound]] = !DILocalVariable(name: "A$1$upperbound"
45 ; CHECK-LLVM: !DILocation(line: 15, column: 67, scope: ![[#Scope_A]]
46 ; CHECK-LLVM: ![[#Scope_B:]] = distinct !DISubprogram(name: "random_fill_sp.DIR.OMP.TARGET.8.split.split.split.split"
47 ; CHECK-LLVM: !DISubrange(lowerBound: !DIExpression(), upperBound: !DIExpression())
48 ; CHECK-LLVM: !DILocation(line: 15, column: 67, scope: ![[#Scope_B]]
49 ; CHECK-LLVM: ![[#Scope_C:]] = distinct !DISubprogram(name: "test_target_map_array_default_IP_test_array_map_no_map_type_.DIR.OMP.TARGET.340.split"
50 ; CHECK-LLVM: !DISubrange(count: 1000, lowerBound: 1)
51 ; CHECK-LLVM: !DILocation(line: 27, column: 24, scope: ![[#Scope_C]]
52 ; CHECK-LLVM: ![[#Scope_D:]] = distinct !DISubprogram(name: "test"
53 ; CHECK-LLVM: !DILocation(line: 34, column: 33, scope: ![[#Scope_D]]
54
55 ; ModuleID = 'DebugInfoSubrangeUpperBound.bc'
56 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"
57 target triple = "spir64-unknown-unknown"
58
59 %structtype = type { [72 x i1] }
60 %"QNCA_a0$float" = type { float addrspace(4)*, i64, i64, i64, i64, i64, [1 x %structtype2] }
61 %structtype2 = type { i64, i64, i64 }
62
63 ; Function Attrs: noinline nounwind
64 define spir_kernel void @__omp_offloading_811_198142f_random_fill_sp_l25(i32 addrspace(1)* noalias %0, %structtype* byval(%structtype) %"ascast$val", [1000 x i32] addrspace(1)* noalias %"ascastB$val") #0 !kernel_arg_addr_space !9 !kernel_arg_access_qual !10 !kernel_arg_type !11 !kernel_arg_type_qual !12 !kernel_arg_base_type !11 {
65 newFuncRoot:
66 %.ascast = bitcast %structtype* %"ascast$val" to %"QNCA_a0$float"*
67 call void @llvm.dbg.value(metadata %"QNCA_a0$float"* %.ascast, metadata !13, metadata !DIExpression(DW_OP_deref)), !dbg !27
68 call void @llvm.dbg.value(metadata %"QNCA_a0$float"* %.ascast, metadata !28, metadata !DIExpression(DW_OP_deref)), !dbg !42
69 call void @llvm.dbg.value(metadata [1000 x i32] addrspace(1)* %"ascastB$val", metadata !47, metadata !DIExpression(DW_OP_deref)), !dbg !51
70 call void @llvm.dbg.value(metadata i32 addrspace(1)* %0, metadata !54, metadata !DIExpression(DW_OP_deref)), !dbg !59
71 ret void
72 }
73
74 ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
75 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
76
77 attributes #0 = { noinline nounwind }
78 attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }
79
80 !llvm.module.flags = !{!0, !1}
81 !llvm.dbg.cu = !{!2}
82 !spirv.MemoryModel = !{!4}
83 !opencl.enable.FP_CONTRACT = !{}
84 !spirv.Source = !{!5}
85 !opencl.spir.version = !{!6}
86 !opencl.ocl.version = !{!6}
87 !opencl.used.extensions = !{!7}
88 !opencl.used.optional.core.features = !{!7}
89 !spirv.Generator = !{!8}
90
91 !0 = !{i32 7, !"Dwarf Version", i32 4}
92 !1 = !{i32 2, !"Debug Info Version", i32 3}
93 !2 = distinct !DICompileUnit(language: DW_LANG_OpenCL, file: !3, producer: "Fortran", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
94 !3 = !DIFile(filename: "f.f90", directory: "Fortran")
95 !4 = !{i32 2, i32 2}
96 !5 = !{i32 4, i32 200000}
97 !6 = !{i32 2, i32 0}
98 !7 = !{}
99 !8 = !{i16 6, i16 14}
100 !9 = !{i32 0}
101 !10 = !{!"none"}
102 !11 = !{!"structtype"}
103 !12 = !{!""}
104 !13 = !DILocalVariable(name: "a", scope: !14, file: !3, line: 15, type: !18)
105 !14 = distinct !DISubprogram(name: "random_fill_sp.DIR.OMP.TARGET.8.split.split.split.split", scope: null, file: !3, line: 25, type: !15, scopeLine: 25, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, templateParams: !7, retainedNodes: !17)
106 !15 = !DISubroutineType(types: !16)
107 !16 = !{null}
108 !17 = !{!13}
109 !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64)
110 !19 = !DICompositeType(tag: DW_TAG_array_type, baseType: !20, size: 32, elements: !21)
111 !20 = !DIBasicType(name: "REAL*4", size: 32, encoding: DW_ATE_float)
112 !21 = !{!22}
113 !22 = !DISubrange(lowerBound: 1, upperBound: !23)
114 !23 = !DILocalVariable(name: "A$1$upperbound", scope: !24, type: !26, flags: DIFlagArtificial)
115 !24 = distinct !DISubprogram(name: "random_fill_sp", linkageName: "random_fill_sp", scope: null, file: !3, line: 15, type: !15, scopeLine: 15, spFlags: DISPFlagDefinition, unit: !2, templateParams: !7, retainedNodes: !25)
116 !25 = !{!23}
117 !26 = !DIBasicType(name: "INTEGER*8", size: 64, encoding: DW_ATE_signed)
118 !27 = !DILocation(line: 15, column: 67, scope: !14)
119 !28 = !DILocalVariable(name: "a", scope: !29, file: !3, line: 15, type: !33)
120 !29 = distinct !DISubprogram(name: "random_fill_sp.DIR.OMP.TARGET.8.split.split.split.split", scope: null, file: !3, line: 25, type: !30, scopeLine: 25, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, templateParams: !7, retainedNodes: !32)
121 !30 = !DISubroutineType(types: !31)
122 !31 = !{null}
123 !32 = !{!28}
124 !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !34, size: 64)
125 !34 = !DICompositeType(tag: DW_TAG_array_type, baseType: !35, size: 32, elements: !36)
126 !35 = !DIBasicType(name: "REAL*4", size: 32, encoding: DW_ATE_float)
127 !36 = !{!37}
128 !37 = !DISubrange(lowerBound: !DIExpression(), upperBound: !DIExpression())
129 !38 = !DILocalVariable(name: "A$1$upperbound", scope: !39, type: !41, flags: DIFlagArtificial)
130 !39 = distinct !DISubprogram(name: "random_fill_sp", linkageName: "random_fill_sp", scope: null, file: !3, line: 15, type: !30, scopeLine: 15, spFlags: DISPFlagDefinition, unit: !2, templateParams: !7, retainedNodes: !40)
131 !40 = !{!38}
132 !41 = !DIBasicType(name: "INTEGER*8", size: 64, encoding: DW_ATE_signed)
133 !42 = !DILocation(line: 15, column: 67, scope: !29)
134 !43 = !DIBasicType(name: "INTEGER*4", size: 32, encoding: DW_ATE_signed)
135 !44 = !{}
136 !45 = !DISubroutineType(types: !44)
137 !46 = distinct !DISubprogram(name: "test_target_map_array_default_IP_test_array_map_no_map_type_.DIR.OMP.TARGET.340.split", scope: !3, file: !3, line: 32, type: !45, scopeLine: 32, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2)
138 !47 = !DILocalVariable(name: "compute_array", scope: !46, file: !3, line: 27, type: !48)
139 !48 = !DICompositeType(tag: DW_TAG_array_type, baseType: !43, elements: !49)
140 !49 = !{!50}
141 !50 = !DISubrange(count: 1000, lowerBound: 1)
142 !51 = !DILocation(line: 27, column: 24, scope: !46)
143 !52 = distinct !DISubprogram(name: "test", scope: !3, file: !3, line: 51, type: !53, scopeLine: 51, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2)
144 !53 = !DISubroutineType(types: !7)
145 !54 = !DILocalVariable(name: "isHost", scope: !52, file: !3, line: 34, type: !55)
146 !55 = !DICompositeType(tag: DW_TAG_array_type, baseType: !56, elements: !57)
147 !56 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
148 !57 = !{!58}
149 !58 = !DISubrange(count: -1)
150 !59 = !DILocation(line: 34, column: 33, scope: !52)