1 # RUN: llc -mtriple=powerpc64le-unknown-unknown -start-before=greedy -stop-after=virtregrewriter -o - %s | FileCheck %s
4 ; Function Attrs: nounwind
5 define signext i32 @test1(i32 signext %a, i32 signext %b) local_unnamed_addr !dbg !8 {
7 %mul = mul nsw i32 %b, %a, !dbg !18
8 call void @llvm.dbg.value(metadata i32 %mul, metadata !15, metadata !DIExpression()), !dbg !19
9 tail call void asm sideeffect "", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27},~{r28},~{r29},~{r30},~{r31}"() #2, !dbg !20, !srcloc !25
10 ret i32 %mul, !dbg !26
13 ; Function Attrs: nounwind readnone speculatable willreturn
14 declare void @llvm.dbg.value(metadata, metadata, metadata)
17 !llvm.module.flags = !{!3, !4, !5, !6}
20 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
21 !1 = !DIFile(filename: "foo.c", directory: "/")
23 !3 = !{i32 2, !"Dwarf Version", i32 4}
24 !4 = !{i32 2, !"Debug Info Version", i32 3}
25 !5 = !{i32 1, !"wchar_size", i32 4}
26 !6 = !{i32 7, !"PIC Level", i32 2}
27 !7 = !{!"clang version 8.0.0"}
28 !8 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 8, type: !9, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)
29 !9 = !DISubroutineType(types: !10)
30 !10 = !{!11, !11, !11}
31 !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
33 !15 = !DILocalVariable(name: "c", scope: !8, file: !1, line: 9, type: !11)
34 !16 = !DILocation(line: 8, column: 14, scope: !8)
35 !17 = !DILocation(line: 8, column: 21, scope: !8)
36 !18 = !DILocation(line: 9, column: 13, scope: !8)
37 !19 = !DILocation(line: 9, column: 7, scope: !8)
38 !20 = !DILocation(line: 2, column: 3, scope: !21, inlinedAt: !24)
39 !21 = distinct !DISubprogram(name: "force_spill", scope: !1, file: !1, line: 1, type: !22, scopeLine: 1, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
40 !22 = !DISubroutineType(types: !23)
42 !24 = distinct !DILocation(line: 10, column: 3, scope: !8)
44 !26 = !DILocation(line: 11, column: 3, scope: !8)
49 tracksRegLiveness: true
54 %4:gprc = nsw MULLW $r4, $r3, debug-location !18
55 DBG_VALUE %4, $noreg, !15, !DIExpression(), debug-location !19
56 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0, 12, implicit-def early-clobber $r1, 12, implicit-def early-clobber $r2, 12, implicit-def dead early-clobber $r3, 12, implicit-def dead early-clobber $r4, 12, implicit-def dead early-clobber $r5, 12, implicit-def dead early-clobber $r6, 12, implicit-def dead early-clobber $r7, 12, implicit-def dead early-clobber $r8, 12, implicit-def dead early-clobber $r9, 12, implicit-def dead early-clobber $r10, 12, implicit-def dead early-clobber $r11, 12, implicit-def dead early-clobber $r12, 12, implicit-def early-clobber $r13, 12, implicit-def dead early-clobber $r14, 12, implicit-def dead early-clobber $r15, 12, implicit-def dead early-clobber $r16, 12, implicit-def dead early-clobber $r17, 12, implicit-def dead early-clobber $r18, 12, implicit-def dead early-clobber $r19, 12, implicit-def dead early-clobber $r20, 12, implicit-def dead early-clobber $r21, 12, implicit-def dead early-clobber $r22, 12, implicit-def dead early-clobber $r23, 12, implicit-def dead early-clobber $r24, 12, implicit-def dead early-clobber $r25, 12, implicit-def dead early-clobber $r26, 12, implicit-def dead early-clobber $r27, 12, implicit-def dead early-clobber $r28, 12, implicit-def dead early-clobber $r29, 12, implicit-def dead early-clobber $r30, 12, implicit-def early-clobber $r31, !25, debug-location !20
57 %5:g8rc = EXTSW_32_64 %4, debug-location !26
58 $x3 = COPY %5, debug-location !26
59 BLR8 implicit $lr8, implicit $rm, implicit $x3, debug-location !26
63 # Verify that we get three DBG_VALUE instructions. One between the MULLW and
64 # the spill, one between the spill and reload, and one after the reload.
66 # CHECK-LABEL: name: test1
67 # CHECK: renamable [[REG1:\$r[0-9]+]] = nsw MULLW
68 # CHECK-NEXT: DBG_VALUE [[REG1]], $noreg, [[VAR:![0-9]+]], !DIExpression(),
69 # CHECK-NEXT: STW killed renamable [[REG1]], 0, %stack.0 ::
70 # CHECK-NEXT: DBG_VALUE %stack.0, 0, [[VAR]], !DIExpression(),
71 # CHECK-NEXT: INLINEASM
72 # CHECK-NEXT: renamable [[REG2:\$r[0-9]+]] = LWZ 0, %stack.0,
73 # CHECK-NEXT: DBG_VALUE [[REG2]], $noreg, [[VAR]], !DIExpression(),
74 # CHECK-NEXT: EXTSW_32_64 killed renamable [[REG2]],