101 lines · plain
1# RUN: llc %s -mtriple=x86_64-unknown-unknown -o - -run-pass=livedebugvalues -experimental-debug-variable-locations=true | FileCheck %s -check-prefix=NEWLDV --implicit-check-not=DBG_VALUE2#3# Test that the DBG_VALUE of ecx below does not get propagated. It is considered4# live-in on LiveDebugValues' first pass through the loop, but on the second it5# should be removed from the InLocs set because it gets clobbered inside the6# loop. There should be no transfer from ecx to ebx -- this is ensured by the7# FileCheck implicit-check-not option.8#9# An identical test in llvm/test/DebugInfo/MIR/X86/live-debug-values-bad-transfer2.mir10# checks this for VarLocBasedLDV.11#12# NEWLDV-LABEL: name: foo13# NEWLDV-LABEL: bb.0.entry:14# NEWLDV: $ecx = MOV32ri 015# NEWLDV-NEXT: DBG_VALUE16 17--- |18 source_filename = "live-debug-values-remove-range.ll"19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"20 21 declare void @llvm.dbg.value(metadata, metadata, metadata)22 23 define i32 @foo(i32 %bar) !dbg !4 {24 entry:25 br label %loop26 loop:27 br label %loop28 exit:29 ret i32 %bar30 }31 32 !llvm.module.flags = !{!0, !1}33 !llvm.dbg.cu = !{!2}34 35 !0 = !{i32 2, !"Debug Info Version", i32 3}36 !1 = !{i32 2, !"Dwarf Version", i32 4}37 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "beards", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)38 !3 = !DIFile(filename: "bees.cpp", directory: ".")39 !4 = distinct !DISubprogram(name: "nope", scope: !3, file: !3, line: 1, type: !5, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)40 !5 = !DISubroutineType(types: !6)41 !6 = !{!7}42 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)43 !8 = !{!9}44 !9 = !DILocalVariable(name: "thin", scope: !4, file: !3, line: 1, type: !7)45 !10 = !DILocation(line: 1, scope: !4)46 47...48---49name: foo50alignment: 451tracksRegLiveness: true52debugInstrRef: true53liveins:54 - { reg: '$edi' }55frameInfo:56 stackSize: 857 offsetAdjustment: -858 maxAlignment: 159 adjustsStack: true60 hasCalls: true61 maxCallFrameSize: 062 cvBytesOfCalleeSavedRegisters: 863fixedStack:64 - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$rbx' }65machineFunctionInfo: {}66body: |67 bb.0.entry:68 liveins: $edi, $rbx69 70 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp71 CFI_INSTRUCTION def_cfa_offset 1672 CFI_INSTRUCTION offset $rbx, -1673 $ebx = MOV32rr $edi74 $eax = MOV32ri 0, debug-location !1075 $ecx = MOV32ri 0, debug-location !1076 DBG_VALUE $ecx, $noreg, !9, !DIExpression(), debug-location !1077 $edi = MOV32ri 0, debug-location !1078 $esi = MOV32ri 0, debug-location !1079 80 bb.1.loop:81 successors: %bb.1, %bb.282 liveins: $ebx, $eax, $ecx, $edi, $esi83 84 $eax = COPY $ecx, debug-location !1085 $ebx = COPY killed $ecx, debug-location !1086 $ecx = COPY killed $edi, debug-location !1087 $edi = COPY killed $esi, debug-location !1088 $esi = MOV32ri 1, debug-location !1089 TEST8ri killed renamable $al, 1, implicit-def $eflags90 JCC_1 %bb.1, 5, implicit killed $eflags, debug-location !1091 92 bb.2.exit:93 liveins: $ebx94 95 $eax = MOV32rr killed $ebx, debug-location !1096 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp97 CFI_INSTRUCTION def_cfa_offset 898 RET64 $eax, debug-location !1099 100...101