1 # RUN: llc %s -o - -run-pass=livedebugvalues -mtriple=x86_64-unknown-unknown | FileCheck %s
2 # RUN: llc %s -o - -force-instr-ref-livedebugvalues=1 -run-pass=livedebugvalues -mtriple=x86_64-unknown-unknown | FileCheck %s
4 # In this lightly modified test case, the transfer in the entry block from
5 # geti32's return value in $eax to the non-volatile $ebx should be recognized,
6 # and propagated throughout the whole function.
8 # CHECK-LABEL: bb.0.entry
9 # CHECK: DBG_VALUE $eax
10 # CHECK: DBG_VALUE $ebx
11 # CHECK-LABEL: bb.1.loop2
12 # CHECK: DBG_VALUE $ebx
13 # CHECK-LABEL: bb.2.loop
14 # CHECK: DBG_VALUE $ebx
15 # CHECK-LABEL: bb.3.exit
16 # CHECK: DBG_VALUE $ebx
19 source_filename = "asdf.ll"
20 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 target triple = "x86_64-unknown-unknown"
29 declare void @escape(i32)
31 ; Function Attrs: nounwind readnone speculatable willreturn
32 declare void @llvm.dbg.value(metadata, metadata, metadata)
34 define i32 @foo() !dbg !4 {
36 %bar = call i32 @geti32(), !dbg !10
37 call void @llvm.dbg.value(metadata i32 %bar, metadata !9, metadata !DIExpression()), !dbg !10
40 loop: ; preds = %loop2, %entry
41 call void @escape(i32 %bar)
42 %retval = call i1 @booler(), !dbg !10
43 br i1 %retval, label %loop2, label %exit
45 loop2: ; preds = %loop
46 store i32 %bar, i32* @glob
53 ; Function Attrs: nounwind
54 declare void @llvm.stackprotector(i8*, i8**)
56 !llvm.module.flags = !{!0, !1}
59 !0 = !{i32 2, !"Debug Info Version", i32 3}
60 !1 = !{i32 2, !"Dwarf Version", i32 4}
61 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "beards", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
62 !3 = !DIFile(filename: "bees.cpp", directory: ".")
63 !4 = distinct !DISubprogram(name: "nope", scope: !3, file: !3, line: 1, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)
64 !5 = !DISubroutineType(types: !6)
66 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
68 !9 = !DILocalVariable(name: "toast", scope: !4, file: !3, line: 1, type: !7)
69 !10 = !DILocation(line: 1, scope: !4)
74 tracksRegLiveness: true
80 cvBytesOfCalleeSavedRegisters: 8
82 - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
83 callee-saved-register: '$rbx', callee-saved-restored: true, debug-info-variable: '',
84 debug-info-expression: '', debug-info-location: '' }
88 successors: %bb.1(0x80000000)
91 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp, debug-location !10
92 CFI_INSTRUCTION def_cfa_offset 16
93 CFI_INSTRUCTION offset $rbx, -16
94 CALL64pcrel32 @geti32, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !10
95 DBG_VALUE $eax, $noreg, !9, !DIExpression(), debug-location !10
96 $ebx = MOV32rr killed $eax, debug-location !10
103 MOV32mr $rip, 1, $noreg, @glob, $noreg, renamable $ebx :: (store (s32) into @glob)
106 successors: %bb.1, %bb.3
110 CALL64pcrel32 @escape, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit-def $rsp, implicit-def $ssp
111 CALL64pcrel32 @booler, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $al, debug-location !10
112 TEST8ri killed renamable $al, 1, implicit-def $eflags
113 JCC_1 %bb.1, 5, implicit $eflags
118 $eax = MOV32rr killed $ebx
119 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
120 CFI_INSTRUCTION def_cfa_offset 8