1; RUN: llc -stop-after=livedebugvars < %s | FileCheck %s 2; ModuleID = 'debug_value-i8.bc' 3source_filename = "debug_value.c" 4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" 5target triple = "aarch64" 6 7; When ISel promotes the result of i8 add, the attached dbg.value shouldn't be dropped. 8; CHECK: DBG_VALUE 9; Function Attrs: nounwind 10define dso_local i32 @bar(i32*, i32) local_unnamed_addr #0 !dbg !10 { 11 %3 = trunc i32 %1 to i8, !dbg !20 12 %4 = add i8 %3, 97, !dbg !20 13 call void @llvm.dbg.value(metadata i8 %4, metadata !17, metadata !DIExpression()), !dbg !21 14 %5 = zext i8 %4 to i32, !dbg !22 15 tail call void @foo1(i32* %0, i32 %5) #2, !dbg !23 16 tail call void @foo2(i32* %0, i8 %4) #2, !dbg !24 17 ret i32 undef, !dbg !25 18} 19 20declare dso_local void @foo1(i32*, i32) local_unnamed_addr 21 22declare dso_local void @foo2(i32*, i8) local_unnamed_addr 23 24; Function Attrs: nounwind readnone speculatable 25declare void @llvm.dbg.value(metadata, metadata, metadata) #1 26 27attributes #0 = { nounwind } 28attributes #1 = { nounwind readnone speculatable } 29attributes #2 = { nounwind } 30 31!llvm.dbg.cu = !{!0} 32!llvm.module.flags = !{!6, !7, !8} 33!llvm.ident = !{!9} 34 35!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 7.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3) 36!1 = !DIFile(filename: "debug_value.c", directory: "./") 37!2 = !{} 38!3 = !{!4, !5} 39!4 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char) 40!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 41!6 = !{i32 2, !"Dwarf Version", i32 4} 42!7 = !{i32 2, !"Debug Info Version", i32 3} 43!8 = !{i32 1, !"wchar_size", i32 4} 44!9 = !{!"clang version 7.0.0"} 45!10 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 16, type: !11, isLocal: false, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !14) 46!11 = !DISubroutineType(types: !12) 47!12 = !{!5, !13, !5} 48!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64) 49!14 = !{!15, !16, !17} 50!15 = !DILocalVariable(name: "a", arg: 1, scope: !10, file: !1, line: 16, type: !13) 51!16 = !DILocalVariable(name: "b", arg: 2, scope: !10, file: !1, line: 16, type: !5) 52!17 = !DILocalVariable(name: "t", scope: !10, file: !1, line: 17, type: !4) 53!18 = !DILocation(line: 16, column: 14, scope: !10) 54!19 = !DILocation(line: 16, column: 21, scope: !10) 55!20 = !DILocation(line: 17, column: 11, scope: !10) 56!21 = !DILocation(line: 17, column: 7, scope: !10) 57!22 = !DILocation(line: 18, column: 10, scope: !10) 58!23 = !DILocation(line: 18, column: 2, scope: !10) 59!24 = !DILocation(line: 19, column: 2, scope: !10) 60!25 = !DILocation(line: 20, column: 1, scope: !10) 61