brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · d7740e0 Raw
93 lines · plain
1# RUN: llc -mtriple aarch64-linux-gnu -emit-call-site-info -debug-entry-values -start-before=aarch64-asm-printer -filetype=obj -o - %s \2# RUN:     | llvm-dwarfdump - | FileCheck %s --implicit-check-not=DW_TAG_GNU_call_site_parameter3#4# Based on the following C reproducer:5#6# extern void call(long, long, long);7#8# void entry_value (long param) {9#   call(param + 222, param - 444, param);10# }11 12--- |13  target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"14  target triple = "aarch64"15 16  define dso_local void @entry_value(i64 %param) local_unnamed_addr !dbg !12 {17  entry:18    call void @llvm.dbg.value(metadata i64 %param, metadata !16, metadata !DIExpression()), !dbg !1719    %add = add nsw i64 %param, 222, !dbg !1720    %sub = add nsw i64 %param, -444, !dbg !1721    call void @call(i64 %add, i64 %sub, i64 %param), !dbg !1722    ret void, !dbg !1723  }24 25  declare !dbg !4 dso_local void @call(i64, i64, i64) local_unnamed_addr26 27  declare void @llvm.dbg.value(metadata, metadata, metadata)28 29  !llvm.dbg.cu = !{!0}30  !llvm.module.flags = !{!8, !9, !10}31  !llvm.ident = !{!11}32 33  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, splitDebugInlining: false, nameTableKind: None)34  !1 = !DIFile(filename: "dbgcall-site-expr-entry-value.mir", directory: "/")35  !2 = !{}36  !3 = !{!4}37  !4 = !DISubprogram(name: "call", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)38  !5 = !DISubroutineType(types: !6)39  !6 = !{null, !7, !7, !7}40  !7 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)41  !8 = !{i32 7, !"Dwarf Version", i32 4}42  !9 = !{i32 2, !"Debug Info Version", i32 3}43  !10 = !{i32 1, !"wchar_size", i32 4}44  !11 = !{!"clang version 11.0.0 "}45  !12 = distinct !DISubprogram(name: "entry_value", scope: !1, file: !1, line: 3, type: !13, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)46  !13 = !DISubroutineType(types: !14)47  !14 = !{null, !7}48  !15 = !{!16}49  !16 = !DILocalVariable(name: "param", arg: 1, scope: !12, file: !1, line: 3, type: !7)50  !17 = !DILocation(line: 4, scope: !12)51 52...53---54name:            entry_value55tracksRegLiveness: true56stack:57  - { id: 0, type: spill-slot, offset: -8, size: 8, alignment: 8, callee-saved-register: '$lr' }58  - { id: 1, type: spill-slot, offset: -16, size: 8, alignment: 8, callee-saved-register: '$fp' }59callSites:60  - { bb: 0, offset: 10, fwdArgRegs:61      - { arg: 0, reg: '$x0' }62      - { arg: 1, reg: '$x1' }63      - { arg: 2, reg: '$x2' } }64body:             |65  bb.0.entry:66    liveins: $x0, $lr67 68    DBG_VALUE $x0, $noreg, !16, !DIExpression(), debug-location !1769    early-clobber $sp = frame-setup STPXpre $fp, killed $lr, $sp, -2 :: (store (s64) into %stack.1), (store (s64) into %stack.0)70    $fp = frame-setup ADDXri $sp, 0, 071    frame-setup CFI_INSTRUCTION def_cfa $w29, 1672    frame-setup CFI_INSTRUCTION offset $w30, -873    frame-setup CFI_INSTRUCTION offset $w29, -1674    $x2 = ORRXrs $xzr, $x0, 075    DBG_VALUE $x2, $noreg, !16, !DIExpression(), debug-location !1776    renamable $x0 = nsw ADDXri killed $x0, 222, 0, debug-location !1777    renamable $x1 = nsw SUBXri renamable $x2, 444, 0, debug-location !1778    BL @call, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit killed $x1, implicit killed $x2, implicit-def $sp, debug-location !1779    early-clobber $sp, $fp, $lr = frame-destroy LDPXpost $sp, 2, debug-location !17 :: (load (s64) from %stack.1), (load (s64) from %stack.0)80    RET undef $lr, debug-location !1781 82...83 84# Verify that a call site parameter is emitted for the third parameter. There85# should also be entries for the first and second parameter, but86# DW_OP_LLVM_entry_value operations can currently not be emitted together with87# any other expressions. Verify that nothing is emitted rather than an assert88# being triggered, or broken expressions being emitted.89 90# CHECK: DW_TAG_GNU_call_site_parameter91# CHECK-NEXT: DW_AT_location      (DW_OP_reg2 W2)92# CHECK-NEXT: DW_AT_GNU_call_site_value   (DW_OP_GNU_entry_value(DW_OP_reg0 W0))93