1 ; RUN: llc %s --stop-before=finalize-isel -o - | FileCheck %s --implicit-check-not=DBG_VALUE
3 ;; Check that when a debug value is invalidated during Instruction Selection,
4 ;; we produce an undef DBG_VALUE/DBG_VALUE_LIST.
8 ; CHECK: DBG_VALUE $noreg, $noreg, ![[VAR:[0-9]+]]
10 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
11 target triple = "x86_64-unknown-linux-gnu"
13 @intel_pmu_enable_bts_config = external dso_local local_unnamed_addr global i32, align 4, !dbg !0
15 define dso_local i32 @intel_pmu_enable_bts() local_unnamed_addr !dbg !16 {
17 %0 = extractvalue { i32, i64 } zeroinitializer, 1
18 %1 = load i32, i32* @intel_pmu_enable_bts_config, align 4
19 call void @llvm.dbg.value(metadata !DIArgList(i64 %0, i32 %1), metadata !20, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_or, DW_OP_stack_value)), !dbg !23
23 declare void @llvm.dbg.value(metadata, metadata, metadata)
26 !llvm.module.flags = !{!14, !15}
28 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
29 !1 = distinct !DIGlobalVariable(name: "intel_pmu_enable_bts_config", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
30 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 13.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
31 !3 = !DIFile(filename: "invalidated-dbg-value-is-undef.ll", directory: "/")
33 !5 = !{!0, !6, !9, !11}
34 !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
35 !7 = distinct !DIGlobalVariable(name: "intel_pmu_enable_bts___trans_tmp_1", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)
36 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
37 !9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())
38 !10 = distinct !DIGlobalVariable(name: "intel_pmu_enable_bts___ecx", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)
39 !11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression())
40 !12 = distinct !DIGlobalVariable(name: "intel_pmu_enable_bts___eax", scope: !2, file: !3, line: 3, type: !13, isLocal: false, isDefinition: true)
41 !13 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
42 !14 = !{i32 2, !"Debug Info Version", i32 3}
43 !15 = !{i32 7, !"uwtable", i32 1}
44 !16 = distinct !DISubprogram(name: "intel_pmu_enable_bts", scope: !3, file: !3, line: 4, type: !17, scopeLine: 4, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !19)
45 !17 = !DISubroutineType(types: !18)
48 !20 = !DILocalVariable(name: "debugctlmsr", scope: !16, file: !3, line: 5, type: !13)
49 !21 = !DILocalVariable(name: "low", scope: !16, file: !3, line: 17, type: !22)
50 !22 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
51 !23 = !DILocation(line: 0, scope: !16)