1 # RUN: llc %s -mtriple=x86_64-unknown-unknown -o - -run-pass=livedebugvalues | FileCheck %s --implicit-check-not=DBG_VALUE
3 # Test that the DBG_VALUE of ecx below does not get propagated. It is considered
4 # live-in on LiveDebugValues' first pass through the loop, but on the second it
5 # should be removed from the InLocs set because it gets clobbered inside the
6 # loop. There should be no transfer from ecx to ebx -- this is ensured by the
7 # FileCheck implicit-check-not option.
9 # FIXME: we successfully prevent the false location (ebx) from being
10 # propagated into block 2, but the original transfer isn't yet eliminated.
11 # Thus we get no DBG_VALUe in block 2, but an invalid one in block 1.
13 # CHECK-LABEL: name: foo
14 # CHECK-LABEL: bb.0.entry:
15 # CHECK: $ecx = MOV32ri 0
16 # CHECK-NEXT: DBG_VALUE
17 # CHECK-LABEL: bb.1.loop:
18 # CHECK: $ebx = COPY killed $ecx
19 # CHECK-NEXT: DBG_VALUE
22 source_filename = "live-debug-values-remove-range.ll"
23 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
25 declare void @llvm.dbg.value(metadata, metadata, metadata)
27 define i32 @foo(i32 %bar) !dbg !4 {
36 !llvm.module.flags = !{!0, !1}
39 !0 = !{i32 2, !"Debug Info Version", i32 3}
40 !1 = !{i32 2, !"Dwarf Version", i32 4}
41 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "beards", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
42 !3 = !DIFile(filename: "bees.cpp", directory: ".")
43 !4 = distinct !DISubprogram(name: "nope", scope: !3, file: !3, line: 1, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)
44 !5 = !DISubroutineType(types: !6)
46 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
48 !9 = !DILocalVariable(name: "thin", scope: !4, file: !3, line: 1, type: !7)
49 !10 = !DILocation(line: 1, scope: !4)
55 tracksRegLiveness: true
65 cvBytesOfCalleeSavedRegisters: 8
67 - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$rbx' }
68 machineFunctionInfo: {}
73 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
74 CFI_INSTRUCTION def_cfa_offset 16
75 CFI_INSTRUCTION offset $rbx, -16
79 DBG_VALUE $ecx, $noreg, !9, !DIExpression(), debug-location !10
84 successors: %bb.1, %bb.2
85 liveins: $ebx, $eax, $ecx, $edi, $esi
88 $ebx = COPY killed $ecx
89 $ecx = COPY killed $edi
90 $edi = COPY killed $esi
92 TEST8ri killed renamable $al, 1, implicit-def $eflags
93 JCC_1 %bb.1, 5, implicit killed $eflags
98 $eax = MOV32rr killed $ebx
99 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
100 CFI_INSTRUCTION def_cfa_offset 8