legalize-memcpy-with-debug-info.mir 3.27 KB
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -debugify-and-strip-all-safe=0 -mtriple=aarch64-- -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -implicit-check-not=DBG_VALUE

--- |
  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"

  define void @test_memcpy_tail() !dbg !11 {
  entry:
    call void @llvm.dbg.value(metadata i32 0, metadata !13, metadata !DIExpression()), !dbg !14
    unreachable, !dbg !14
  }

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

  attributes #0 = { nounwind readnone speculatable willreturn }

  !llvm.dbg.cu = !{!0}
  !llvm.debugify = !{!3, !3}
  !llvm.module.flags = !{!4}

  !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
  !1 = !DIFile(filename: "/Users/vsk/src/llvm-backup-master/llvm/test/CodeGen/AArch64/GlobalISel/legalize-memcpy-et-al.mir", directory: "/")
  !2 = !{}
  !3 = !{i32 6}
  !4 = !{i32 2, !"Debug Info Version", i32 3}
  !6 = !DISubroutineType(types: !2)
  !9 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
  !11 = distinct !DISubprogram(name: "test_memcpy_tail", linkageName: "test_memcpy_tail", scope: null, file: !1, line: 2, type: !6, scopeLine: 2, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)
  !12 = !{!13}
  !13 = !DILocalVariable(name: "2", scope: !11, file: !1, line: 2, type: !9)
  !14 = !DILocation(line: 2, column: 1, scope: !11)

...
---
name:            test_memcpy_tail
body:             |
  bb.0:
    liveins: $w2, $x0, $x1

    ; CHECK-LABEL: name: test_memcpy_tail
    ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0, debug-location !10
    ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1, debug-location !DILocation(line: 3, column: 1, scope: !5)
    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2, debug-location !DILocation(line: 4, column: 1, scope: !5)
    ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32), debug-location !DILocation(line: 5, column: 1, scope: !5)
    ; CHECK: $x0 = COPY [[COPY]](p0), debug-location !DILocation(line: 6, column: 1, scope: !5)
    ; CHECK: $x1 = COPY [[COPY1]](p0), debug-location !DILocation(line: 6, column: 1, scope: !5)
    ; CHECK: $x2 = COPY [[ZEXT]](s64), debug-location !DILocation(line: 6, column: 1, scope: !5)
    ; CHECK: TCRETURNdi &memcpy, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $x1, implicit $x2, debug-location !DILocation(line: 6, column: 1, scope: !5)
    %0:_(p0) = COPY $x0, debug-location !14
    %1:_(p0) = COPY $x1, debug-location !DILocation(line: 3, column: 1, scope: !11)
    %2:_(s32) = COPY $w2, debug-location !DILocation(line: 4, column: 1, scope: !11)
    %3:_(s64) = G_ZEXT %2(s32), debug-location !DILocation(line: 5, column: 1, scope: !11)
    G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), 1, debug-location !DILocation(line: 6, column: 1, scope: !11)
    DBG_VALUE 0, $noreg, !13, !DIExpression(), debug-location !DILocation(line: 6, column: 1, scope: !11)
    DBG_VALUE 0, $noreg, !13, !DIExpression(), debug-location !DILocation(line: 6, column: 1, scope: !11)
    RET_ReallyLR debug-location !DILocation(line: 7, column: 1, scope: !11)

...