73 lines · plain
1# RUN: llc -global-isel=1 -O0 -run-pass=aarch64-O0-prelegalizer-combiner %s -o - -verify-machineinstrs | FileCheck %s --check-prefix=CHECK2 3--- |4 ; ModuleID = 'salvage-debug-info-dead.mir'5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"6 target triple = "aarch64--"7 8 @A = global i8 12349 10 declare external i128 @foo()11 12 define void @main() !dbg !6 {13 ret void14 }15 16 !llvm.dbg.cu = !{!2}17 !llvm.module.flags = !{!10, !11, !12}18 !llvm.ident = !{!20}19 20 !1 = distinct !DIGlobalVariable(name: "A", scope: !2, file: !3, line: 1, type: !7, isLocal: false, isDefinition: true)21 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)22 !3 = !DIFile(filename: "test.ll", directory: "/")23 !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)24 !8 = !DISubroutineType(types: !23)25 !9 = distinct !DIGlobalVariable(name: "C", scope: !2, file: !3, line: 3, type: !7, isLocal: false, isDefinition: true)26 !10 = !{i32 7, !"Dwarf Version", i32 4}27 !11 = !{i32 2, !"Debug Info Version", i32 3}28 !12 = !{i32 1, !"wchar_size", i32 4}29 !20 = !{!"clang"}30 !6 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24)31 !23 = !{!7}32 !24 = !{}33 !25 = !DILocalVariable(name: "X", scope: !6, file: !3, line: 6, type: !7)34 !42 = !DILocalVariable(name: "Y", scope: !6, file: !3, line: 12, type: !7)35 !52 = !DILocalVariable(name: "Z", scope: !6, file: !3, line: 16, type: !7)36 !56 = !DILocalVariable(name: "W", scope: !6, file: !3, line: 18, type: !7)37 !57 = !DILocalVariable(name: "P", scope: !6, file: !3, line: 18, type: !7)38...39---40# Check that we salvage debug information for instructions41# deleted as dead in Combiner pass42name: main43tracksRegLiveness: true44body: |45 ; CHECK-LABEL: name: main46 ; CHECK: bb.0:47 ; CHECK: liveins: $x048 ; CHECK-NEXT: {{ $}}49 ; CHECK-NEXT: DBG_VALUE $x0, $noreg, {{.*}}, !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_stack_value), debug-location !DILocation(line: 6, column: 7, scope: !6)50 ; CHECK-NEXT: DBG_VALUE $x0, $noreg, {{.*}}, !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_stack_value), debug-location !DILocation(line: 7, column: 7, scope: !6)51 ; CHECK-NEXT: DBG_VALUE $x0, $noreg, {{.*}}, !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_LLVM_convert, 8, DW_ATE_unsigned, DW_OP_stack_value), debug-location !DILocation(line: 8, column: 7, scope: !6)52 ; CHECK: bb.1:53 ; CHECK-NEXT: DBG_VALUE $x0, $noreg, {{.*}}, !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_stack_value), debug-location !DILocation(line: 9, column: 7, scope: !6)54 ; CHECK-NEXT: DBG_VALUE %4:_(s32), 0, {{.*}}, !DIExpression(), debug-location !DILocation(line: 9, column: 7, scope: !6)55 bb.0:56 liveins: $x057 %0:_(s64) = COPY $x058 %1:_(s32) = G_TRUNC %0:_(s64)59 DBG_VALUE %1:_(s32), $noreg, !25, !DIExpression(), debug-location !DILocation(line: 6, column: 7, scope: !6)60 61 %2:_(s16) = G_TRUNC %1:_(s32)62 DBG_VALUE %2:_(s16), $noreg, !42, !DIExpression(), debug-location !DILocation(line: 7, column: 7, scope: !6)63 64 %3:_(s8) = G_TRUNC %2:_(s16)65 DBG_VALUE %3:_(s8), $noreg, !52, !DIExpression(), debug-location !DILocation(line: 8, column: 7, scope: !6)66 67 bb.1:68 %4:_(s32) = G_TRUNC %0:_(s64)69 DBG_VALUE %4:_(s32), $noreg, !56, !DIExpression(), debug-location !DILocation(line: 9, column: 7, scope: !6)70 DBG_VALUE %4:_(s32), 0, !57, !DIExpression(), debug-location !DILocation(line: 9, column: 7, scope: !6)71 72...73