reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
# RUN: llc -run-pass=prologepilog -o - %s | FileCheck %s
--- |
  ; ModuleID = 'dbg.opt.ll'
  source_filename = "dbg.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"

  ; Function Attrs: noinline nounwind uwtable
  define dso_local zeroext i16 @foo(i16 zeroext %d0, i16 zeroext %d1, i16 zeroext %d2, i16 zeroext %d3, i16 zeroext %d4, i16 zeroext %d5, i16 zeroext %d6, i16 zeroext %d7, i16 zeroext %d8, i16 signext %x) #0 !dbg !7 {
  entry:
    call void @llvm.dbg.value(metadata i16 %x, metadata !32, metadata !DIExpression(DW_OP_LLVM_convert, 16, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !34
    ret i16 %x
  }

  ; Function Attrs: nounwind readnone speculatable
  declare void @llvm.dbg.value(metadata, metadata, metadata) #1

  attributes #0 = { noinline nounwind uwtable }
  attributes #1 = { nounwind readnone speculatable }

  !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 9.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
  !1 = !DIFile(filename: "dbg.c", directory: "/tmp")
  !2 = !{}
  !3 = !{i32 2, !"Dwarf Version", i32 4}
  !4 = !{i32 2, !"Debug Info Version", i32 3}
  !5 = !{i32 1, !"wchar_size", i32 4}
  !6 = !{!"clang version 9.0.0"}
  !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
  !8 = !DISubroutineType(types: !9)
  !9 = !{!10, !10, !10, !10, !10, !10, !10, !10, !10, !10, !10}
  !10 = !DIDerivedType(tag: DW_TAG_typedef, name: "T", file: !1, line: 1, baseType: !11)
  !11 = !DIBasicType(name: "signed short", size: 16, encoding: DW_ATE_signed)
  !32 = !DILocalVariable(name: "y", scope: !7, file: !1, line: 3, type: !33)
  !33 = !DIBasicType(name: "signed int", size: 32, encoding: DW_ATE_signed)
  !34 = !DILocation(line: 3, column: 20, scope: !7)

...
---
name:            foo
tracksRegLiveness: true
fixedStack:
  - { id: 0, type: default, offset: 24, size: 2, alignment: 8, stack-id: default,
      isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
stack:           []
constants:       []
machineFunctionInfo: {}
body:             |
  bb.0.entry:
    renamable $ax = MOV16rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load 2 from %fixed-stack.0, align 8)
    DBG_VALUE %fixed-stack.0, 0, !32, !DIExpression(DW_OP_LLVM_convert, 16, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), debug-location !34
    RET 0, $ax
...
# CHECK: machineFunctionInfo
# CHECK: DBG_VALUE $rsp, $noreg, !12, !DIExpression(DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref_size, 2, DW_OP_LLVM_convert, 16, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), debug-location !14