xref: /llvm-project/llvm/test/CodeGen/AArch64/stp-opt-with-renaming-debug.mir (revision 1f54ef78d57b374dbc86a76419b0ced5162c5bdc)
1# RUN: llc -run-pass=aarch64-ldst-opt -mtriple=arm64-apple-iphoneos -aarch64-load-store-renaming=true -verify-machineinstrs -o - %s | FileCheck %s
2--- |
3  define void @test_dbg_value1() #0 { ret void }
4  define void @test_dbg_value2() #0 { ret void }
5
6  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
7  !1 = !DIFile(filename: "dbg.ll", directory: "/tmp")
8  !2 = !{}
9  !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)
10  !6 = !DISubroutineType(types: !2)
11  !7 = !DILocalVariable(name: "x", arg: 1, scope: !5, file: !1, line: 1, type: !8)
12  !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
13  !9 = !DILocation(line: 1, column: 1, scope: !5)
14  !10 = !{i32 2, !"Debug Info Version", i32 3}
15  !llvm.dbg.cu = !{!0}
16  !llvm.module.flags = !{!10}
17---
18# Check we do not crash when checking $noreg debug operands.
19#
20# CHECK-LABEL: name: test_dbg_value1
21# CHECK: bb.0:
22# CHECK-NEXT: liveins: $x0, $x1
23# CHECK:       $x10, renamable $x8 = LDPXi renamable $x0, 0 :: (load (s64))
24# CHECK-NEXT:  renamable $x9 = LDRXui renamable $x0, 1 :: (load (s64))
25# CHECK-NEXT:  STRXui renamable $x9, renamable $x0, 100 :: (store (s64), align 4)
26# CHECK-NEXT:  DBG_VALUE $x9, $noreg
27# CHECK-NEXT:  renamable $x8 = ADDXrr $x8, $x8
28# CHECK-NEXT:  STPXi renamable $x8, killed $x10, renamable $x0, 10 :: (store (s64), align 4)
29# CHECK-NEXT:  RET undef $lr
30name:           test_dbg_value1
31alignment:       4
32tracksRegLiveness: true
33liveins:
34  - { reg: '$x0' }
35  - { reg: '$x1' }
36  - { reg: '$x8' }
37frameInfo:
38  maxAlignment:    1
39  maxCallFrameSize: 0
40machineFunctionInfo: {}
41body:             |
42  bb.0:
43    liveins: $x0, $x1
44    renamable $x9, renamable $x8 = LDPXi renamable $x0, 0 :: (load (s64))
45    STRXui renamable killed $x9, renamable $x0, 11 :: (store (s64), align 4)
46    renamable $x9 = LDRXui renamable $x0, 1 :: (load (s64))
47    STRXui renamable $x9, renamable $x0, 100 :: (store (s64), align 4)
48    DBG_VALUE $x9, $noreg, !7, !DIExpression(DW_OP_plus_uconst, 32), debug-location !9
49    renamable $x8 = ADDXrr $x8, $x8
50    STRXui renamable $x8, renamable $x0, 10 :: (store (s64), align 4)
51    RET undef $lr
52
53...
54
55# CHECK-LABEL: name: test_dbg_value2
56# CHECK: bb.0:
57# CHECK-NEXT: liveins: $x19, $x20, $x0
58
59# CHECK:       $x8 = ORRXrs $xzr, $x0, 0
60# CHECK-NEXT:  renamable $x0 = nuw ADDXri $x0, 8, 0
61# CHECK-NEXT:  DBG_VALUE $x0, $noreg,
62# CHECK-NEXT:  STRXui killed renamable $x8, renamable $x19, 2 :: (store (s64))
63# CHECK-NEXT:  $x8 = ADDXrs renamable $x0, killed renamable $x20, 0
64# CHECK-NEXT:  STPXi $xzr, killed renamable $x8, renamable $x19, 0 :: (store (s64))
65# CHECK-NEXT:  RET undef $lr, implicit $x0
66name:            test_dbg_value2
67alignment:       4
68tracksRegLiveness: true
69liveins:
70  - { reg: '$x0' }
71  - { reg: '$x1' }
72frameInfo:
73  maxAlignment:    1
74  maxCallFrameSize: 0
75machineFunctionInfo: {}
76body:             |
77  bb.0:
78    liveins: $x19, $x20, $x0
79
80    $x8 = ORRXrs $xzr, $x0, 0
81    renamable $x0 = nuw ADDXri $x0, 8, 0
82    DBG_VALUE $x0, $noreg, !7, !DIExpression(), debug-location !9
83    STRXui killed renamable $x8, renamable $x19, 2 :: (store (s64))
84    $x8 = ADDXrs renamable $x0, killed renamable $x20, 0
85    STRXui $xzr, renamable $x19, 0 :: (store (s64))
86    STRXui killed renamable $x8, killed renamable $x19, 1 :: (store (s64))
87    RET undef $lr, implicit $x0
88...
89