124 lines · plain
1# RUN: llc %s -o - -run-pass=livedebugvalues -mtriple=x86_64-unknown-unknown | FileCheck %s2# RUN: llc %s -o - -force-instr-ref-livedebugvalues=1 -run-pass=livedebugvalues -mtriple=x86_64-unknown-unknown | FileCheck %s3#4# In this lightly modified test case, the transfer in the entry block from5# geti32's return value in $eax to the non-volatile $ebx should be recognized,6# and propagated throughout the whole function.7#8# CHECK-LABEL: bb.0.entry9# CHECK: DBG_VALUE $eax10# CHECK: DBG_VALUE $ebx11# CHECK-LABEL: bb.1.loop212# CHECK: DBG_VALUE $ebx13# CHECK-LABEL: bb.2.loop14# CHECK: DBG_VALUE $ebx15# CHECK-LABEL: bb.3.exit16# CHECK: DBG_VALUE $ebx17--- |18 ; ModuleID = 'asdf'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"22 23 @glob = global i32 024 25 declare i1 @booler()26 27 declare i32 @geti32()28 29 declare void @escape(i32)30 31 ; Function Attrs: nounwind readnone speculatable willreturn32 declare void @llvm.dbg.value(metadata, metadata, metadata)33 34 define i32 @foo() !dbg !4 {35 entry:36 %bar = call i32 @geti32(), !dbg !1037 call void @llvm.dbg.value(metadata i32 %bar, metadata !9, metadata !DIExpression()), !dbg !1038 br label %loop39 40 loop: ; preds = %loop2, %entry41 call void @escape(i32 %bar)42 %retval = call i1 @booler(), !dbg !1043 br i1 %retval, label %loop2, label %exit44 45 loop2: ; preds = %loop46 store i32 %bar, ptr @glob47 br label %loop48 49 exit: ; preds = %loop50 ret i32 %bar51 }52 53 ; Function Attrs: nounwind54 declare void @llvm.stackprotector(ptr, ptr)55 56 !llvm.module.flags = !{!0, !1}57 !llvm.dbg.cu = !{!2}58 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)65 !6 = !{!7}66 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)67 !8 = !{!9}68 !9 = !DILocalVariable(name: "toast", scope: !4, file: !3, line: 1, type: !7)69 !10 = !DILocation(line: 1, scope: !4)70 71...72---73name: foo74tracksRegLiveness: true75frameInfo:76 stackSize: 877 offsetAdjustment: -878 adjustsStack: true79 hasCalls: true80 cvBytesOfCalleeSavedRegisters: 881fixedStack: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: '' }85stack: []86body: |87 bb.0.entry:88 successors: %bb.1(0x80000000)89 liveins: $rbx90 91 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp, debug-location !1092 CFI_INSTRUCTION def_cfa_offset 1693 CFI_INSTRUCTION offset $rbx, -1694 CALL64pcrel32 @geti32, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !1095 DBG_VALUE $eax, $noreg, !9, !DIExpression(), debug-location !1096 $ebx = MOV32rr killed $eax, debug-location !1097 JMP_1 %bb.198 99 bb.1.loop2:100 successors: %bb.2101 liveins: $ebx102 103 MOV32mr $rip, 1, $noreg, @glob, $noreg, renamable $ebx :: (store (s32) into @glob)104 105 bb.2.loop:106 successors: %bb.1, %bb.3107 liveins: $ebx108 109 $edi = MOV32rr $ebx110 CALL64pcrel32 @escape, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit-def $rsp, implicit-def $ssp111 CALL64pcrel32 @booler, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $al, debug-location !10112 TEST8ri killed renamable $al, 1, implicit-def $eflags113 JCC_1 %bb.1, 5, implicit $eflags114 115 bb.3.exit:116 liveins: $ebx117 118 $eax = MOV32rr killed $ebx119 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp120 CFI_INSTRUCTION def_cfa_offset 8121 RET64 $eax122 123...124