141 lines · plain
1# RUN: llc -emit-call-site-info -start-after=machineverifier -filetype=obj %s -o -| llvm-dwarfdump -| FileCheck %s2# CHECK: DW_TAG_GNU_call_site3# CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo")4# CHECK-NEXT: DW_AT_low_pc {{.*}}5# CHECK-EMPTY:6# CHECK-NEXT: DW_TAG_GNU_call_site_parameter7# CHECK-NEXT: DW_AT_location (DW_OP_reg9 R9)8# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg15 R15+10)9# CHECK-EMPTY:10# CHECK-NEXT: DW_TAG_GNU_call_site_parameter11# CHECK-NEXT: DW_AT_location (DW_OP_reg8 R8)12# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg15 R15+0, DW_OP_lit2, DW_OP_mul, DW_OP_plus_uconst 0x8)13# CHECK-EMPTY:14# CHECK-NEXT: DW_TAG_GNU_call_site_parameter15# CHECK-NEXT: DW_AT_location (DW_OP_reg1 RDX)16# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+0, DW_OP_lit5, DW_OP_mul, DW_OP_plus_uconst 0x8)17# CHECK-EMPTY:18# CHECK-NEXT: DW_TAG_GNU_call_site_parameter19# CHECK-NEXT: DW_AT_location (DW_OP_reg4 RSI)20# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+0)21# CHECK-EMPTY:22# CHECK-NEXT: DW_TAG_GNU_call_site_parameter23# CHECK-NEXT: DW_AT_location (DW_OP_reg5 RDI)24# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+0, DW_OP_breg15 R15+0, DW_OP_lit2, DW_OP_mul, DW_OP_plus, DW_OP_plus_uconst 0x4)25# CHECK-EMPTY:26# CHECK-NEXT: DW_TAG_GNU_call_site_parameter27# CHECK-NEXT: DW_AT_location (DW_OP_reg2 RCX)28# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+0, DW_OP_breg15 R15+0, DW_OP_plus)29# CHECK: DW_TAG_GNU_call_site30# CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo2")31# CHECK-NEXT: DW_AT_low_pc {{.*}}32# CHECK-EMPTY:33# CHECK-NEXT: DW_TAG_GNU_call_site_parameter34# CHECK-NEXT: DW_AT_location (DW_OP_reg5 RDI)35# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_breg14 R14+0, DW_OP_lit2, DW_OP_mul)36--- |37 ; ModuleID = 'dbgcall-site-lea-interpretation.ll'38 source_filename = "dbgcall-site-lea-interpretation.c"39 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"40 target triple = "x86_64-unknown-linux-gnu"41 42 define dso_local i32 @baa(i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr !dbg !10 {43 entry:44 %arg1.addr = alloca i32, align 445 %arg3.addr = alloca i32, align 446 %local1 = alloca i32, align 447 store i32 %arg1, ptr %arg1.addr, align 448 store i32 %arg3, ptr %arg3.addr, align 449 %0 = bitcast ptr %local1 to ptr, !dbg !1450 %mul = mul nsw i32 %arg3, %arg1, !dbg !1451 store i32 %mul, ptr %local1, align 4, !dbg !1452 %add = add nsw i32 %arg2, %arg1, !dbg !1453 %sub = sub nsw i32 %add, %arg3, !dbg !1454 %call = call i32 @foo(i32 %mul, i32 %sub, ptr nonnull %local1, ptr nonnull %arg1.addr, ptr nonnull %arg3.addr, i32 %add), !dbg !1455 %1 = load i32, ptr %local1, align 4, !dbg !1456 %add2 = add nsw i32 %1, %call, !dbg !1457 store i32 %add2, ptr %local1, align 4, !dbg !1458 %call3 = call i32 @foo2(ptr nonnull %local1), !dbg !1459 %2 = load i32, ptr %local1, align 4, !dbg !1460 ret i32 %2, !dbg !1461 }62 63 declare !dbg !4 dso_local i32 @foo(i32, i32, ptr, ptr, ptr, i32) local_unnamed_addr64 65 declare !dbg !5 dso_local i32 @foo2(ptr) local_unnamed_addr66 67 !llvm.dbg.cu = !{!0}68 !llvm.module.flags = !{!6, !7, !8}69 !llvm.ident = !{!9}70 71 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)72 !1 = !DIFile(filename: "dbgcall-site-lea-interpretation.c", directory: "/dir")73 !2 = !{}74 !3 = !{!4, !5}75 !4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)76 !5 = !DISubprogram(name: "foo2", scope: !1, file: !1, line: 9, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)77 !6 = !{i32 2, !"Dwarf Version", i32 4}78 !7 = !{i32 2, !"Debug Info Version", i32 3}79 !8 = !{i32 1, !"wchar_size", i32 4}80 !9 = !{!"clang version 9.0.0"}81 !10 = distinct !DISubprogram(name: "baa", scope: !1, file: !1, line: 11, type: !11, scopeLine: 11, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)82 !11 = !DISubroutineType(types: !12)83 !12 = !{!13, !13, !13, !13}84 !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)85 !14 = !DILocation(line: 11, column: 13, scope: !10)86 87...88---89name: baa90liveins: 91 - { reg: '$edi', virtual-reg: '' }92 - { reg: '$esi', virtual-reg: '' }93 - { reg: '$edx', virtual-reg: '' }94callSites: 95 - { bb: 0, offset: 21, fwdArgRegs: 96 - { arg: 0, reg: '$edi' }97 - { arg: 1, reg: '$esi' }98 - { arg: 2, reg: '$rdx' }99 - { arg: 3, reg: '$rcx' }100 - { arg: 4, reg: '$r8' }101 - { arg: 5, reg: '$r9d' } }102 - { bb: 0, offset: 24, fwdArgRegs: 103 - { arg: 0, reg: '$rdi' } }104body: |105 bb.0.entry:106 liveins: $edi, $edx, $esi, $rbx107 108 frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp109 CFI_INSTRUCTION def_cfa_offset 16110 $rsp = frame-setup SUB64ri8 $rsp, 16, implicit-def dead $eflags111 CFI_INSTRUCTION def_cfa_offset 32112 CFI_INSTRUCTION offset $rbx, -16113 $r9d = MOV32rr $esi114 $r14 = MOV64rr $rsi115 $r15 = MOV64rr $rdi116 MOV32mr $rsp, 1, $noreg, 12, $noreg, renamable $edi :: (store (s32) into %ir.arg1.addr)117 MOV32mr $rsp, 1, $noreg, 8, $noreg, renamable $edx :: (store (s32) into %ir.arg3.addr)118 renamable $r9d = nsw ADD32rr killed renamable $r9d, renamable $edi, implicit-def dead $eflags, debug-location !14119 $esi = MOV32rr $r9d, debug-location !14120 renamable $esi = nsw SUB32rr killed renamable $esi, renamable $edx, implicit-def dead $eflags, debug-location !14121 renamable $edx = nsw IMUL32rr killed renamable $edx, killed renamable $edi, implicit-def dead $eflags, debug-location !14122 MOV32mr $rsp, 1, $noreg, 4, $noreg, renamable $edx, debug-location !14 :: (store (s32) into %ir.local1)123 renamable $rcx = LEA64r $r14, 1, $r15, 0, $noreg124 renamable $edi = LEA64_32r $r14, 2, $r15, 4, $noreg125 renamable $esi = LEA64_32r $r14, 1, $noreg, 0, $noreg126 renamable $rdx = LEA64r $r14, 4, $r14, 8, $noreg127 renamable $r8 = LEA64r $noreg, 2, $r15, 8, $noreg128 renamable $r9d = LEA64_32r $noreg, 1, $r15, 10, $noreg, implicit-def $r9d129 CALL64pcrel32 @foo, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit $esi, implicit $rdx, implicit $rcx, implicit $r8, implicit $r9d, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !14130 ADD32mr $rsp, 1, $noreg, 4, $noreg, killed renamable $eax, implicit-def dead $eflags, debug-location !14 :: (store (s32) into %ir.local1), (dereferenceable load (s32) from %ir.local1)131 $rdi = LEA64r $r14, 1, killed $r14, 0, $noreg132 CALL64pcrel32 @foo2, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eax, debug-location !14133 renamable $eax = MOV32rm $rsp, 1, $noreg, 4, $noreg, debug-location !14 :: (dereferenceable load (s32) from %ir.local1)134 $rsp = frame-destroy ADD64ri8 $rsp, 16, implicit-def dead $eflags, debug-location !14135 CFI_INSTRUCTION def_cfa_offset 16, debug-location !14136 $rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !14137 CFI_INSTRUCTION def_cfa_offset 8, debug-location !14138 RET64 $eax, debug-location !14139 140...141