136 lines · plain
1# RUN: llc -mtriple=x86_64-linux-gnu -start-before greedy -stop-after virtregrewriter -o - -verify-machineinstrs %s -experimental-debug-variable-locations=false | FileCheck %s2 3--- |4 ; ModuleID = '<stdin>'5 source_filename = "test/DebugInfo/X86/dbg-value-inlined-parameter.ll"6 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"7 target triple = "x86_64-apple-darwin"8 9 %struct.S1 = type { ptr, i32 }10 11 @p = common global %struct.S1 zeroinitializer, align 8, !dbg !012 13 ; Function Attrs: nounwind optsize ssp14 define void @foobar() !dbg !15 {15 entry:16 tail call void @llvm.dbg.value(metadata ptr @p, metadata !18, metadata !DIExpression()) , !dbg !2517 ret void, !dbg !3218 }19 20 ; Function Attrs: nounwind readnone speculatable21 declare void @llvm.dbg.value(metadata, metadata, metadata) #222 23 !llvm.dbg.cu = !{!2}24 !llvm.module.flags = !{!14}25 26 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())27 !1 = !DIGlobalVariable(name: "p", scope: !2, file: !3, line: 14, type: !6, isLocal: false, isDefinition: true)28 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 2.9 (trunk 125693)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)29 !3 = !DIFile(filename: "nm2.c", directory: "/private/tmp")30 !4 = !{}31 !5 = !{!0}32 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", scope: !2, file: !3, line: 4, baseType: !7)33 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "S1", scope: !2, file: !3, line: 1, size: 128, align: 64, elements: !8)34 !8 = !{!9, !12}35 !9 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !3, file: !3, line: 2, baseType: !10, size: 64, align: 64)36 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !2, baseType: !11, size: 64, align: 64)37 !11 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)38 !12 = !DIDerivedType(tag: DW_TAG_member, name: "nums", scope: !3, file: !3, line: 3, baseType: !13, size: 32, align: 32, offset: 64)39 !13 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)40 !14 = !{i32 1, !"Debug Info Version", i32 3}41 !15 = distinct !DISubprogram(name: "foobar", scope: !3, file: !3, line: 15, type: !16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2)42 !16 = !DISubroutineType(types: !17)43 !17 = !{null}44 !18 = !DILocalVariable(name: "sp", arg: 1, scope: !19, file: !3, line: 7, type: !24)45 !19 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 8, type: !20, isLocal: false, isDefinition: true, scopeLine: 8, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !22)46 !20 = !DISubroutineType(types: !21)47 !21 = !{!13}48 !22 = !{!18, !23}49 !23 = !DILocalVariable(name: "nums", arg: 2, scope: !19, file: !3, line: 7, type: !13)50 !24 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !2, baseType: !6, size: 64, align: 64)51 !25 = !DILocation(line: 7, column: 13, scope: !19, inlinedAt: !26)52 !26 = !DILocation(line: 16, column: 3, scope: !27)53 !27 = distinct !DILexicalBlock(scope: !15, file: !3, line: 15, column: 15)54 !32 = !DILocation(line: 17, column: 1, scope: !27)55 56...57---58name: foobar59tracksRegLiveness: true60body: |61 bb.0:62 %1:gr64 = IMPLICIT_DEF63 %2:gr64 = IMPLICIT_DEF64 65 bb.1:66 ; This DBG_VALUE will be discarded (use before def of %0).67 DBG_VALUE %0, $noreg, !18, !DIExpression(), debug-location !2568 %0:gr64 = IMPLICIT_DEF69 %0:gr64 = IMPLICIT_DEF70 %0:gr64 = IMPLICIT_DEF71 %0:gr64 = IMPLICIT_DEF72 73 bb.2:74 ; This DBG_VALUE will be discarded (%1 is defined earlier, but it is not live in, so we do not know where %1 is stored).75 DBG_VALUE %1, $noreg, !18, !DIExpression(), debug-location !2576 %1:gr64 = IMPLICIT_DEF77 %1:gr64 = IMPLICIT_DEF78 %1:gr64 = IMPLICIT_DEF79 %1:gr64 = IMPLICIT_DEF80 ; This DBG_VALUE is kept, even if %1 is dead, it was defined in the prev instruction,81 ; so the value should be available for as long as the register allocated to %1 is live.82 DBG_VALUE %1, $noreg, !18, !DIExpression(), debug-location !2583 84 bb.3:85 %1:gr64 = IMPLICIT_DEF86 DBG_VALUE 0, $noreg, !23, !DIExpression(), debug-location !2587 ; This DBG_VALUE is kept, even if %1 is dead, it was defined in the prev non-dbg instruction,88 ; so the value should be available for as long as the register allocated to %1 is live.89 DBG_VALUE %1, $noreg, !18, !DIExpression(), debug-location !2590 91 bb.4:92 ; All DBG_VALUEs here should survive. %2 is livein as it was defined in bb.0, and it has use/def in the BTS64ri8 instruction.93 DBG_VALUE %2, $noreg, !18, !DIExpression(), debug-location !2594 %2:gr64 = BTS64ri8 %2, 0, implicit-def $eflags95 DBG_VALUE 0, $noreg, !23, !DIExpression(), debug-location !2596 DBG_VALUE %2, $noreg, !18, !DIExpression(), debug-location !2597 %2:gr64 = BTS64ri8 %2, 0, implicit-def $eflags98 DBG_VALUE %2, $noreg, !18, !DIExpression(), debug-location !2599 %2:gr64 = BTS64ri8 %2, 0, implicit-def $eflags100 DBG_VALUE %2, $noreg, !18, !DIExpression(), debug-location !25101 102 bb.5:103 RET 0, debug-location !32104...105 106# CHECK-LABEL: name: foobar107 108# CHECK-LABEL: bb.1:109# CHECK: DBG_VALUE $noreg110 111# CHECK-LABEL: bb.2:112# CHECK: DBG_VALUE $noreg113# CHECK-NEXT: dead renamable $rcx = IMPLICIT_DEF114# CHECK-NEXT: dead renamable $rcx = IMPLICIT_DEF115# CHECK-NEXT: dead renamable $rcx = IMPLICIT_DEF116# CHECK-NEXT: dead renamable $rcx = IMPLICIT_DEF117# CHECK-NEXT: DBG_VALUE $noreg, $noreg, !18, !DIExpression()118 119# CHECK-LABEL: bb.3:120# CHECK: dead renamable $rcx = IMPLICIT_DEF121# CHECK-NEXT: DBG_VALUE $rcx, $noreg, !18, !DIExpression()122# CHECK-NEXT: DBG_VALUE 0, $noreg, !23, !DIExpression()123 124# CHECK-LABEL: bb.4:125# CHECK: liveins: $rax126# CHECK: DBG_VALUE $rax, $noreg, !18, !DIExpression()127# CHECK-NEXT: renamable $rax = BTS64ri8 killed renamable $rax, 0, implicit-def $eflags128# CHECK-NEXT: DBG_VALUE $rax, $noreg, !18, !DIExpression()129# CHECK-NEXT: DBG_VALUE 0, $noreg, !23, !DIExpression()130# CHECK-NEXT: renamable $rax = BTS64ri8 killed renamable $rax, 0, implicit-def $eflags131# CHECK-NEXT: DBG_VALUE $rax, $noreg, !18, !DIExpression()132# CHECK-NEXT: dead renamable $rax = BTS64ri8 killed renamable $rax, 0, implicit-def $eflags133 134# CHECK-LABEL: bb.5:135# CHECK-NEXT: RET 0136