diff options
| author | Shiva Chen <shiva0217@gmail.com> | 2018-05-09 02:40:45 +0000 |
|---|---|---|
| committer | Shiva Chen <shiva0217@gmail.com> | 2018-05-09 02:40:45 +0000 |
| commit | 2c864551df3945f50e1780b2f2c880ec358ae715 (patch) | |
| tree | d82705cf2fd8d7508726df36d2034176d901c2f2 /llvm/test/DebugInfo/AMDGPU | |
| parent | 49914cc807a933f3bafd61b88248e75a90101333 (diff) | |
| download | bcm5719-llvm-2c864551df3945f50e1780b2f2c880ec358ae715.tar.gz bcm5719-llvm-2c864551df3945f50e1780b2f2c880ec358ae715.zip | |
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
Diffstat (limited to 'llvm/test/DebugInfo/AMDGPU')
5 files changed, 7 insertions, 7 deletions
diff --git a/llvm/test/DebugInfo/AMDGPU/code-pointer-size.ll b/llvm/test/DebugInfo/AMDGPU/code-pointer-size.ll index 8be11c72bcf..533a8417568 100644 --- a/llvm/test/DebugInfo/AMDGPU/code-pointer-size.ll +++ b/llvm/test/DebugInfo/AMDGPU/code-pointer-size.ll @@ -50,7 +50,7 @@ entry: !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) +!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, retainedNodes: !2) !8 = !DISubroutineType(types: !9) !9 = !{null, !10} !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64) @@ -65,7 +65,7 @@ entry: !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) +!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, retainedNodes: !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) diff --git a/llvm/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll b/llvm/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll index eeb274a790f..8de273a04f7 100644 --- a/llvm/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll +++ b/llvm/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll @@ -59,7 +59,7 @@ if.end3: ; preds = %if.then2, %if.end !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) +!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, retainedNodes: !12) !8 = !DISubroutineType(types: !9) !9 = !{null, !10, !10} !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64) diff --git a/llvm/test/DebugInfo/AMDGPU/dwarfdump-relocs.ll b/llvm/test/DebugInfo/AMDGPU/dwarfdump-relocs.ll index 3a1da6bacb0..385446f683c 100644 --- a/llvm/test/DebugInfo/AMDGPU/dwarfdump-relocs.ll +++ b/llvm/test/DebugInfo/AMDGPU/dwarfdump-relocs.ll @@ -51,7 +51,7 @@ entry: !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) +!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, retainedNodes: !2) !8 = !DISubroutineType(types: !9) !9 = !{null, !10} !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64) @@ -66,7 +66,7 @@ entry: !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) +!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, retainedNodes: !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) diff --git a/llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll b/llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll index 6a3dfc5a8e4..2b4dd4c968e 100644 --- a/llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll +++ b/llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll @@ -83,7 +83,7 @@ entry: !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) +!7 = distinct !DISubprogram(name: "kernel1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2) !8 = !DISubroutineType(types: !9) !9 = !{null} !10 = !DILocalVariable(name: "FuncVar0", scope: !7, file: !1, line: 2, type: !11) diff --git a/llvm/test/DebugInfo/AMDGPU/variable-locations.ll b/llvm/test/DebugInfo/AMDGPU/variable-locations.ll index 66885f21cec..75859edb6af 100644 --- a/llvm/test/DebugInfo/AMDGPU/variable-locations.ll +++ b/llvm/test/DebugInfo/AMDGPU/variable-locations.ll @@ -90,7 +90,7 @@ entry: !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) +!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, retainedNodes: !4) !14 = !DISubroutineType(types: !15) !15 = !{null, !16, !17, !17} !16 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned) |

