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