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
5 define void @foo(i32 signext %a, i32 signext %b, ptr %c) !dbg !5 {
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
13 declare void @llvm.dbg.value(metadata, metadata, metadata) #0
15 attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
18 !llvm.debugify = !{!2, !3}
19 !llvm.module.flags = !{!4}
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: "/")
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)
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)
39 tracksRegLiveness: true
42 liveins: $x10, $x11, $x12
44 ; CHECK-LABEL: name: foo
45 ; CHECK: liveins: $x10, $x11, $x12
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
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