brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · 4e88630 Raw
99 lines · plain
1# RUN: llc --run-pass=livedebugvalues -o - %s | FileCheck %s --implicit-check-not=DBG_VALUE 2# REQUIRES: x86-registered-target3 4# This test covers the scenario where a DBG_VALUE created prior to LiveDebugValues has an entry-value expression.5# It ensures that a clobbered stack copy doesn't crash if used as an entry-value because entry-values can't be clobbered.6 7--- |8  target triple = "x86_64-"9 10  define i32 @baz(i32 swiftasync %arg1, i32 noundef %arg2, i1 %cond) !dbg !9 {11    tail call void @llvm.dbg.value(metadata i32 %arg1, metadata !17, metadata !DIExpression(DW_OP_LLVM_entry_value, 1)), !dbg !1912    br i1 %cond, label %if.then, label %if.else, !dbg !2213  if.then:14    %call = call i32 @foo(i32 noundef %arg1), !dbg !2315    br label %if.end, !dbg !2516  if.else:17    %call1 = call i32 @foo(i32 noundef %arg2), !dbg !2618    br label %if.end19  if.end:20    %temp.0 = phi i32 [ %call, %if.then ], [ %call1, %if.else ], !dbg !2821    ret i32 %temp.0, !dbg !2922  }23 24  declare i32 @foo(i32)25  declare void @llvm.dbg.value(metadata, metadata, metadata)26 27  !llvm.dbg.cu = !{!0}28  !llvm.module.flags = !{!2, !3}29 30  !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "ha", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)31  !1 = !DIFile(filename: "test.c", directory: "hah")32  !2 = !{i32 7, !"Dwarf Version", i32 4}33  !3 = !{i32 2, !"Debug Info Version", i32 3}34  !9 = distinct !DISubprogram(name: "baz", scope: !1, file: !1, line: 3, type: !10, scopeLine: 3, unit: !0, retainedNodes: !13)35  !10 = !DISubroutineType(types: !11)36  !11 = !{!12, !12, !12, !12}37  !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)38  !13 = !{!14, !15, !16, !17}39  !14 = !DILocalVariable(name: "arg1", arg: 1, scope: !9, file: !1, line: 3, type: !12)40  !15 = !DILocalVariable(name: "arg2", arg: 2, scope: !9, file: !1, line: 3, type: !12)41  !16 = !DILocalVariable(name: "cond", arg: 3, scope: !9, file: !1, line: 3, type: !12)42  !17 = !DILocalVariable(name: "local", scope: !9, file: !1, line: 4, type: !12)43  !19 = !DILocation(line: 0, scope: !9)44  !20 = !DILocation(line: 7, column: 7, scope: !21)45  !21 = distinct !DILexicalBlock(scope: !9, file: !1, line: 7, column: 7)46  !22 = !DILocation(line: 7, column: 7, scope: !9)47  !23 = !DILocation(line: 8, column: 12, scope: !24)48  !24 = distinct !DILexicalBlock(scope: !21, file: !1, line: 7, column: 13)49  !25 = !DILocation(line: 9, column: 3, scope: !24)50  !26 = !DILocation(line: 10, column: 12, scope: !27)51  !27 = distinct !DILexicalBlock(scope: !21, file: !1, line: 9, column: 10)52  !28 = !DILocation(line: 0, scope: !21)53  !29 = !DILocation(line: 13, column: 3, scope: !9)54 55...56---57name:            baz58alignment:       1659debugInstrRef: true60tracksDebugUserValues: true61liveins:62  - { reg: '$r14', virtual-reg: '' }63  - { reg: '$edi', virtual-reg: '' }64  - { reg: '$esi', virtual-reg: '' }65  - { reg: '$edx', virtual-reg: '' }66body:             |67  bb.0:68    successors: %bb.2(0x40000000), %bb.1(0x40000000)69    liveins: $r14, $edi, $edx, $esi70    DBG_VALUE $r14, $noreg, !14, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !1971    CMP32ri killed renamable $edx, 0, implicit-def $eflags, debug-location !2072    JCC_1 %bb.2, 4, implicit killed $eflags, debug-location !2273  bb.1.if.then:74    successors: %bb.3(0x80000000)75    liveins: $edi, $r1376    CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit-def $eax, debug-location !2377    $r14 = MOV64ri 0, debug-location !2078    JMP_1 %bb.3, debug-location !2579  bb.2.if.else:80    successors: %bb.3(0x80000000)81    liveins: $esi, $r1382    $edi = MOV32rr killed $esi, debug-location !2683    CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit-def $eax, debug-location !2684  bb.3.if.end:85    liveins: $eax86    $rbp = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !2987    RET64 implicit $eax, debug-location !2988# CHECK-LABEL: bb.0:89# CHECK: DBG_VALUE $r14, {{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1)90# CHECK-LABEL: bb.1.if.then:91# CHECK: DBG_VALUE $r14, {{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1)92# CHECK-NEXT: CALL64pcrel32 @foo93# CHECK-NEXT: $r14 = MOV64ri 094# CHECK-NOT: DBG_VALUE $r14, {{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1)95# CHECK-LABEL: bb.2.if.else:96# CHECK: DBG_VALUE $r14, {{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1)97# CHECK-LABEL: bb.3.if.end:98# CHECK: DBG_VALUE $r14, {{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1)99