Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp =================================================================== --- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -5227,7 +5227,7 @@ RegsToPass.emplace_back(VA.getLocReg(), Arg); RegsUsed.insert(VA.getLocReg()); const TargetOptions &Options = DAG.getTarget().Options; - if (Options.EmitCallSiteInfo) + if (Options.EmitCallSiteInfo && !Arg.isUndef()) CSInfo.emplace_back(VA.getLocReg(), i); } } else { Index: llvm/lib/Target/ARM/ARMISelLowering.cpp =================================================================== --- llvm/lib/Target/ARM/ARMISelLowering.cpp +++ llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -2385,7 +2385,7 @@ isThisReturn = true; } const TargetOptions &Options = DAG.getTarget().Options; - if (Options.EmitCallSiteInfo) + if (Options.EmitCallSiteInfo && !Arg.isUndef()) CSInfo.emplace_back(VA.getLocReg(), i); RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); } else if (isByVal) { Index: llvm/lib/Target/Mips/MipsISelLowering.cpp =================================================================== --- llvm/lib/Target/Mips/MipsISelLowering.cpp +++ llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -3344,7 +3344,7 @@ // Collect CSInfo about which register passes which parameter. const TargetOptions &Options = DAG.getTarget().Options; - if (Options.SupportsDebugEntryValues) + if (Options.SupportsDebugEntryValues && !Arg.isUndef()) CSInfo.emplace_back(VA.getLocReg(), i); continue; Index: llvm/lib/Target/X86/X86ISelLowering.cpp =================================================================== --- llvm/lib/Target/X86/X86ISelLowering.cpp +++ llvm/lib/Target/X86/X86ISelLowering.cpp @@ -4092,7 +4092,7 @@ } else if (VA.isRegLoc()) { RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); const TargetOptions &Options = DAG.getTarget().Options; - if (Options.EmitCallSiteInfo) + if (Options.EmitCallSiteInfo && !Arg.isUndef()) CSInfo.emplace_back(VA.getLocReg(), I); if (isVarArg && IsWin64) { // Win64 ABI requires argument XMM reg to be copied to the corresponding Index: llvm/test/CodeGen/AArch64/dbg-call-site-undef-params.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/AArch64/dbg-call-site-undef-params.ll @@ -0,0 +1,80 @@ +; RUN: llc -mtriple=aarch64-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s + +;; Compiled from source: +;; extern int fn1 (long int x, long int y, long int z); +;; __attribute__((noinline)) long int +;; fn2 (long int a, long int b, long int c) +;; { +;; long int q = 2 * a; +;; return fn1 (5, 6, 7); +;; } +;; int main(void) { +;; return fn2(14, 23, 34); +;; } +;; Using command: +;; clang -g -O2 m.c -target aarch64-linux-gnu -emit-llvm -S -c + +;; Verify that call site info is not created for parameters marked as "undef". +; CHECK: name: main +; CHECK: callSites: +; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [] +; CHECK-NOT: arg: 0 +; CHECK-NOT: arg: 1 +; CHECK-NOT: arg: 2 + +; ModuleID = 'm.c' +source_filename = "m.c" +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-unknown-linux-gnu" + +; Function Attrs: noinline nounwind +define dso_local i64 @fn2(i64 %a, i64 %b, i64 %c) local_unnamed_addr !dbg !7 { +entry: + call void @llvm.dbg.value(metadata i64 undef, metadata !15, metadata !DIExpression()), !dbg !16 + %call = tail call i32 @fn1(i64 5, i64 6, i64 7), !dbg !16 + %conv = sext i32 %call to i64, !dbg !16 + ret i64 %conv, !dbg !16 +} + +declare !dbg !19 dso_local i32 @fn1(i64, i64, i64) local_unnamed_addr + +; Function Attrs: nounwind +define dso_local i32 @main() local_unnamed_addr !dbg !23 { +entry: + %call = tail call i64 @fn2(i64 undef, i64 undef, i64 undef), !dbg !26 + %conv = trunc i64 %call to i32, !dbg !26 + ret i32 %conv, !dbg !26 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5} +!llvm.ident = !{!6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "m.c", directory: "/dir") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{!"clang version 12.0.0"} +!7 = distinct !DISubprogram(name: "fn2", scope: !1, file: !1, line: 4, type: !8, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11) +!8 = !DISubroutineType(types: !9) +!9 = !{!10, !10, !10, !10} +!10 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed) +!11 = !{!12, !13, !14, !15} +!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 4, type: !10) +!13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 4, type: !10) +!14 = !DILocalVariable(name: "c", arg: 3, scope: !7, file: !1, line: 4, type: !10) +!15 = !DILocalVariable(name: "q", scope: !7, file: !1, line: 6, type: !10) +!16 = !DILocation(line: 0, scope: !7) +!19 = !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !20, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) +!20 = !DISubroutineType(types: !21) +!21 = !{!22, !10, !10, !10} +!22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!23 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 9, type: !24, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) +!24 = !DISubroutineType(types: !25) +!25 = !{!22} +!26 = !DILocation(line: 10, column: 16, scope: !23) Index: llvm/test/CodeGen/ARM/dbg-call-site-undef-params.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/ARM/dbg-call-site-undef-params.ll @@ -0,0 +1,80 @@ +; RUN: llc -mtriple=arm-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s +; RUN: llc -mtriple=armeb-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s + +;; Compiled from source: +;; extern int fn1 (long int x, long int y, long int z); +;; __attribute__((noinline)) long int +;; fn2 (long int a, long int b, long int c) +;; { +;; long int q = 2 * a; +;; return fn1 (5, 6, 7); +;; } +;; int main(void) { +;; return fn2(14, 23, 34); +;; } +;; Using command: +;; clang -g -O2 m.c -target arm-linux-gnu -emit-llvm -S -c + +;; Verify that call site info is not created for parameters marked as "undef". +; CHECK: name: main +; CHECK: callSites: +; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [] +; CHECK-NOT: arg: 0 +; CHECK-NOT: arg: 1 +; CHECK-NOT: arg: 2 + +; ModuleID = 'm.c' +source_filename = "m.c" +target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "armv4t-unknown-linux-gnu" + +; Function Attrs: noinline nounwind +define dso_local arm_aapcscc i32 @fn2(i32 %a, i32 %b, i32 %c) local_unnamed_addr !dbg !8 { +entry: + call void @llvm.dbg.value(metadata i32 undef, metadata !16, metadata !DIExpression()), !dbg !17 + %call = tail call arm_aapcscc i32 @fn1(i32 5, i32 6, i32 7), !dbg !17 + ret i32 %call, !dbg !17 +} + +declare !dbg !20 dso_local arm_aapcscc i32 @fn1(i32, i32, i32) local_unnamed_addr + +; Function Attrs: nounwind +define dso_local arm_aapcscc i32 @main() local_unnamed_addr !dbg !24 { +entry: + %call = tail call arm_aapcscc i32 @fn2(i32 undef, i32 undef, i32 undef), !dbg !27 + ret i32 %call, !dbg !27 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5, !6} +!llvm.ident = !{!7} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "m.c", directory: "/dir") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{i32 1, !"min_enum_size", i32 4} +!7 = !{!"clang version 12.0.0"} +!8 = distinct !DISubprogram(name: "fn2", scope: !1, file: !1, line: 4, type: !9, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12) +!9 = !DISubroutineType(types: !10) +!10 = !{!11, !11, !11, !11} +!11 = !DIBasicType(name: "long int", size: 32, encoding: DW_ATE_signed) +!12 = !{!13, !14, !15, !16} +!13 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 4, type: !11) +!14 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !1, line: 4, type: !11) +!15 = !DILocalVariable(name: "c", arg: 3, scope: !8, file: !1, line: 4, type: !11) +!16 = !DILocalVariable(name: "q", scope: !8, file: !1, line: 6, type: !11) +!17 = !DILocation(line: 0, scope: !8) +!20 = !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !21, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) +!21 = !DISubroutineType(types: !22) +!22 = !{!23, !11, !11, !11} +!23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!24 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 9, type: !25, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) +!25 = !DISubroutineType(types: !26) +!26 = !{!23} +!27 = !DILocation(line: 10, column: 16, scope: !24) Index: llvm/test/CodeGen/Mips/dbg-call-site-undef-params_32bit.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/Mips/dbg-call-site-undef-params_32bit.ll @@ -0,0 +1,79 @@ +; RUN: llc -mtriple=mips-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s +; RUN: llc -mtriple=mipsel-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s + +;; Compiled from source: +;; extern int fn1 (long int x, long int y, long int z); +;; __attribute__((noinline)) long int +;; fn2 (long int a, long int b, long int c) +;; { +;; long int q = 2 * a; +;; return fn1 (5, 6, 7); +;; } +;; int main(void) { +;; return fn2(14, 23, 34); +;; } +;; Using command: +;; clang -g -O2 m.c -target mips-linux-gnu -emit-llvm -S -c -o m.ll + +;; Verify that call site info is not created for parameters marked as "undef". +; CHECK: name: main +; CHECK: callSites: +; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [] +; CHECK-NOT: arg: 0 +; CHECK-NOT: arg: 1 +; CHECK-NOT: arg: 2 + +; ModuleID = 'm.c' +source_filename = "m.c" +target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" +target triple = "mips-unknown-linux-gnu" + +; Function Attrs: noinline nounwind +define dso_local i32 @fn2(i32 signext %a, i32 signext %b, i32 signext %c) local_unnamed_addr !dbg !7 { +entry: + call void @llvm.dbg.value(metadata i32 undef, metadata !15, metadata !DIExpression()), !dbg !16 + %call = tail call i32 @fn1(i32 signext 5, i32 signext 6, i32 signext 7), !dbg !16 + ret i32 %call, !dbg !16 +} + +declare !dbg !19 dso_local i32 @fn1(i32 signext, i32 signext, i32 signext) local_unnamed_addr + +; Function Attrs: nounwind +define dso_local i32 @main() local_unnamed_addr !dbg !23 { +entry: + %call = tail call i32 @fn2(i32 signext undef, i32 signext undef, i32 signext undef), !dbg !26 + ret i32 %call, !dbg !26 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5} +!llvm.ident = !{!6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "m.c", directory: "/dir") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{!"clang version 12.0.0"} +!7 = distinct !DISubprogram(name: "fn2", scope: !1, file: !1, line: 4, type: !8, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11) +!8 = !DISubroutineType(types: !9) +!9 = !{!10, !10, !10, !10} +!10 = !DIBasicType(name: "long int", size: 32, encoding: DW_ATE_signed) +!11 = !{!12, !13, !14, !15} +!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 4, type: !10) +!13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 4, type: !10) +!14 = !DILocalVariable(name: "c", arg: 3, scope: !7, file: !1, line: 4, type: !10) +!15 = !DILocalVariable(name: "q", scope: !7, file: !1, line: 6, type: !10) +!16 = !DILocation(line: 0, scope: !7) +!19 = !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !20, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) +!20 = !DISubroutineType(types: !21) +!21 = !{!22, !10, !10, !10} +!22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!23 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 9, type: !24, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) +!24 = !DISubroutineType(types: !25) +!25 = !{!22} +!26 = !DILocation(line: 10, column: 16, scope: !23) Index: llvm/test/CodeGen/Mips/dbg-call-site-undef-params_64bit.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/Mips/dbg-call-site-undef-params_64bit.ll @@ -0,0 +1,82 @@ +; RUN: llc -mtriple=mips64-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s +; RUN: llc -mtriple=mips64el-linux-gnu -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s + +;; Compiled from source: +;; extern int fn1 (long int x, long int y, long int z); +;; __attribute__((noinline)) long int +;; fn2 (long int a, long int b, long int c) +;; { +;; long int q = 2 * a; +;; return fn1 (5, 6, 7); +;; } +;; int main(void) { +;; return fn2(14, 23, 34); +;; } +;; Using command: +;; clang -g -O2 m.c -target mips64-linux-gnu -emit-llvm -S -c + +;; Verify that call site info is not created for parameters marked as "undef". +; CHECK: name: main +; CHECK: callSites: +; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [] +; CHECK-NOT: arg: 0 +; CHECK-NOT: arg: 1 +; CHECK-NOT: arg: 2 + +; ModuleID = 'm.c' +source_filename = "m.c" +target datalayout = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" +target triple = "mips64-unknown-linux-gnu" + +; Function Attrs: noinline nounwind +define i64 @fn2(i64 signext %a, i64 signext %b, i64 signext %c) local_unnamed_addr !dbg !8 { +entry: + call void @llvm.dbg.value(metadata i64 undef, metadata !16, metadata !DIExpression()), !dbg !17 + %call = tail call signext i32 @fn1(i64 signext 5, i64 signext 6, i64 signext 7), !dbg !17 + %conv = sext i32 %call to i64, !dbg !17 + ret i64 %conv, !dbg !17 +} + +declare !dbg !20 signext i32 @fn1(i64 signext, i64 signext, i64 signext) local_unnamed_addr + +; Function Attrs: nounwind +define signext i32 @main() local_unnamed_addr !dbg !24 { +entry: + %call = tail call i64 @fn2(i64 signext undef, i64 signext undef, i64 signext undef), !dbg !27 + %conv = trunc i64 %call to i32, !dbg !27 + ret i32 %conv, !dbg !27 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5, !6} +!llvm.ident = !{!7} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "m.c", directory: "/dir") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{i32 7, !"PIC Level", i32 1} +!7 = !{!"clang version 12.0.0"} +!8 = distinct !DISubprogram(name: "fn2", scope: !1, file: !1, line: 4, type: !9, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12) +!9 = !DISubroutineType(types: !10) +!10 = !{!11, !11, !11, !11} +!11 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed) +!12 = !{!13, !14, !15, !16} +!13 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 4, type: !11) +!14 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !1, line: 4, type: !11) +!15 = !DILocalVariable(name: "c", arg: 3, scope: !8, file: !1, line: 4, type: !11) +!16 = !DILocalVariable(name: "q", scope: !8, file: !1, line: 6, type: !11) +!17 = !DILocation(line: 0, scope: !8) +!20 = !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !21, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) +!21 = !DISubroutineType(types: !22) +!22 = !{!23, !11, !11, !11} +!23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!24 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 9, type: !25, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) +!25 = !DISubroutineType(types: !26) +!26 = !{!23} +!27 = !DILocation(line: 10, column: 16, scope: !24) Index: llvm/test/CodeGen/X86/dbg-call-site-undef-params.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/X86/dbg-call-site-undef-params.ll @@ -0,0 +1,83 @@ +; RUN: llc -emit-call-site-info %s -stop-after=finalize-isel -o - | FileCheck %s + +;; Compiled from source: +;; extern int fn1 (long int x, long int y, long int z); +;; __attribute__((noinline)) long int +;; fn2 (long int a, long int b, long int c) +;; { +;; long int q = 2 * a; +;; return fn1 (5, 6, 7); +;; } +;; int main(void) { +;; return fn2(14, 23, 34); +;; } +;; Using command: +;; clang -g -O2 m.c -emit-llvm -S -c -o m.ll + +;; Verify that call site info is not created for parameters marked as "undef". +; CHECK: name: main +; CHECK: callSites: +; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [] +; CHECK-NOT: arg: 0 +; CHECK-NOT: arg: 1 +; CHECK-NOT: arg: 2 + +; ModuleID = 'm.c' +source_filename = "m.c" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: noinline nounwind uwtable +define dso_local i64 @fn2(i64 %a, i64 %b, i64 %c) local_unnamed_addr !dbg !7 { +entry: + call void @llvm.dbg.value(metadata i64 undef, metadata !12, metadata !DIExpression()), !dbg !16 + call void @llvm.dbg.value(metadata i64 undef, metadata !13, metadata !DIExpression()), !dbg !16 + call void @llvm.dbg.value(metadata i64 undef, metadata !14, metadata !DIExpression()), !dbg !16 + call void @llvm.dbg.value(metadata i64 undef, metadata !15, metadata !DIExpression()), !dbg !16 + %call = tail call i32 @fn1(i64 5, i64 6, i64 7) #4, !dbg !16 + %conv = sext i32 %call to i64, !dbg !16 + ret i64 %conv, !dbg !16 +} + +declare !dbg !19 dso_local i32 @fn1(i64, i64, i64) local_unnamed_addr + +; Function Attrs: nounwind uwtable +define dso_local i32 @main() local_unnamed_addr !dbg !23 { +entry: + %call = tail call i64 @fn2(i64 undef, i64 undef, i64 undef), !dbg !26 + %conv = trunc i64 %call to i32, !dbg !26 + ret i32 %conv, !dbg !26 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5} +!llvm.ident = !{!6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "m.c", directory: "/dir") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{!"clang version 12.0.0"} +!7 = distinct !DISubprogram(name: "fn2", scope: !1, file: !1, line: 4, type: !8, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11) +!8 = !DISubroutineType(types: !9) +!9 = !{!10, !10, !10, !10} +!10 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed) +!11 = !{!12, !13, !14, !15} +!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 4, type: !10) +!13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 4, type: !10) +!14 = !DILocalVariable(name: "c", arg: 3, scope: !7, file: !1, line: 4, type: !10) +!15 = !DILocalVariable(name: "q", scope: !7, file: !1, line: 6, type: !10) +!16 = !DILocation(line: 0, scope: !7) +!19 = !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !20, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) +!20 = !DISubroutineType(types: !21) +!21 = !{!22, !10, !10, !10} +!22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!23 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 9, type: !24, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) +!24 = !DISubroutineType(types: !25) +!25 = !{!22} +!26 = !DILocation(line: 10, column: 16, scope: !23)