File: select-dbg-value.mir

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (68 lines) | stat: -rw-r--r-- 2,756 bytes parent folder | download | duplicates (7)
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
60
61
62
63
64
65
66
67
68
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -O0 -mtriple arm64-- -run-pass=instruction-select %s -o - | FileCheck %s

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

  define void @test_dbg_value(i32 %a) !dbg !5 {
    %tmp0 = add i32 %a, %a
    call void @llvm.dbg.value(metadata i32 %tmp0, i64 0, metadata !7, metadata !DIExpression()), !dbg !9
    ret void
  }

  define void @test_dbg_value_dead(i32 %a) !dbg !10 {
    call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !11, metadata !DIExpression()), !dbg !12
    ret void
  }

  declare void @llvm.dbg.value(metadata, i64, metadata, metadata)

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

  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
  !1 = !DIFile(filename: "test.ll", directory: "/tmp")
  !2 = !{}
  !3 = !{i32 2, !"Dwarf Version", i32 4}
  !4 = !{i32 2, !"Debug Info Version", i32 3}
  !5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
  !6 = !DISubroutineType(types: !2)
  !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8)
  !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
  !9 = !DILocation(line: 1, column: 1, scope: !5)
  !10 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
  !11 = !DILocalVariable(name: "in", arg: 1, scope: !10, file: !1, line: 1, type: !8)
  !12 = !DILocation(line: 1, column: 1, scope: !10)
...

---
name:            test_dbg_value
legalized:       true
regBankSelected: true
body: |
  bb.0:
    liveins: $w0
    ; CHECK-LABEL: name: test_dbg_value
    ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
    ; CHECK: [[ADDWrr:%[0-9]+]]:gpr32 = ADDWrr [[COPY]], [[COPY]]
    ; CHECK: $w0 = COPY [[ADDWrr]]
    ; CHECK: DBG_VALUE [[ADDWrr]], $noreg, !7, !DIExpression(), debug-location !9
    %0:gpr(s32) = COPY $w0
    %1:gpr(s32) = G_ADD %0, %0
    $w0 = COPY %1(s32)
    DBG_VALUE %1(s32), $noreg, !7, !DIExpression(), debug-location !9
...

---
name:            test_dbg_value_dead
legalized:       true
regBankSelected: true
body: |
  bb.0:
    liveins: $w0
    ; CHECK-LABEL: name: test_dbg_value_dead
    ; CHECK-NOT: COPY
    ; CHECK: DBG_VALUE $noreg, $noreg, !7, !DIExpression(), debug-location !9
    %0:gpr(s32) = COPY $w0
    DBG_VALUE %0(s32), $noreg, !7, !DIExpression(), debug-location !9
...