brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.8 KiB · 807743e Raw
142 lines · plain
1# We do not support the call site info for the target now, so we use the experimental option (-emit-call-site-info -debug-entry-values).2 3# RUN: llc -emit-call-site-info -debug-entry-values -run-pass=livedebugvalues -o - %s | FileCheck %s4# RUN: llc -emit-call-site-info -debug-entry-values -force-instr-ref-livedebugvalues=1 -run-pass=livedebugvalues -o - %s | FileCheck %s5 6# Verify that the entry values for the input parameters are inserted after the7# bundles which contains the registers' clobbering instructions (the calls to8# @clobber). Previously the insertions would thrash the bundles, later on9# triggering a crash in DebugHandlerBase.10 11--- |12  target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"13  target triple = "hexagon"14 15  ; Function Attrs: nounwind16  define i32 @foo(i32 %arg) !dbg !12 {17  entry:18    call void @llvm.dbg.value(metadata i32 %arg, metadata !16, metadata !DIExpression()), !dbg !1719    %call = tail call i32 @clobber(), !dbg !1820    ret i32 1, !dbg !1921  }22 23  declare !dbg !4 i32 @clobber()24 25  ; Function Attrs: nounwind26  define i32 @bar(i32 %b) !dbg !20 {27  entry:28    call void @llvm.dbg.value(metadata i32 %b, metadata !22, metadata !DIExpression()), !dbg !2329    %tobool = icmp eq i32 %b, 0, !dbg !2430    br i1 %tobool, label %land.end, label %land.rhs, !dbg !2431 32  land.rhs:                                         ; preds = %entry33    %call = tail call i32 @clobber(), !dbg !2534    br label %land.end35 36  land.end:                                         ; preds = %entry, %land.rhs37    ret i32 undef, !dbg !2738  }39 40  ; Function Attrs: nounwind readnone speculatable41  declare void @llvm.dbg.value(metadata, metadata, metadata) #042 43  attributes #0 = { nounwind readnone speculatable }44 45  !llvm.dbg.cu = !{!0}46  !llvm.module.flags = !{!8, !9, !10}47  !llvm.ident = !{!11}48 49  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)50  !1 = !DIFile(filename: "foo.c", directory: "/")51  !2 = !{}52  !3 = !{!4}53  !4 = !DISubprogram(name: "clobber", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)54  !5 = !DISubroutineType(types: !6)55  !6 = !{!7}56  !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)57  !8 = !{i32 2, !"Dwarf Version", i32 4}58  !9 = !{i32 2, !"Debug Info Version", i32 3}59  !10 = !{i32 1, !"wchar_size", i32 4}60  !11 = !{!"clang version 10.0.0"}61  !12 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !13, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)62  !13 = !DISubroutineType(types: !14)63  !14 = !{!7, !7}64  !15 = !{!16}65  !16 = !DILocalVariable(name: "arg", arg: 1, scope: !12, file: !1, line: 3, type: !7)66  !17 = !DILocation(line: 0, scope: !12)67  !18 = !DILocation(line: 4, scope: !12)68  !19 = !DILocation(line: 5, scope: !12)69  !20 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 8, type: !13, scopeLine: 8, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !21)70  !21 = !{!22}71  !22 = !DILocalVariable(name: "arg", arg: 1, scope: !20, file: !1, line: 8, type: !7)72  !23 = !DILocation(line: 0, scope: !20)73  !24 = !DILocation(line: 9, scope: !20)74  !25 = !DILocation(line: 9, scope: !26)75  !26 = distinct !DILexicalBlock(scope: !20, file: !1, line: 9)76  !27 = !DILocation(line: 10, scope: !20)77 78...79---80name:            foo81tracksRegLiveness: true82body:             |83  bb.0.entry:84    DBG_VALUE $r0, $noreg, !16, !DIExpression(), debug-location !1785    CFI_INSTRUCTION def_cfa $r30, 886    CFI_INSTRUCTION offset $r31, -487    CFI_INSTRUCTION offset $r30, -888    BUNDLE implicit-def $r29, implicit-def $r30, implicit-def dead $pc, implicit-def dead $r31, implicit-def dead $r0, implicit $r29, implicit killed $framekey, implicit killed $framelimit, implicit killed $r30, implicit killed $r31, debug-location !18 {89      $r29 = S2_allocframe $r29, 0, implicit-def $r30, implicit killed $framekey, implicit killed $framelimit, implicit killed $r30, implicit killed $r31, debug-location !18 :: (store (s32) into stack)90      J2_call @clobber, hexagoncsr, implicit-def dead $pc, implicit-def dead $r31, implicit internal killed $r29, implicit-def $r29, implicit-def dead $r0, debug-location !1891    }92    BUNDLE implicit-def dead $r0, implicit-def $d15, implicit-def $r30, implicit-def $r31, implicit-def $pc, implicit-def $r29, implicit killed $r30, implicit killed $framekey, debug-location !19 {93      $r0 = A2_tfrsi 1, debug-location !1994      $d15 = L4_return killed $r30, implicit-def $pc, implicit-def $r29, implicit killed $framekey, implicit-def dead $pc, implicit internal killed $r0, debug-location !1995    }96 97...98 99# CHECK-LABEL: name: foo100# CHECK: BUNDLE101# CHECK-NEXT: $r29 = S2_allocframe $r29, 0102# CHECK-NEXT: J2_call @clobber103# CHECK-NEXT: }104# CHECK-NEXT: DBG_VALUE $r0, $noreg, !16, !DIExpression(DW_OP_LLVM_entry_value, 1)105 106---107name:            bar108tracksRegLiveness: true109liveins:110  - { reg: '$r0' }111body:             |112  bb.0.entry:113    successors: %bb.1114    liveins: $r0115 116    DBG_VALUE $r0, $noreg, !22, !DIExpression(), debug-location !23117    BUNDLE implicit-def dead $p0, implicit-def $pc, implicit killed $r0, implicit killed $r31, debug-location !24 {118      renamable $p0 = C2_cmpeqi killed renamable $r0, 0, debug-location !24119      PS_jmprettnew internal killed $p0, killed $r31, implicit-def $pc, implicit-def $pc, implicit killed undef $r0, debug-location !27120    }121 122  bb.1.land.rhs:123    CFI_INSTRUCTION def_cfa $r30, 8124    CFI_INSTRUCTION offset $r31, -4125    CFI_INSTRUCTION offset $r30, -8126    BUNDLE implicit-def $r29, implicit-def $r30, implicit-def $pc, implicit-def $r31, implicit-def dead $r0, implicit $r29, implicit killed $framekey, implicit killed $framelimit, implicit killed $r30, implicit killed $r31, debug-location !25 {127      $r29 = S2_allocframe $r29, 0, implicit-def $r30, implicit killed $framekey, implicit killed $framelimit, implicit killed $r30, implicit killed $r31, debug-location !25 :: (store (s32) into stack)128      J2_call @clobber, hexagoncsr, implicit-def $pc, implicit-def $r31, implicit internal killed $r29, implicit-def $r29, implicit-def dead $r0, debug-location !25129    }130    $d15 = L2_deallocframe killed $r30, implicit-def $r29, implicit killed $framekey131    PS_jmpret killed $r31, implicit-def $pc, implicit killed undef $r0, debug-location !27132 133...134 135# CHECK-LABEL: name: bar136# CHECK: BUNDLE137# CHECK: BUNDLE138# CHECK-NEXT: $r29 = S2_allocframe $r29, 0139# CHECK-NEXT: J2_call @clobber140# CHECK-NEXT: }141# CHECK-NEXT: DBG_VALUE $r0, $noreg, !22, !DIExpression(DW_OP_LLVM_entry_value, 1)142