1--- |
2  ; RUN: llc %s -march=x86-64 -run-pass=livedebugvalues -o - | FileCheck %s -implicit-check-not=DBG_VALUE
3
4  ; Check that DBG_VALUE instructions are propagated into loops within loops.
5
6  ; CHECK-LABEL: bb.0.entry:
7  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
8  ; CHECK-LABEL: bb.1.bb1:
9  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
10  ; CHECK-LABEL: bb.2.bb2:
11  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
12  ; CHECK-LABEL: bb.3.bb3:
13  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
14  ; CHECK-LABEL: bb.4.bb4:
15  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
16  ; CHECK-LABEL: bb.5.bb5:
17  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
18
19  define i32 @_Z8bb_to_bb() local_unnamed_addr !dbg !12 {
20  entry:
21    br label %bb1, !dbg !17
22  bb1:
23    br label %bb2, !dbg !17
24  bb2:
25    br label %bb3, !dbg !17
26  bb3:
27    br label %bb3, !dbg !17
28  bb4:
29    br label %bb3, !dbg !17
30  bb5:
31    ret i32 0, !dbg !17
32  }
33
34  !llvm.dbg.cu = !{!0}
35  !llvm.module.flags = !{!7, !8, !9, !10}
36  !llvm.ident = !{!11}
37  !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3, debugInfoForProfiling: true, nameTableKind: None)
38  !1 = !DIFile(filename: "main.cpp", directory: "F:\")
39  !2 = !{}
40  !3 = !{!4}
41  !4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())
42  !5 = distinct !DIGlobalVariable(name: "start", scope: !0, file: !1, line: 4, type: !6, isLocal: false, isDefinition: true)
43  !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
44  !7 = !{i32 2, !"Dwarf Version", i32 4}
45  !8 = !{i32 2, !"Debug Info Version", i32 3}
46  !9 = !{i32 1, !"wchar_size", i32 2}
47  !10 = !{i32 7, !"PIC Level", i32 2}
48  !11 = !{!"clang version 10.0.0"}
49  !12 = distinct !DISubprogram(name: "bb_to_bb", linkageName: "bb_to_bb", scope: !1, file: !1, line: 6, type: !13, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)
50  !13 = !DISubroutineType(types: !14)
51  !14 = !{!6, !6}
52  !15 = !{!16}
53  !16 = !DILocalVariable(name: "myVar", scope: !12, file: !1, line: 7, type: !6)
54  !17 = !DILocation(line: 10, scope: !12)
55
56...
57---
58name: _Z8bb_to_bb
59body:  |
60  bb.0.entry:
61    successors: %bb.1
62    $ebx = MOV32ri 0, debug-location !17
63    DBG_VALUE $ebx, $noreg, !16, !DIExpression(), debug-location !17
64  bb.1.bb1:
65    successors: %bb.2, %bb.4
66    $eax = MOV32ri 0, debug-location !17
67    JCC_1 %bb.4, 4, implicit killed $eflags
68  bb.2.bb2:
69    successors: %bb.3
70    $eax = MOV32ri 0, debug-location !17
71  bb.3.bb3:
72    successors: %bb.2, %bb.4
73    $eax = MOV32ri 0, debug-location !17
74    JCC_1 %bb.2, 4, implicit killed $eflags
75  bb.4.bb4:
76    successors: %bb.1, %bb.5
77    $eax = MOV32ri 0, debug-location !17
78    JCC_1 %bb.1, 4, implicit killed $eflags
79  bb.5.bb5:
80    RETQ $eax, debug-location !17
81...
82