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 not propagated into loops with inner
5  ; loops that move their locations.
6
7  ; CHECK-LABEL: bb.0.entry:
8  ; CHECK:       DBG_VALUE $ebx, $noreg, !16, !DIExpression()
9  ; CHECK-LABEL: bb.3.bb3:
10  ; CHECK:       DBG_VALUE $eax, $noreg, !16, !DIExpression()
11
12  define i32 @_Z8bb_to_bb() local_unnamed_addr !dbg !12 {
13  entry:
14    br label %bb1, !dbg !17
15  bb1:
16    br label %bb2, !dbg !17
17  bb2:
18    br label %bb3, !dbg !17
19  bb3:
20    br label %bb3, !dbg !17
21  bb4:
22    br label %bb3, !dbg !17
23  bb5:
24    ret i32 0, !dbg !17
25  }
26
27  !llvm.dbg.cu = !{!0}
28  !llvm.module.flags = !{!7, !8, !9, !10}
29  !llvm.ident = !{!11}
30  !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)
31  !1 = !DIFile(filename: "main.cpp", directory: "F:\")
32  !2 = !{}
33  !3 = !{!4}
34  !4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())
35  !5 = distinct !DIGlobalVariable(name: "start", scope: !0, file: !1, line: 4, type: !6, isLocal: false, isDefinition: true)
36  !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
37  !7 = !{i32 2, !"Dwarf Version", i32 4}
38  !8 = !{i32 2, !"Debug Info Version", i32 3}
39  !9 = !{i32 1, !"wchar_size", i32 2}
40  !10 = !{i32 7, !"PIC Level", i32 2}
41  !11 = !{!"clang version 10.0.0"}
42  !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)
43  !13 = !DISubroutineType(types: !14)
44  !14 = !{!6, !6}
45  !15 = !{!16}
46  !16 = !DILocalVariable(name: "myVar", scope: !12, file: !1, line: 7, type: !6)
47  !17 = !DILocation(line: 10, scope: !12)
48
49...
50---
51name: _Z8bb_to_bb
52body:  |
53  bb.0.entry:
54    successors: %bb.1
55    $ebx = MOV32ri 0, debug-location !17
56    DBG_VALUE $ebx, $noreg, !16, !DIExpression(), debug-location !17
57  bb.1.bb1:
58    successors: %bb.2, %bb.4
59    $eax = MOV32ri 0, debug-location !17
60    JCC_1 %bb.4, 4, implicit killed $eflags
61  bb.2.bb2:
62    successors: %bb.3
63    $eax = MOV32ri 0, debug-location !17
64  bb.3.bb3:
65    successors: %bb.2, %bb.4
66    $eax = MOV32ri 0, debug-location !17
67    DBG_VALUE $eax, $noreg, !16, !DIExpression(), debug-location !17
68    JCC_1 %bb.2, 4, implicit killed $eflags
69  bb.4.bb4:
70    successors: %bb.1, %bb.5
71    $eax = MOV32ri 0, debug-location !17
72    JCC_1 %bb.1, 4, implicit killed $eflags
73  bb.5.bb5:
74    RETQ $eax, debug-location !17
75...
76