xref: /llvm-project/llvm/test/CodeGen/RISCV/sextw-removal-debug.mir (revision 55f91bfe5074a22ead581a49e54ec9ed1744b39d)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2# RUN: llc %s -mtriple=riscv64 -run-pass=riscv-opt-w-instrs -o - | FileCheck %s
3
4--- |
5  define void @foo(i32 signext %a, i32 signext %b, ptr %c) !dbg !5 {
6  entry:
7    %add = add nsw i32 %b, %a, !dbg !11
8    tail call void @llvm.dbg.value(metadata i32 %add, metadata !9, metadata !DIExpression()), !dbg !11
9    store i32 %add, ptr %c, align 4, !dbg !12
10    ret void, !dbg !13
11  }
12
13  declare void @llvm.dbg.value(metadata, metadata, metadata) #0
14
15  attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
16
17  !llvm.dbg.cu = !{!0}
18  !llvm.debugify = !{!2, !3}
19  !llvm.module.flags = !{!4}
20
21  !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
22  !1 = !DIFile(filename: "test.ll", directory: "/")
23  !2 = !{i32 3}
24  !3 = !{i32 1}
25  !4 = !{i32 2, !"Debug Info Version", i32 3}
26  !5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)
27  !6 = !DISubroutineType(types: !7)
28  !7 = !{}
29  !8 = !{!9}
30  !9 = !DILocalVariable(name: "1", scope: !5, file: !1, line: 1, type: !10)
31  !10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
32  !11 = !DILocation(line: 1, column: 1, scope: !5)
33  !12 = !DILocation(line: 2, column: 1, scope: !5)
34  !13 = !DILocation(line: 3, column: 1, scope: !5)
35
36...
37---
38name:            foo
39tracksRegLiveness: true
40body:             |
41  bb.0.entry:
42    liveins: $x10, $x11, $x12
43
44    ; CHECK-LABEL: name: foo
45    ; CHECK: liveins: $x10, $x11, $x12
46    ; CHECK-NEXT: {{  $}}
47    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x12
48    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
49    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x10
50    ; CHECK-NEXT: [[ADD:%[0-9]+]]:gpr = ADD [[COPY1]], [[COPY2]], debug-location !11
51    ; CHECK-NEXT: DBG_VALUE [[ADD]], $noreg, !9, !DIExpression(), debug-location !11
52    ; CHECK-NEXT: SW killed [[ADD]], [[COPY]], 0, debug-location !12 :: (store (s32) into %ir.c)
53    ; CHECK-NEXT: PseudoRET debug-location !13
54    %2:gpr = COPY $x12
55    %1:gpr = COPY $x11
56    %0:gpr = COPY $x10
57    %3:gpr = ADDW %1, %0, debug-location !11
58    DBG_VALUE %3, $noreg, !9, !DIExpression(), debug-location !11
59    SW killed %3, %2, 0, debug-location !12 :: (store (s32) into %ir.c)
60    PseudoRET debug-location !13
61
62...
63