brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · b78d268 Raw
55 lines · plain
1; RUN: llc %s -start-after=codegenprepare -stop-after=finalize-isel -o - | FileCheck %s2 3; PR39896: When code such as %conv below is dropped by SelectionDAG for having4; no users, don't just drop the dbg.value record associated with it. Instead,5; the corresponding variable should receive a "DBG_VALUE" undef to terminate6; earlier variable live ranges.7 8; ModuleID = 'run.c'9source_filename = "run.c"10target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"11target triple = "x86_64-apple-macosx10.14.0"12 13@a = global i8 25, align 1, !dbg !014 15define signext i16 @b() !dbg !12 {16entry:17; CHECK: DBG_VALUE 23680, $noreg, ![[VARNUM:[0-9]+]],18  call void @llvm.dbg.value(metadata i16 23680, metadata !17, metadata !DIExpression()), !dbg !1819  %0 = load i8, ptr @a, align 1, !dbg !1820  %conv = sext i8 %0 to i16, !dbg !1821; CHECK: DBG_VALUE $noreg, $noreg, ![[VARNUM]],22  call void @llvm.dbg.value(metadata i16 %conv, metadata !17, metadata !DIExpression()), !dbg !1823  %call = call i32 (...) @optimize_me_not(), !dbg !1824  %1 = load i8, ptr @a, align 1, !dbg !1825  %conv1 = sext i8 %1 to i16, !dbg !1826  ret i16 %conv1, !dbg !1827}28declare i32 @optimize_me_not(...)29 30declare void @llvm.dbg.value(metadata, metadata, metadata)31 32!llvm.dbg.cu = !{!2}33!llvm.module.flags = !{!7, !8, !9, !10}34!llvm.ident = !{!11}35 36!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())37!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)38!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 8.0.0 (trunk 348101) (llvm/trunk 348109)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: GNU)39!3 = !DIFile(filename: "run.c", directory: "/Users/dcci/work/llvm/build-debug/bin")40!4 = !{}41!5 = !{!0}42!6 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)43!7 = !{i32 2, !"Dwarf Version", i32 4}44!8 = !{i32 2, !"Debug Info Version", i32 3}45!9 = !{i32 1, !"wchar_size", i32 4}46!10 = !{i32 7, !"PIC Level", i32 2}47!11 = !{!"clang version something"}48!12 = distinct !DISubprogram(name: "b", scope: !3, file: !3, line: 2, type: !13, scopeLine: 2, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !16)49!13 = !DISubroutineType(types: !14)50!14 = !{!15}51!15 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)52!16 = !{!17}53!17 = !DILocalVariable(name: "i", scope: !12, file: !3, line: 3, type: !15)54!18 = !DILocation(line: 3, scope: !12)55