2017-09-12 07:05:20 +08:00
|
|
|
; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump -v - | FileCheck %s
|
2016-12-22 14:10:41 +08:00
|
|
|
; This tests a fragment that partially covers subregister compositions.
|
|
|
|
;
|
|
|
|
; Our fragment is 96 bits long and lies in a 128-bit register, which
|
|
|
|
; in turn has to be composed out of its two 64-bit subregisters.
|
|
|
|
|
|
|
|
; CHECK: .debug_info
|
|
|
|
; CHECK: DW_TAG_subprogram
|
|
|
|
; CHECK: DW_AT_name {{.*}}"subscript.get"
|
|
|
|
; CHECK: DW_TAG_formal_parameter
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-30 05:41:21 +08:00
|
|
|
; CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] ({{.*}}
|
2018-01-16 19:17:57 +08:00
|
|
|
; CHECK-NEXT: [0x{{.*}}, 0x{{.*}}): DW_OP_regx D16, DW_OP_piece 0x8, DW_OP_regx D17, DW_OP_piece 0x4, DW_OP_regx D16, DW_OP_piece 0x8, DW_OP_regx D17, DW_OP_piece 0x4
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-30 05:41:21 +08:00
|
|
|
|
2016-12-22 14:10:41 +08:00
|
|
|
source_filename = "simd.ll"
|
|
|
|
target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
|
|
|
|
target triple = "armv7-apple-ios7.0"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
2017-07-29 04:21:02 +08:00
|
|
|
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
|
2016-12-22 14:10:41 +08:00
|
|
|
|
|
|
|
define <3 x float> @_TFV4simd8float2x3g9subscriptFSiVS_6float3(i32, <3 x float>, <3 x float>) !dbg !5 {
|
|
|
|
entry:
|
2017-07-29 04:21:02 +08:00
|
|
|
tail call void @llvm.dbg.value(metadata <3 x float> %1, metadata !8, metadata !9), !dbg !10
|
|
|
|
tail call void @llvm.dbg.value(metadata <3 x float> %2, metadata !8, metadata !11), !dbg !10
|
2016-12-22 14:10:41 +08:00
|
|
|
%3 = icmp eq i32 %0, 0, !dbg !12
|
|
|
|
br i1 %3, label %7, label %4, !dbg !12
|
|
|
|
|
|
|
|
; <label>:4: ; preds = %entry
|
|
|
|
%5 = icmp eq i32 %0, 1, !dbg !15
|
|
|
|
br i1 %5, label %7, label %6, !dbg !15
|
|
|
|
|
|
|
|
; <label>:6: ; preds = %4
|
|
|
|
unreachable, !dbg !17
|
|
|
|
|
|
|
|
; <label>:7: ; preds = %4, %entry
|
|
|
|
%8 = phi <3 x float> [ %1, %entry ], [ %2, %4 ], !dbg !18
|
|
|
|
ret <3 x float> %8, !dbg !18
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind readnone }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
|
|
!llvm.module.flags = !{!3, !4}
|
|
|
|
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !1, producer: "Swift", isOptimized: false, runtimeVersion: 3, emissionKind: FullDebug, enums: !2, imports: !2)
|
|
|
|
!1 = !DIFile(filename: "simd.swift", directory: "/")
|
|
|
|
!2 = !{}
|
|
|
|
!3 = !{i32 2, !"Dwarf Version", i32 4}
|
|
|
|
!4 = !{i32 2, !"Debug Info Version", i32 3}
|
[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
2018-05-09 10:40:45 +08:00
|
|
|
!5 = distinct !DISubprogram(name: "subscript.get", linkageName: "_TFV4simd8float2x3g9subscriptFSiVS_6float3", scope: !6, file: !1, type: !7, isLocal: false, isDefinition: true, isOptimized: true, unit: !0, retainedNodes: !2)
|
2016-12-22 14:10:41 +08:00
|
|
|
!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "float2x3", scope: !0, file: !1, line: 5824, size: 256, align: 128, elements: !2, runtimeLang: DW_LANG_Swift, identifier: "_TtV4simd8float2x3")
|
|
|
|
!7 = !DISubroutineType(types: !2)
|
|
|
|
!8 = !DILocalVariable(name: "self", arg: 2, scope: !5, file: !1, line: 5897, type: !6, flags: DIFlagArtificial)
|
|
|
|
!9 = !DIExpression(DW_OP_LLVM_fragment, 0, 96)
|
|
|
|
!10 = !DILocation(line: 5897, column: 5, scope: !5)
|
|
|
|
!11 = !DIExpression(DW_OP_LLVM_fragment, 96, 96)
|
|
|
|
!12 = !DILocation(line: 5900, column: 12, scope: !13)
|
|
|
|
!13 = distinct !DILexicalBlock(scope: !14, file: !1, line: 5898, column: 7)
|
|
|
|
!14 = distinct !DILexicalBlock(scope: !5, file: !1, line: 5897, column: 9)
|
|
|
|
!15 = !DILocation(line: 5902, column: 12, scope: !16)
|
|
|
|
!16 = distinct !DILexicalBlock(scope: !14, file: !1, line: 5898, column: 7)
|
|
|
|
!17 = !DILocation(line: 0, scope: !5)
|
|
|
|
!18 = !DILocation(line: 5906, column: 5, scope: !14)
|