1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -mtriple=riscv32 -mattr=+zcmp -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
3 # RUN: | FileCheck -check-prefixes=CHECK-ZCMP32 %s
4 # RUN: llc -mtriple=riscv32 -mattr=+save-restore -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
5 # RUN: | FileCheck -check-prefixes=CHECK-LIBCALL32 %s
6 # RUN: llc -mtriple=riscv64 -mattr=+zcmp -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
7 # RUN: | FileCheck -check-prefixes=CHECK-ZCMP64 %s
8 # RUN: llc -mtriple=riscv64 -mattr=+save-restore -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
9 # RUN: | FileCheck -check-prefixes=CHECK-LIBCALL64 %s
10 # RUN: llc -mtriple=riscv32 -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
11 # RUN: | FileCheck -check-prefixes=CHECK-NO-ZCMP32 %s
12 # RUN: llc -mtriple=riscv64 -x mir -start-before=prologepilog -stop-after=riscv-push-pop-opt -verify-machineinstrs -o - %s \
13 # RUN: | FileCheck -check-prefixes=CHECK-NO-ZCMP64 %s
16 tracksRegLiveness: true
19 ; CHECK-ZCMP32-LABEL: name: popret_rvlist5
20 ; CHECK-ZCMP32: liveins: $x1, $x8
21 ; CHECK-ZCMP32-NEXT: {{ $}}
22 ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
23 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
24 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
25 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -4
26 ; CHECK-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
27 ; CHECK-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
28 ; CHECK-ZCMP32-NEXT: CM_POPRET 5, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8
30 ; CHECK-LIBCALL32-LABEL: name: popret_rvlist5
31 ; CHECK-LIBCALL32: liveins: $x1, $x8
32 ; CHECK-LIBCALL32-NEXT: {{ $}}
33 ; CHECK-LIBCALL32-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
34 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
35 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
36 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
37 ; CHECK-LIBCALL32-NEXT: $x1 = IMPLICIT_DEF
38 ; CHECK-LIBCALL32-NEXT: $x8 = IMPLICIT_DEF
39 ; CHECK-LIBCALL32-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2
41 ; CHECK-ZCMP64-LABEL: name: popret_rvlist5
42 ; CHECK-ZCMP64: liveins: $x1, $x8
43 ; CHECK-ZCMP64-NEXT: {{ $}}
44 ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
45 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
46 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -16
47 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
48 ; CHECK-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
49 ; CHECK-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
50 ; CHECK-ZCMP64-NEXT: CM_POPRET 5, 0, implicit-def $x2, implicit $x2, implicit-def $x1, implicit-def $x8
52 ; CHECK-LIBCALL64-LABEL: name: popret_rvlist5
53 ; CHECK-LIBCALL64: liveins: $x1, $x8
54 ; CHECK-LIBCALL64-NEXT: {{ $}}
55 ; CHECK-LIBCALL64-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
56 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
57 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
58 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
59 ; CHECK-LIBCALL64-NEXT: $x1 = IMPLICIT_DEF
60 ; CHECK-LIBCALL64-NEXT: $x8 = IMPLICIT_DEF
61 ; CHECK-LIBCALL64-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2
63 ; CHECK-NO-ZCMP32-LABEL: name: popret_rvlist5
64 ; CHECK-NO-ZCMP32: liveins: $x1, $x8
65 ; CHECK-NO-ZCMP32-NEXT: {{ $}}
66 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-setup ADDI $x2, -16
67 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
68 ; CHECK-NO-ZCMP32-NEXT: SW killed $x1, $x2, 12 :: (store (s32) into %stack.0)
69 ; CHECK-NO-ZCMP32-NEXT: SW killed $x8, $x2, 8 :: (store (s32) into %stack.1)
70 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
71 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
72 ; CHECK-NO-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
73 ; CHECK-NO-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
74 ; CHECK-NO-ZCMP32-NEXT: $x1 = LW $x2, 12 :: (load (s32) from %stack.0)
75 ; CHECK-NO-ZCMP32-NEXT: $x8 = LW $x2, 8 :: (load (s32) from %stack.1)
76 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-destroy ADDI $x2, 16
77 ; CHECK-NO-ZCMP32-NEXT: PseudoRET
79 ; CHECK-NO-ZCMP64-LABEL: name: popret_rvlist5
80 ; CHECK-NO-ZCMP64: liveins: $x1, $x8
81 ; CHECK-NO-ZCMP64-NEXT: {{ $}}
82 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-setup ADDI $x2, -16
83 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
84 ; CHECK-NO-ZCMP64-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
85 ; CHECK-NO-ZCMP64-NEXT: SD killed $x8, $x2, 0 :: (store (s64) into %stack.1)
86 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
87 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
88 ; CHECK-NO-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
89 ; CHECK-NO-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
90 ; CHECK-NO-ZCMP64-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
91 ; CHECK-NO-ZCMP64-NEXT: $x8 = LD $x2, 0 :: (load (s64) from %stack.1)
92 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-destroy ADDI $x2, 16
93 ; CHECK-NO-ZCMP64-NEXT: PseudoRET
100 tracksRegLiveness: true
103 ; CHECK-ZCMP32-LABEL: name: popretz_rvlist5
104 ; CHECK-ZCMP32: liveins: $x1, $x8
105 ; CHECK-ZCMP32-NEXT: {{ $}}
106 ; CHECK-ZCMP32-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
107 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
108 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
109 ; CHECK-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -4
110 ; CHECK-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
111 ; CHECK-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
112 ; CHECK-ZCMP32-NEXT: CM_POPRETZ 5, 0, implicit-def $x2, implicit-def $x10, implicit $x2, implicit-def $x1, implicit-def $x8
114 ; CHECK-LIBCALL32-LABEL: name: popretz_rvlist5
115 ; CHECK-LIBCALL32: liveins: $x1, $x8
116 ; CHECK-LIBCALL32-NEXT: {{ $}}
117 ; CHECK-LIBCALL32-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
118 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
119 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
120 ; CHECK-LIBCALL32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
121 ; CHECK-LIBCALL32-NEXT: $x1 = IMPLICIT_DEF
122 ; CHECK-LIBCALL32-NEXT: $x8 = IMPLICIT_DEF
123 ; CHECK-LIBCALL32-NEXT: $x10 = ADDI $x0, 0
124 ; CHECK-LIBCALL32-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2, implicit $x10
126 ; CHECK-ZCMP64-LABEL: name: popretz_rvlist5
127 ; CHECK-ZCMP64: liveins: $x1, $x8
128 ; CHECK-ZCMP64-NEXT: {{ $}}
129 ; CHECK-ZCMP64-NEXT: frame-setup CM_PUSH 5, 0, implicit-def $x2, implicit $x2, implicit $x1, implicit $x8
130 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
131 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -16
132 ; CHECK-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
133 ; CHECK-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
134 ; CHECK-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
135 ; CHECK-ZCMP64-NEXT: CM_POPRETZ 5, 0, implicit-def $x2, implicit-def $x10, implicit $x2, implicit-def $x1, implicit-def $x8
137 ; CHECK-LIBCALL64-LABEL: name: popretz_rvlist5
138 ; CHECK-LIBCALL64: liveins: $x1, $x8
139 ; CHECK-LIBCALL64-NEXT: {{ $}}
140 ; CHECK-LIBCALL64-NEXT: $x5 = frame-setup PseudoCALLReg target-flags(riscv-call) &__riscv_save_1
141 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
142 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
143 ; CHECK-LIBCALL64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
144 ; CHECK-LIBCALL64-NEXT: $x1 = IMPLICIT_DEF
145 ; CHECK-LIBCALL64-NEXT: $x8 = IMPLICIT_DEF
146 ; CHECK-LIBCALL64-NEXT: $x10 = ADDI $x0, 0
147 ; CHECK-LIBCALL64-NEXT: frame-destroy PseudoTAIL target-flags(riscv-call) &__riscv_restore_1, implicit $x2, implicit $x10
149 ; CHECK-NO-ZCMP32-LABEL: name: popretz_rvlist5
150 ; CHECK-NO-ZCMP32: liveins: $x1, $x8
151 ; CHECK-NO-ZCMP32-NEXT: {{ $}}
152 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-setup ADDI $x2, -16
153 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
154 ; CHECK-NO-ZCMP32-NEXT: SW killed $x1, $x2, 12 :: (store (s32) into %stack.0)
155 ; CHECK-NO-ZCMP32-NEXT: SW killed $x8, $x2, 8 :: (store (s32) into %stack.1)
156 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -4
157 ; CHECK-NO-ZCMP32-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -8
158 ; CHECK-NO-ZCMP32-NEXT: $x1 = IMPLICIT_DEF
159 ; CHECK-NO-ZCMP32-NEXT: $x8 = IMPLICIT_DEF
160 ; CHECK-NO-ZCMP32-NEXT: $x10 = ADDI $x0, 0
161 ; CHECK-NO-ZCMP32-NEXT: $x1 = LW $x2, 12 :: (load (s32) from %stack.0)
162 ; CHECK-NO-ZCMP32-NEXT: $x8 = LW $x2, 8 :: (load (s32) from %stack.1)
163 ; CHECK-NO-ZCMP32-NEXT: $x2 = frame-destroy ADDI $x2, 16
164 ; CHECK-NO-ZCMP32-NEXT: PseudoRET implicit $x10
166 ; CHECK-NO-ZCMP64-LABEL: name: popretz_rvlist5
167 ; CHECK-NO-ZCMP64: liveins: $x1, $x8
168 ; CHECK-NO-ZCMP64-NEXT: {{ $}}
169 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-setup ADDI $x2, -16
170 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
171 ; CHECK-NO-ZCMP64-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
172 ; CHECK-NO-ZCMP64-NEXT: SD killed $x8, $x2, 0 :: (store (s64) into %stack.1)
173 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
174 ; CHECK-NO-ZCMP64-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
175 ; CHECK-NO-ZCMP64-NEXT: $x1 = IMPLICIT_DEF
176 ; CHECK-NO-ZCMP64-NEXT: $x8 = IMPLICIT_DEF
177 ; CHECK-NO-ZCMP64-NEXT: $x10 = ADDI $x0, 0
178 ; CHECK-NO-ZCMP64-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
179 ; CHECK-NO-ZCMP64-NEXT: $x8 = LD $x2, 0 :: (load (s64) from %stack.1)
180 ; CHECK-NO-ZCMP64-NEXT: $x2 = frame-destroy ADDI $x2, 16
181 ; CHECK-NO-ZCMP64-NEXT: PseudoRET implicit $x10
185 PseudoRET implicit $x10