Skip to content

Commit 7dab730

Browse files
Remove some unnecessary debug metadata in test
1 parent 7b0ac40 commit 7dab730

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

llvm/test/DebugInfo/X86/DW_OP_LLVM_extract_bits.ll

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
define i32 @test1() !dbg !13 {
1818
entry:
1919
%0 = alloca %struct.struct_t, align 1
20-
tail call void @llvm.dbg.declare(metadata ptr %0, metadata !17, metadata !DIExpression(DW_OP_LLVM_extract_bits, 0, 3, DW_ATE_unsigned)), !dbg !18
21-
tail call void @llvm.dbg.declare(metadata ptr %0, metadata !19, metadata !DIExpression(DW_OP_LLVM_extract_bits, 3, 4, DW_ATE_signed)), !dbg !21
22-
ret i32 0, !dbg !22
20+
tail call void @llvm.dbg.declare(metadata ptr %0, metadata !16, metadata !DIExpression(DW_OP_LLVM_extract_bits, 0, 3, DW_ATE_unsigned)), !dbg !17
21+
tail call void @llvm.dbg.declare(metadata ptr %0, metadata !18, metadata !DIExpression(DW_OP_LLVM_extract_bits, 3, 4, DW_ATE_signed)), !dbg !17
22+
ret i32 0, !dbg !17
2323
}
2424

2525
; CHECK-LABEL: DW_TAG_subprogram
@@ -31,12 +31,12 @@ entry:
3131
; CHECK: DW_AT_location (DW_OP_breg0 RAX+0, DW_OP_constu 0xff, DW_OP_and, DW_OP_constu 0x39, DW_OP_shl, DW_OP_constu 0x3c, DW_OP_shra, DW_OP_stack_value)
3232
; CHECK: DW_AT_name ("y")
3333

34-
define i8 @test2() !dbg !23 {
34+
define i8 @test2() !dbg !20 {
3535
entry:
3636
%0 = load i8, ptr @g, align 1
37-
tail call void @llvm.dbg.value(metadata i8 %0, metadata !24, metadata !DIExpression(DW_OP_LLVM_extract_bits, 0, 3, DW_ATE_unsigned)), !dbg !25
38-
tail call void @llvm.dbg.value(metadata i8 %0, metadata !26, metadata !DIExpression(DW_OP_LLVM_extract_bits, 3, 4, DW_ATE_signed)), !dbg !27
39-
ret i8 %0, !dbg !28
37+
tail call void @llvm.dbg.value(metadata i8 %0, metadata !21, metadata !DIExpression(DW_OP_LLVM_extract_bits, 0, 3, DW_ATE_unsigned)), !dbg !22
38+
tail call void @llvm.dbg.value(metadata i8 %0, metadata !23, metadata !DIExpression(DW_OP_LLVM_extract_bits, 3, 4, DW_ATE_signed)), !dbg !22
39+
ret i8 %0, !dbg !22
4040
}
4141

4242
; CHECK-LABEL: DW_TAG_subprogram
@@ -48,12 +48,12 @@ entry:
4848
; CHECK: DW_AT_location (DW_OP_breg0 RAX+0, DW_OP_constu 0x3f, DW_OP_shra, DW_OP_stack_value)
4949
; CHECK: DW_AT_name ("y")
5050

51-
define i64 @test3(ptr %p) !dbg !29 {
51+
define i64 @test3(ptr %p) !dbg !24 {
5252
entry:
5353
%0 = load i64, ptr %p, align 8
54-
tail call void @llvm.dbg.value(metadata i64 %0, metadata !33, metadata !DIExpression(DW_OP_LLVM_extract_bits, 63, 1, DW_ATE_unsigned)), !dbg !30
55-
tail call void @llvm.dbg.value(metadata i64 %0, metadata !34, metadata !DIExpression(DW_OP_LLVM_extract_bits, 63, 1, DW_ATE_signed)), !dbg !31
56-
ret i64 %0, !dbg !32
54+
tail call void @llvm.dbg.value(metadata i64 %0, metadata !25, metadata !DIExpression(DW_OP_LLVM_extract_bits, 63, 1, DW_ATE_unsigned)), !dbg !26
55+
tail call void @llvm.dbg.value(metadata i64 %0, metadata !27, metadata !DIExpression(DW_OP_LLVM_extract_bits, 63, 1, DW_ATE_signed)), !dbg !26
56+
ret i64 %0, !dbg !26
5757
}
5858

5959
declare void @llvm.dbg.declare(metadata, metadata, metadata)
@@ -63,37 +63,30 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
6363
!llvm.module.flags = !{!11, !12}
6464

6565
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
66-
!1 = distinct !DIGlobalVariable(name: "g", scope: !2, file: !3, line: 6, type: !5, isLocal: false, isDefinition: true)
66+
!1 = distinct !DIGlobalVariable(name: "g", scope: !2, file: !3, type: !5, isLocal: false, isDefinition: true)
6767
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)
6868
!3 = !DIFile(filename: "DW_OP_bit_piece.cpp", directory: "./")
6969
!4 = !{!0}
70-
!5 = !DIDerivedType(tag: DW_TAG_typedef, name: "struct_t", file: !3, line: 4, baseType: !6)
71-
!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !7, identifier: "_ZTS8struct_t")
70+
!5 = !DIDerivedType(tag: DW_TAG_typedef, name: "struct_t", file: !3, baseType: !6)
71+
!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, size: 8, flags: DIFlagTypePassByValue, elements: !7, identifier: "_ZTS8struct_t")
7272
!7 = !{!8, !10}
73-
!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !3, line: 2, baseType: !9, size: 3, flags: DIFlagBitField, extraData: i64 0)
73+
!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !3, baseType: !9, size: 3, flags: DIFlagBitField, extraData: i64 0)
7474
!9 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
75-
!10 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !6, file: !3, line: 3, baseType: !9, size: 4, offset: 3, flags: DIFlagBitField, extraData: i64 0)
75+
!10 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !6, file: !3, baseType: !9, size: 4, offset: 3, flags: DIFlagBitField, extraData: i64 0)
7676
!11 = !{i32 7, !"Dwarf Version", i32 5}
7777
!12 = !{i32 2, !"Debug Info Version", i32 3}
78-
!13 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: !3, file: !3, line: 8, type: !14, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16)
78+
!13 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)
7979
!14 = !DISubroutineType(types: !15)
8080
!15 = !{!9}
81-
!16 = !{}
82-
!17 = !DILocalVariable(name: "x", scope: !13, file: !3, line: 9, type: !9)
83-
!18 = !DILocation(line: 9, column: 9, scope: !13)
84-
!19 = !DILocalVariable(name: "y", scope: !13, file: !3, line: 9, type: !20)
85-
!20 = !DIBasicType(name: "signed int", size: 32, encoding: DW_ATE_signed)
86-
!21 = !DILocation(line: 9, column: 12, scope: !13)
87-
!22 = !DILocation(line: 10, column: 3, scope: !13)
88-
!23 = distinct !DISubprogram(name: "test2", linkageName: "test2", scope: !3, file: !3, line: 8, type: !14, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16)
89-
!24 = !DILocalVariable(name: "x", scope: !23, file: !3, line: 9, type: !9)
90-
!25 = !DILocation(line: 9, column: 9, scope: !23)
91-
!26 = !DILocalVariable(name: "y", scope: !23, file: !3, line: 9, type: !20)
92-
!27 = !DILocation(line: 9, column: 12, scope: !23)
93-
!28 = !DILocation(line: 10, column: 3, scope: !23)
94-
!29 = distinct !DISubprogram(name: "test3", linkageName: "test3", scope: !3, file: !3, line: 8, type: !14, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !16)
95-
!30 = !DILocation(line: 9, column: 9, scope: !29)
96-
!31 = !DILocation(line: 9, column: 12, scope: !29)
97-
!32 = !DILocation(line: 10, column: 3, scope: !29)
98-
!33 = !DILocalVariable(name: "x", scope: !29, file: !3, line: 9, type: !9)
99-
!34 = !DILocalVariable(name: "y", scope: !29, file: !3, line: 9, type: !20)
81+
!16 = !DILocalVariable(name: "x", scope: !13, file: !3, type: !9)
82+
!17 = !DILocation(line: 0, scope: !13)
83+
!18 = !DILocalVariable(name: "y", scope: !13, file: !3, type: !19)
84+
!19 = !DIBasicType(name: "signed int", size: 32, encoding: DW_ATE_signed)
85+
!20 = distinct !DISubprogram(name: "test2", linkageName: "test2", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)
86+
!21 = !DILocalVariable(name: "x", scope: !20, file: !3, type: !9)
87+
!22 = !DILocation(line: 0, scope: !20)
88+
!23 = !DILocalVariable(name: "y", scope: !20, file: !3, type: !19)
89+
!24 = distinct !DISubprogram(name: "test3", linkageName: "test3", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)
90+
!25 = !DILocalVariable(name: "x", scope: !24, file: !3, type: !9)
91+
!26 = !DILocation(line: 0, scope: !24)
92+
!27 = !DILocalVariable(name: "y", scope: !24, file: !3, type: !19)

0 commit comments

Comments
 (0)