You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.205
Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
This commit is contained in:
parent
5cd5df71cc
commit
8e12397d70
73
external/llvm/test/DebugInfo/AMDGPU/code-pointer-size.ll
vendored
Normal file
73
external/llvm/test/DebugInfo/AMDGPU/code-pointer-size.ll
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
|
||||
|
||||
; LLVM IR generated with the following command and OpenCL source:
|
||||
;
|
||||
; $clang -cl-std=CL2.0 -g -O0 -target amdgcn-amd-amdhsa -S -emit-llvm <path-to-file>
|
||||
;
|
||||
; kernel void kernel1(global int *A) {
|
||||
; *A = 11;
|
||||
; }
|
||||
;
|
||||
; kernel void kernel2(global int *B) {
|
||||
; *B = 12;
|
||||
; }
|
||||
|
||||
; Make sure that code pointer size is 8 bytes:
|
||||
; CHECK: .debug_info contents:
|
||||
; CHECK: addr_size = 0x08
|
||||
|
||||
declare void @llvm.dbg.declare(metadata, metadata, metadata)
|
||||
|
||||
define amdgpu_kernel void @kernel1(i32 addrspace(1)* %A) !dbg !7 {
|
||||
entry:
|
||||
%A.addr = alloca i32 addrspace(1)*, align 4
|
||||
store i32 addrspace(1)* %A, i32 addrspace(1)** %A.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %A.addr, metadata !16, metadata !17), !dbg !18
|
||||
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %A.addr, align 4, !dbg !19
|
||||
store i32 11, i32 addrspace(1)* %0, align 4, !dbg !20
|
||||
ret void, !dbg !21
|
||||
}
|
||||
|
||||
define amdgpu_kernel void @kernel2(i32 addrspace(1)* %B) !dbg !22 {
|
||||
entry:
|
||||
%B.addr = alloca i32 addrspace(1)*, align 4
|
||||
store i32 addrspace(1)* %B, i32 addrspace(1)** %B.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %B.addr, metadata !23, metadata !17), !dbg !24
|
||||
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %B.addr, align 4, !dbg !25
|
||||
store i32 12, i32 addrspace(1)* %0, align 4, !dbg !26
|
||||
ret void, !dbg !27
|
||||
}
|
||||
|
||||
!llvm.dbg.cu = !{!0}
|
||||
!opencl.ocl.version = !{!3, !3}
|
||||
!llvm.module.flags = !{!4, !5}
|
||||
!llvm.ident = !{!6}
|
||||
|
||||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
||||
!1 = !DIFile(filename: "dwarfdump-relocs.cl", directory: "/some/random/directory")
|
||||
!2 = !{}
|
||||
!3 = !{i32 2, i32 0}
|
||||
!4 = !{i32 2, !"Dwarf Version", i32 2}
|
||||
!5 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!6 = !{!""}
|
||||
!7 = distinct !DISubprogram(name: "kernel1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
|
||||
!8 = !DISubroutineType(types: !9)
|
||||
!9 = !{null, !10}
|
||||
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
|
||||
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
!12 = !{i32 1}
|
||||
!13 = !{!"none"}
|
||||
!14 = !{!"int*"}
|
||||
!15 = !{!""}
|
||||
!16 = !DILocalVariable(name: "A", arg: 1, scope: !7, file: !1, line: 1, type: !10)
|
||||
!17 = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)
|
||||
!18 = !DILocation(line: 1, column: 33, scope: !7)
|
||||
!19 = !DILocation(line: 2, column: 4, scope: !7)
|
||||
!20 = !DILocation(line: 2, column: 6, scope: !7)
|
||||
!21 = !DILocation(line: 3, column: 1, scope: !7)
|
||||
!22 = distinct !DISubprogram(name: "kernel2", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
|
||||
!23 = !DILocalVariable(name: "B", arg: 1, scope: !22, file: !1, line: 5, type: !10)
|
||||
!24 = !DILocation(line: 5, column: 33, scope: !22)
|
||||
!25 = !DILocation(line: 6, column: 4, scope: !22)
|
||||
!26 = !DILocation(line: 6, column: 6, scope: !22)
|
||||
!27 = !DILocation(line: 7, column: 1, scope: !22)
|
95
external/llvm/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll
vendored
Normal file
95
external/llvm/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji < %s | FileCheck %s
|
||||
|
||||
; Make sure we do not crash during scheduling when DBG_VALUE is the first
|
||||
; instruction in the basic block.
|
||||
|
||||
; LLVM IR generated with the following command and OpenCL source:
|
||||
;
|
||||
; $clang -cl-std=CL2.0 -g -O2 -target amdgcn-amd-amdhsa -S -emit-llvm <path-to-file>
|
||||
;
|
||||
; kernel void kernel1(global int *A, global int *B) {
|
||||
; if (*A == 1) {
|
||||
; *B = 12;
|
||||
; }
|
||||
; if (*A == 2) {
|
||||
; *B = 13;
|
||||
; }
|
||||
; }
|
||||
|
||||
declare void @llvm.dbg.value(metadata, metadata, metadata)
|
||||
|
||||
; CHECK-LABEL: {{^}}kernel1:
|
||||
define amdgpu_kernel void @kernel1(
|
||||
i32 addrspace(1)* nocapture readonly %A,
|
||||
i32 addrspace(1)* nocapture %B) !dbg !7 {
|
||||
entry:
|
||||
tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %A, metadata !13, metadata !19), !dbg !20
|
||||
tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %B, metadata !14, metadata !19), !dbg !21
|
||||
%0 = load i32, i32 addrspace(1)* %A, align 4, !dbg !22, !tbaa !24
|
||||
%cmp = icmp eq i32 %0, 1, !dbg !28
|
||||
br i1 %cmp, label %if.then, label %if.end, !dbg !29
|
||||
|
||||
if.then: ; preds = %entry
|
||||
store i32 12, i32 addrspace(1)* %B, align 4, !dbg !30, !tbaa !24
|
||||
%.pr = load i32, i32 addrspace(1)* %A, align 4, !dbg !32, !tbaa !24
|
||||
br label %if.end, !dbg !34
|
||||
|
||||
if.end: ; preds = %if.then, %entry
|
||||
%1 = phi i32 [ %.pr, %if.then ], [ %0, %entry ], !dbg !32
|
||||
%cmp1 = icmp eq i32 %1, 2, !dbg !35
|
||||
br i1 %cmp1, label %if.then2, label %if.end3, !dbg !36
|
||||
|
||||
if.then2: ; preds = %if.end
|
||||
store i32 13, i32 addrspace(1)* %B, align 4, !dbg !37, !tbaa !24
|
||||
br label %if.end3, !dbg !39
|
||||
|
||||
if.end3: ; preds = %if.then2, %if.end
|
||||
ret void, !dbg !40
|
||||
}
|
||||
|
||||
!llvm.dbg.cu = !{!0}
|
||||
!opencl.ocl.version = !{!3}
|
||||
!llvm.module.flags = !{!4, !5}
|
||||
!llvm.ident = !{!6}
|
||||
|
||||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
||||
!1 = !DIFile(filename: "dbg-value-sched-crash.cl", directory: "/some/random/directory")
|
||||
!2 = !{}
|
||||
!3 = !{i32 2, i32 0}
|
||||
!4 = !{i32 2, !"Dwarf Version", i32 2}
|
||||
!5 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!6 = !{!"clang version 4.0 "}
|
||||
!7 = distinct !DISubprogram(name: "kernel1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12)
|
||||
!8 = !DISubroutineType(types: !9)
|
||||
!9 = !{null, !10, !10}
|
||||
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
|
||||
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
!12 = !{!13, !14}
|
||||
!13 = !DILocalVariable(name: "A", arg: 1, scope: !7, file: !1, line: 1, type: !10)
|
||||
!14 = !DILocalVariable(name: "B", arg: 2, scope: !7, file: !1, line: 1, type: !10)
|
||||
!15 = !{i32 1, i32 1}
|
||||
!16 = !{!"none", !"none"}
|
||||
!17 = !{!"int*", !"int*"}
|
||||
!18 = !{!"", !""}
|
||||
!19 = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)
|
||||
!20 = !DILocation(line: 1, column: 33, scope: !7)
|
||||
!21 = !DILocation(line: 1, column: 48, scope: !7)
|
||||
!22 = !DILocation(line: 2, column: 7, scope: !23)
|
||||
!23 = distinct !DILexicalBlock(scope: !7, file: !1, line: 2, column: 7)
|
||||
!24 = !{!25, !25, i64 0}
|
||||
!25 = !{!"int", !26, i64 0}
|
||||
!26 = !{!"omnipotent char", !27, i64 0}
|
||||
!27 = !{!"Simple C/C++ TBAA"}
|
||||
!28 = !DILocation(line: 2, column: 10, scope: !23)
|
||||
!29 = !DILocation(line: 2, column: 7, scope: !7)
|
||||
!30 = !DILocation(line: 3, column: 8, scope: !31)
|
||||
!31 = distinct !DILexicalBlock(scope: !23, file: !1, line: 2, column: 16)
|
||||
!32 = !DILocation(line: 5, column: 7, scope: !33)
|
||||
!33 = distinct !DILexicalBlock(scope: !7, file: !1, line: 5, column: 7)
|
||||
!34 = !DILocation(line: 4, column: 3, scope: !31)
|
||||
!35 = !DILocation(line: 5, column: 10, scope: !33)
|
||||
!36 = !DILocation(line: 5, column: 7, scope: !7)
|
||||
!37 = !DILocation(line: 6, column: 8, scope: !38)
|
||||
!38 = distinct !DILexicalBlock(scope: !33, file: !1, line: 5, column: 16)
|
||||
!39 = !DILocation(line: 7, column: 3, scope: !38)
|
||||
!40 = !DILocation(line: 8, column: 1, scope: !7)
|
72
external/llvm/test/DebugInfo/AMDGPU/dwarfdump-relocs.ll
vendored
Normal file
72
external/llvm/test/DebugInfo/AMDGPU/dwarfdump-relocs.ll
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -v - 2>&1 | FileCheck %s
|
||||
|
||||
; LLVM IR generated with the following command and OpenCL source:
|
||||
;
|
||||
; $clang -cl-std=CL2.0 -g -O0 -target amdgcn-amd-amdhsa -S -emit-llvm <path-to-file>
|
||||
;
|
||||
; kernel void kernel1(global int *A) {
|
||||
; *A = 11;
|
||||
; }
|
||||
;
|
||||
; kernel void kernel2(global int *B) {
|
||||
; *B = 12;
|
||||
; }
|
||||
|
||||
; CHECK-NOT: failed to compute relocation
|
||||
; CHECK: file_names[ 1] 0 0x00000000 0x00000000 dwarfdump-relocs.cl
|
||||
|
||||
declare void @llvm.dbg.declare(metadata, metadata, metadata)
|
||||
|
||||
define amdgpu_kernel void @kernel1(i32 addrspace(1)* %A) !dbg !7 {
|
||||
entry:
|
||||
%A.addr = alloca i32 addrspace(1)*, align 4
|
||||
store i32 addrspace(1)* %A, i32 addrspace(1)** %A.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %A.addr, metadata !16, metadata !17), !dbg !18
|
||||
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %A.addr, align 4, !dbg !19
|
||||
store i32 11, i32 addrspace(1)* %0, align 4, !dbg !20
|
||||
ret void, !dbg !21
|
||||
}
|
||||
|
||||
define amdgpu_kernel void @kernel2(i32 addrspace(1)* %B) !dbg !22 {
|
||||
entry:
|
||||
%B.addr = alloca i32 addrspace(1)*, align 4
|
||||
store i32 addrspace(1)* %B, i32 addrspace(1)** %B.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %B.addr, metadata !23, metadata !17), !dbg !24
|
||||
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %B.addr, align 4, !dbg !25
|
||||
store i32 12, i32 addrspace(1)* %0, align 4, !dbg !26
|
||||
ret void, !dbg !27
|
||||
}
|
||||
|
||||
!llvm.dbg.cu = !{!0}
|
||||
!opencl.ocl.version = !{!3, !3}
|
||||
!llvm.module.flags = !{!4, !5}
|
||||
!llvm.ident = !{!6}
|
||||
|
||||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
||||
!1 = !DIFile(filename: "dwarfdump-relocs.cl", directory: "/some/random/directory")
|
||||
!2 = !{}
|
||||
!3 = !{i32 2, i32 0}
|
||||
!4 = !{i32 2, !"Dwarf Version", i32 2}
|
||||
!5 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!6 = !{!""}
|
||||
!7 = distinct !DISubprogram(name: "kernel1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
|
||||
!8 = !DISubroutineType(types: !9)
|
||||
!9 = !{null, !10}
|
||||
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
|
||||
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
!12 = !{i32 1}
|
||||
!13 = !{!"none"}
|
||||
!14 = !{!"int*"}
|
||||
!15 = !{!""}
|
||||
!16 = !DILocalVariable(name: "A", arg: 1, scope: !7, file: !1, line: 1, type: !10)
|
||||
!17 = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)
|
||||
!18 = !DILocation(line: 1, column: 33, scope: !7)
|
||||
!19 = !DILocation(line: 2, column: 4, scope: !7)
|
||||
!20 = !DILocation(line: 2, column: 6, scope: !7)
|
||||
!21 = !DILocation(line: 3, column: 1, scope: !7)
|
||||
!22 = distinct !DISubprogram(name: "kernel2", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
|
||||
!23 = !DILocalVariable(name: "B", arg: 1, scope: !22, file: !1, line: 5, type: !10)
|
||||
!24 = !DILocation(line: 5, column: 33, scope: !22)
|
||||
!25 = !DILocation(line: 6, column: 4, scope: !22)
|
||||
!26 = !DILocation(line: 6, column: 6, scope: !22)
|
||||
!27 = !DILocation(line: 7, column: 1, scope: !22)
|
2
external/llvm/test/DebugInfo/AMDGPU/lit.local.cfg
vendored
Normal file
2
external/llvm/test/DebugInfo/AMDGPU/lit.local.cfg
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
if not 'AMDGPU' in config.root.targets:
|
||||
config.unsupported = True
|
104
external/llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll
vendored
Normal file
104
external/llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s
|
||||
|
||||
; LLVM IR generated with the following command and OpenCL source:
|
||||
;
|
||||
; $clang -cl-std=CL2.0 -g -O0 -target amdgcn-amd-amdhsa -S -emit-llvm <path-to-file>
|
||||
;
|
||||
; kernel void kernel1() {
|
||||
; global int *FuncVar0 = 0;
|
||||
; constant int *FuncVar1 = 0;
|
||||
; local int *FuncVar2 = 0;
|
||||
; private int *FuncVar3 = 0;
|
||||
; int *FuncVar4 = 0;
|
||||
; }
|
||||
|
||||
; CHECK: DW_AT_name {{.*}}"FuncVar0"
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[a-f0-9]+}} => {0x[[NONE:[a-f0-9]+]]}
|
||||
|
||||
; CHECK: DW_AT_name {{.*}}"FuncVar1"
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[a-f0-9]+}} => {0x[[NONE]]}
|
||||
|
||||
; CHECK: DW_AT_name {{.*}}"FuncVar2"
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[a-f0-9]+}} => {0x[[LOCAL:[a-f0-9]+]]}
|
||||
|
||||
; CHECK: DW_AT_name {{.*}}"FuncVar3"
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[a-f0-9]+}} => {0x[[PRIVATE:[a-f0-9]+]]}
|
||||
|
||||
; CHECK: DW_AT_name {{.*}}"FuncVar4"
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[a-f0-9]+}} => {0x[[NONE]]}
|
||||
|
||||
; CHECK: 0x[[NONE]]: DW_TAG_pointer_type
|
||||
; CHECK-NEXT: DW_AT_type
|
||||
; CHECK-NOT: DW_AT_address_class
|
||||
|
||||
; CHECK: 0x[[LOCAL]]: DW_TAG_pointer_type
|
||||
; CHECK-NEXT: DW_AT_type
|
||||
; CHECK-NEXT: DW_AT_address_class [DW_FORM_data4] (0x00000002)
|
||||
|
||||
; CHECK: 0x[[PRIVATE]]: DW_TAG_pointer_type
|
||||
; CHECK-NEXT: DW_AT_type
|
||||
; CHECK-NEXT: DW_AT_address_class [DW_FORM_data4] (0x00000001)
|
||||
|
||||
declare void @llvm.dbg.declare(metadata, metadata, metadata)
|
||||
|
||||
define amdgpu_kernel void @kernel1() !dbg !7 {
|
||||
entry:
|
||||
%FuncVar0 = alloca i32 addrspace(1)*, align 4
|
||||
%FuncVar1 = alloca i32 addrspace(2)*, align 4
|
||||
%FuncVar2 = alloca i32 addrspace(3)*, align 4
|
||||
%FuncVar3 = alloca i32*, align 4
|
||||
%FuncVar4 = alloca i32 addrspace(4)*, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %FuncVar0, metadata !10, metadata !13), !dbg !14
|
||||
store i32 addrspace(1)* null, i32 addrspace(1)** %FuncVar0, align 4, !dbg !14
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(2)** %FuncVar1, metadata !15, metadata !13), !dbg !16
|
||||
store i32 addrspace(2)* null, i32 addrspace(2)** %FuncVar1, align 4, !dbg !16
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(3)** %FuncVar2, metadata !17, metadata !13), !dbg !19
|
||||
store i32 addrspace(3)* addrspacecast (i32 addrspace(4)* null to i32 addrspace(3)*), i32 addrspace(3)** %FuncVar2, align 4, !dbg !19
|
||||
call void @llvm.dbg.declare(metadata i32** %FuncVar3, metadata !20, metadata !13), !dbg !22
|
||||
store i32* addrspacecast (i32 addrspace(4)* null to i32*), i32** %FuncVar3, align 4, !dbg !22
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(4)** %FuncVar4, metadata !23, metadata !13), !dbg !24
|
||||
store i32 addrspace(4)* null, i32 addrspace(4)** %FuncVar4, align 4, !dbg !24
|
||||
ret void, !dbg !25
|
||||
}
|
||||
|
||||
!llvm.dbg.cu = !{!0}
|
||||
!opencl.ocl.version = !{!3}
|
||||
!llvm.module.flags = !{!4, !5}
|
||||
!llvm.ident = !{!6}
|
||||
|
||||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
||||
!1 = !DIFile(filename: "pointer-address-space.ll", directory: "/some/random/directory")
|
||||
!2 = !{}
|
||||
!3 = !{i32 2, i32 0}
|
||||
!4 = !{i32 2, !"Dwarf Version", i32 2}
|
||||
!5 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!6 = !{!""}
|
||||
!7 = distinct !DISubprogram(name: "kernel1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2)
|
||||
!8 = !DISubroutineType(types: !9)
|
||||
!9 = !{null}
|
||||
!10 = !DILocalVariable(name: "FuncVar0", scope: !7, file: !1, line: 2, type: !11)
|
||||
!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)
|
||||
!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
!13 = !DIExpression()
|
||||
!14 = !DILocation(line: 2, column: 15, scope: !7)
|
||||
!15 = !DILocalVariable(name: "FuncVar1", scope: !7, file: !1, line: 3, type: !11)
|
||||
!16 = !DILocation(line: 3, column: 17, scope: !7)
|
||||
!17 = !DILocalVariable(name: "FuncVar2", scope: !7, file: !1, line: 4, type: !18)
|
||||
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 32, dwarfAddressSpace: 2)
|
||||
!19 = !DILocation(line: 4, column: 14, scope: !7)
|
||||
!20 = !DILocalVariable(name: "FuncVar3", scope: !7, file: !1, line: 5, type: !21)
|
||||
!21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 32, dwarfAddressSpace: 1)
|
||||
!22 = !DILocation(line: 5, column: 16, scope: !7)
|
||||
!23 = !DILocalVariable(name: "FuncVar4", scope: !7, file: !1, line: 6, type: !11)
|
||||
!24 = !DILocation(line: 6, column: 8, scope: !7)
|
||||
!25 = !DILocation(line: 7, column: 1, scope: !7)
|
111
external/llvm/test/DebugInfo/AMDGPU/variable-locations.ll
vendored
Normal file
111
external/llvm/test/DebugInfo/AMDGPU/variable-locations.ll
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s
|
||||
|
||||
; LLVM IR generated with the following command and OpenCL source:
|
||||
;
|
||||
; $clang -cl-std=CL2.0 -g -O0 -target amdgcn-amd-amdhsa -S -emit-llvm <path-to-file>
|
||||
;
|
||||
; global int GlobA;
|
||||
; global int GlobB;
|
||||
;
|
||||
; kernel void kernel1(unsigned int ArgN, global int *ArgA, global int *ArgB) {
|
||||
; ArgA[ArgN] += ArgB[ArgN];
|
||||
; }
|
||||
|
||||
declare void @llvm.dbg.declare(metadata, metadata, metadata)
|
||||
|
||||
; CHECK: {{.*}}DW_TAG_variable
|
||||
; CHECK-NEXT: DW_AT_name {{.*}}"GlobA"
|
||||
; CHECK-NEXT: DW_AT_type
|
||||
; CHECK-NEXT: DW_AT_external
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x0)
|
||||
@GlobA = common addrspace(1) global i32 0, align 4, !dbg !0
|
||||
|
||||
; CHECK: {{.*}}DW_TAG_variable
|
||||
; CHECK-NEXT: DW_AT_name {{.*}}"GlobB"
|
||||
; CHECK-NEXT: DW_AT_type
|
||||
; CHECK-NEXT: DW_AT_external
|
||||
; CHECK-NEXT: DW_AT_decl_file
|
||||
; CHECK-NEXT: DW_AT_decl_line
|
||||
; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x0)
|
||||
@GlobB = common addrspace(1) global i32 0, align 4, !dbg !6
|
||||
|
||||
define amdgpu_kernel void @kernel1(
|
||||
; CHECK: {{.*}}DW_TAG_formal_parameter
|
||||
; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg +4, DW_OP_constu 0x1, DW_OP_swap, DW_OP_xderef)
|
||||
; CHECK-NEXT: DW_AT_name {{.*}}"ArgN"
|
||||
i32 %ArgN,
|
||||
; CHECK: {{.*}}DW_TAG_formal_parameter
|
||||
; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg +8, DW_OP_constu 0x1, DW_OP_swap, DW_OP_xderef)
|
||||
; CHECK-NEXT: DW_AT_name {{.*}}"ArgA"
|
||||
i32 addrspace(1)* %ArgA,
|
||||
; CHECK: {{.*}}DW_TAG_formal_parameter
|
||||
; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg +16, DW_OP_constu 0x1, DW_OP_swap, DW_OP_xderef)
|
||||
; CHECK-NEXT: DW_AT_name {{.*}}"ArgB"
|
||||
i32 addrspace(1)* %ArgB) !dbg !13 {
|
||||
entry:
|
||||
%ArgN.addr = alloca i32, align 4
|
||||
%ArgA.addr = alloca i32 addrspace(1)*, align 4
|
||||
%ArgB.addr = alloca i32 addrspace(1)*, align 4
|
||||
store i32 %ArgN, i32* %ArgN.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32* %ArgN.addr, metadata !22, metadata !23), !dbg !24
|
||||
store i32 addrspace(1)* %ArgA, i32 addrspace(1)** %ArgA.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %ArgA.addr, metadata !25, metadata !23), !dbg !26
|
||||
store i32 addrspace(1)* %ArgB, i32 addrspace(1)** %ArgB.addr, align 4
|
||||
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %ArgB.addr, metadata !27, metadata !23), !dbg !28
|
||||
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %ArgB.addr, align 4, !dbg !29
|
||||
%1 = load i32, i32* %ArgN.addr, align 4, !dbg !30
|
||||
%idxprom = zext i32 %1 to i64, !dbg !29
|
||||
%arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %idxprom, !dbg !29
|
||||
%2 = load i32, i32 addrspace(1)* %arrayidx, align 4, !dbg !29
|
||||
%3 = load i32 addrspace(1)*, i32 addrspace(1)** %ArgA.addr, align 4, !dbg !31
|
||||
%4 = load i32, i32* %ArgN.addr, align 4, !dbg !32
|
||||
%idxprom1 = zext i32 %4 to i64, !dbg !31
|
||||
%arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %3, i64 %idxprom1, !dbg !31
|
||||
%5 = load i32, i32 addrspace(1)* %arrayidx2, align 4, !dbg !33
|
||||
%add = add nsw i32 %5, %2, !dbg !33
|
||||
store i32 %add, i32 addrspace(1)* %arrayidx2, align 4, !dbg !33
|
||||
ret void, !dbg !34
|
||||
}
|
||||
|
||||
!llvm.dbg.cu = !{!2}
|
||||
!opencl.ocl.version = !{!9}
|
||||
!llvm.module.flags = !{!10, !11}
|
||||
!llvm.ident = !{!12}
|
||||
|
||||
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
|
||||
!1 = distinct !DIGlobalVariable(name: "GlobA", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
|
||||
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 5.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
|
||||
!3 = !DIFile(filename: "variable-locations.cl", directory: "/some/random/directory")
|
||||
!4 = !{}
|
||||
!5 = !{!0, !6}
|
||||
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
|
||||
!7 = distinct !DIGlobalVariable(name: "GlobB", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)
|
||||
!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
!9 = !{i32 2, i32 0}
|
||||
!10 = !{i32 2, !"Dwarf Version", i32 2}
|
||||
!11 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!12 = !{!"clang version 5.0.0"}
|
||||
!13 = distinct !DISubprogram(name: "kernel1", scope: !3, file: !3, line: 4, type: !14, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
|
||||
!14 = !DISubroutineType(types: !15)
|
||||
!15 = !{null, !16, !17, !17}
|
||||
!16 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
|
||||
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)
|
||||
!18 = !{i32 0, i32 1, i32 1}
|
||||
!19 = !{!"none", !"none", !"none"}
|
||||
!20 = !{!"uint", !"int*", !"int*"}
|
||||
!21 = !{!"", !"", !""}
|
||||
!22 = !DILocalVariable(name: "ArgN", arg: 1, scope: !13, file: !3, line: 4, type: !16)
|
||||
!23 = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)
|
||||
!24 = !DILocation(line: 4, column: 34, scope: !13)
|
||||
!25 = !DILocalVariable(name: "ArgA", arg: 2, scope: !13, file: !3, line: 4, type: !17)
|
||||
!26 = !DILocation(line: 4, column: 52, scope: !13)
|
||||
!27 = !DILocalVariable(name: "ArgB", arg: 3, scope: !13, file: !3, line: 4, type: !17)
|
||||
!28 = !DILocation(line: 4, column: 70, scope: !13)
|
||||
!29 = !DILocation(line: 5, column: 17, scope: !13)
|
||||
!30 = !DILocation(line: 5, column: 22, scope: !13)
|
||||
!31 = !DILocation(line: 5, column: 3, scope: !13)
|
||||
!32 = !DILocation(line: 5, column: 8, scope: !13)
|
||||
!33 = !DILocation(line: 5, column: 14, scope: !13)
|
||||
!34 = !DILocation(line: 6, column: 1, scope: !13)
|
Reference in New Issue
Block a user