|
| 1 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -start-after=codegenprepare -stop-before=finalize-isel -o - %s -experimental-debug-variable-locations=false | FileCheck %s |
| 2 | + |
| 3 | +; Input to this test was created by reducing a Swift file using bugpoint |
| 4 | + |
| 5 | +; CHECK-DAG: ![[LHS:.*]] = !DILocalVariable(name: "lhs" |
| 6 | + |
| 7 | +define hidden i64 @"_wideDivide42"(ptr %0, ptr %1, ptr %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8) local_unnamed_addr !dbg !16 { |
| 8 | +; CHECK-LABEL: name: _wideDivide42 |
| 9 | +; CHECK-NOT: DBG_VALUE |
| 10 | +; CHECK: DBG_VALUE $rcx, $noreg, ![[LHS]], !DIExpression(DW_OP_LLVM_fragment, 0, 64) |
| 11 | +; CHECK-NEXT: DBG_VALUE $r8, $noreg, ![[LHS]], !DIExpression(DW_OP_LLVM_fragment, 64, 64) |
| 12 | +; CHECK-NEXT: DBG_VALUE $r9, $noreg, ![[LHS]], !DIExpression(DW_OP_LLVM_fragment, 128, 64) |
| 13 | +; CHECK-NEXT: DBG_VALUE %fixed-stack.{{.+}}, ![[LHS]], !DIExpression(DW_OP_LLVM_fragment, 192, 64) |
| 14 | +; The duplicates should be removed: |
| 15 | +; CHECK-NOT: DBG_VALUE |
| 16 | + |
| 17 | +entry: |
| 18 | + %9 = alloca i64, align 8 |
| 19 | + call void @llvm.dbg.value(metadata i64 %3, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64)), !dbg !67 |
| 20 | + call void @llvm.dbg.value(metadata i64 %4, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !67 |
| 21 | + call void @llvm.dbg.value(metadata i64 %3, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64)), !dbg !67 |
| 22 | + call void @llvm.dbg.value(metadata i64 %4, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !67 |
| 23 | + call void @llvm.dbg.value(metadata i64 %5, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 128, 64)), !dbg !67 |
| 24 | + call void @llvm.dbg.value(metadata i64 %6, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 192, 64)), !dbg !67 |
| 25 | + br i1 poison, label %11, label %10, !dbg !68 |
| 26 | + |
| 27 | +10: ; preds = %entry |
| 28 | + tail call void asm sideeffect "", "n"(i32 7) #7 |
| 29 | + unreachable |
| 30 | + |
| 31 | +11: ; preds = %entry |
| 32 | + tail call void @abort() |
| 33 | + unreachable |
| 34 | +} |
| 35 | + |
| 36 | +declare void @abort() |
| 37 | + |
| 38 | +declare void @llvm.dbg.value(metadata, metadata, metadata) |
| 39 | + |
| 40 | +attributes #7 = { nounwind } |
| 41 | + |
| 42 | +!llvm.dbg.cu = !{!0} |
| 43 | +!llvm.module.flags = !{!13} |
| 44 | +!llvm.linker.options = !{!14, !15} |
| 45 | + |
| 46 | +!0 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !1, producer: "Swift", isOptimized: true, runtimeVersion: 6, emissionKind: FullDebug) |
| 47 | +!1 = !DIFile(filename: "Int128.swift", directory: "") |
| 48 | +!13 = !{i32 2, !"Debug Info Version", i32 3} |
| 49 | +!14 = !{!"-lswiftCore"} |
| 50 | +!15 = !{!"-lobjc"} |
| 51 | +!16 = distinct !DISubprogram(name: "_wideDivide42", scope: !0, file: !1, line: 222, type: !17, scopeLine: 222, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !23) |
| 52 | +!17 = !DISubroutineType(types: !18) |
| 53 | +!18 = !{!19, !20, !20, !20, !20, !20, !20} |
| 54 | +!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "4 x UInt64", flags: DIFlagFwdDecl, runtimeLang: DW_LANG_Swift) |
| 55 | +!20 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "UInt64", scope: !1, file: !1, size: 64, elements: !22, runtimeLang: DW_LANG_Swift) |
| 56 | +!22 = !{} |
| 57 | +!23 = !{!24, !27} |
| 58 | +!24 = !DILocalVariable(name: "lhs", arg: 1, scope: !16, file: !1, line: 223, type: !25, flags: DIFlagArtificial) |
| 59 | +!25 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !26) |
| 60 | +!26 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "2 x 2 x UInt64", file: !1, size: 256, elements: !22, runtimeLang: DW_LANG_Swift) |
| 61 | +!27 = !DILocalVariable(name: "rhs", arg: 2, scope: !16, file: !1, line: 223, type: !28, flags: DIFlagArtificial) |
| 62 | +!28 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !29) |
| 63 | +!29 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "2 x UInt64", file: !1, size: 128, elements: !22, runtimeLang: DW_LANG_Swift) |
| 64 | +!67 = !DILocation(line: 0, scope: !16) |
| 65 | +!68 = !DILocation(line: 225, column: 9, scope: !16) |
0 commit comments