1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O3 -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
3 # RUN: -mcpu=pwr9 -simplify-mir -run-pass=machine-cp %s -o - | FileCheck %s
10 tracksRegLiveness: true
13 ; CHECK-LABEL: name: test0
14 ; CHECK: $x3 = LI8 1024
15 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
16 renamable $x4 = LI8 1024
17 $x3 = COPY renamable killed $x4
18 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
26 tracksRegLiveness: true
28 ; CHECK-LABEL: name: test1
30 ; CHECK: renamable $x4 = LI8 42
34 ; CHECK: $x3 = COPY killed renamable $x4
35 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
39 renamable $x5 = LI8 42
40 renamable $x4 = COPY renamable killed $x5
45 $x3 = COPY renamable killed $x4
46 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
50 # Use reserved register
54 tracksRegLiveness: true
57 ; CHECK-LABEL: name: test2
58 ; CHECK: renamable $x4 = LI8 1024
59 ; CHECK: $x13 = COPY killed renamable $x4
60 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit undef $x3
61 renamable $x4 = LI8 1024
62 $x13 = COPY renamable killed $x4
63 BLR8 implicit $lr8, implicit undef $rm, implicit undef $x3
67 # Intermediate read of copy's src
71 tracksRegLiveness: true
74 ; CHECK-LABEL: name: test3
75 ; CHECK: renamable $x4 = LI8 0
76 ; CHECK: renamable $x5 = ADDI8 $x4, 1
77 ; CHECK: $x3 = COPY killed renamable $x4
78 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
80 renamable $x5 = ADDI8 $x4, 1
81 $x3 = COPY renamable killed $x4
82 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
86 # Intermediate read of copy's def
90 tracksRegLiveness: true
95 ; CHECK-LABEL: name: test4
97 ; CHECK: renamable $x4 = LI8 0
98 ; CHECK: renamable $x5 = ADDI8 $x3, 1
99 ; CHECK: $x3 = COPY killed renamable $x4
100 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
101 renamable $x4 = LI8 0
102 renamable $x5 = ADDI8 $x3, 1
103 $x3 = COPY renamable killed $x4
104 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
108 # Intermiediate clobber of copy's def
112 tracksRegLiveness: true
117 ; CHECK-LABEL: name: test5
118 ; CHECK: liveins: $x3, $x5
119 ; CHECK: renamable $x4 = LI8 0
120 ; CHECK: renamable $x3 = ADDI8 $x5, 1
121 ; CHECK: $x3 = COPY killed renamable $x4
122 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
123 renamable $x4 = LI8 0
124 renamable $x3 = ADDI8 $x5, 1
125 $x3 = COPY renamable killed $x4
126 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
131 name: iterative_deletion
133 tracksRegLiveness: true
138 ; CHECK-LABEL: name: iterative_deletion
139 ; CHECK: liveins: $x5
140 ; CHECK: renamable $x4 = ADDI8 killed renamable $x5, 1
141 ; CHECK: $x3 = COPY $x4
142 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
143 renamable $x6 = ADDI8 renamable killed $x5, 1
144 renamable $x4 = COPY renamable killed $x6
145 renamable $x7 = COPY renamable killed $x4
146 $x3 = COPY renamable killed $x7
147 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
154 tracksRegLiveness: true
158 ; CHECK-LABEL: name: Enter
159 ; CHECK: liveins: $x4, $x7
160 ; CHECK: renamable $x5 = COPY killed renamable $x7
161 ; CHECK: renamable $x7 = ADDI8 killed renamable $x4, 1
162 ; CHECK: $x3 = ADD8 killed renamable $x5, killed renamable $x7
163 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
164 renamable $x5 = COPY killed renamable $x7
165 renamable $x6 = ADDI8 killed renamable $x4, 1
166 renamable $x7 = COPY killed renamable $x6
167 $x3 = ADD8 renamable killed $x5, renamable killed $x7
168 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
175 tracksRegLiveness: true
179 ; CHECK-LABEL: name: foo
180 ; CHECK: liveins: $x4, $x7
181 ; CHECK: renamable $x5 = COPY killed renamable $x7
182 ; CHECK: renamable $x7 = ADDI8 renamable $x4, 1
183 ; CHECK: renamable $x6 = ADDI8 killed $x4, 2
184 ; CHECK: $x3 = ADD8 killed renamable $x5, killed renamable $x6
185 ; CHECK: $x3 = ADD8 $x3, killed renamable $x7
186 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
187 renamable $x5 = COPY killed renamable $x7
188 renamable $x6 = ADDI8 renamable $x4, 1
189 renamable $x7 = COPY killed renamable $x6
190 renamable $x8 = ADDI8 killed $x4, 2
191 renamable $x6 = COPY killed renamable $x8
192 $x3 = ADD8 renamable killed $x5, renamable killed $x6
193 $x3 = ADD8 $x3, renamable killed $x7
194 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
201 tracksRegLiveness: true
205 ; CHECK-LABEL: name: bar
206 ; CHECK: liveins: $x4, $x7
207 ; CHECK: renamable $x5 = COPY killed renamable $x7
208 ; CHECK: renamable $x7 = ADDI8 renamable $x4, 1
209 ; CHECK: renamable $x8 = COPY killed renamable $x7
210 ; CHECK: renamable $x7 = ADDI8 renamable $x5, 2
211 ; CHECK: $x3 = ADD8 killed renamable $x5, killed renamable $x7
212 ; CHECK: $x3 = ADD8 $x3, killed renamable $x8
213 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
214 renamable $x5 = COPY killed renamable $x7
215 renamable $x6 = ADDI8 renamable $x4, 1
216 renamable $x7 = COPY killed renamable $x6
217 renamable $x8 = COPY killed renamable $x7
218 renamable $x6 = ADDI8 renamable $x5, 2
219 renamable $x7 = COPY killed renamable $x6
220 $x3 = ADD8 renamable killed $x5, renamable killed $x7
221 $x3 = ADD8 $x3, renamable killed $x8
222 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
229 tracksRegLiveness: true
233 ; CHECK-LABEL: name: bogus
234 ; CHECK: liveins: $x7
235 ; CHECK: renamable $x5 = COPY renamable $x7
236 ; CHECK: renamable $x4 = ADDI8 $x7, 1
237 ; CHECK: renamable $x6 = ADDI8 renamable $x5, 2
238 ; CHECK: $x3 = ADD8 killed renamable $x4, killed renamable $x5
239 ; CHECK: $x3 = ADD8 $x3, killed renamable $x6
240 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
241 renamable $x5 = COPY killed renamable $x7
242 renamable $x6 = ADDI8 renamable $x5, 1
243 renamable $x4 = COPY killed renamable $x6
244 renamable $x7 = COPY killed renamable $x4
245 renamable $x6 = ADDI8 renamable $x5, 2
246 renamable $x4 = COPY killed renamable $x7
247 $x3 = ADD8 renamable killed $x4, renamable killed $x5
248 $x3 = ADD8 $x3, renamable killed $x6
249 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
256 tracksRegLiveness: true
260 ; CHECK-LABEL: name: foobar
261 ; CHECK: liveins: $x7
262 ; CHECK: renamable $x4 = ADDI8 $x7, 1
263 ; CHECK: renamable $x8 = COPY killed renamable $x4
264 ; CHECK: renamable $x4 = ADDI8 $x7, 2
265 ; CHECK: $x3 = ADD8 killed renamable $x4, $x7
266 ; CHECK: $x3 = ADD8 $x3, killed renamable $x8
267 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
268 renamable $x5 = COPY killed renamable $x7
269 renamable $x6 = ADDI8 renamable $x5, 1
270 renamable $x4 = COPY killed renamable $x6
271 renamable $x8 = COPY killed renamable $x4
272 renamable $x6 = ADDI8 renamable $x5, 2
273 renamable $x4 = COPY killed renamable $x6
274 $x3 = ADD8 renamable killed $x4, renamable killed $x5
275 $x3 = ADD8 $x3, renamable killed $x8
276 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
283 tracksRegLiveness: true
286 liveins: $x2, $x3, $x20
287 ; CHECK-LABEL: name: cross_call
288 ; CHECK: liveins: $x2, $x3, $x20
289 ; CHECK: renamable $x20 = LI8 1024
290 ; CHECK: BL8_NOP @foo, csr_ppc64_altivec, implicit-def $lr8, implicit $rm, implicit $x3, implicit-def $x3, implicit $x2
291 ; CHECK: $x3 = COPY killed renamable $x20
292 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
293 renamable $x20 = LI8 1024
294 BL8_NOP @foo, csr_ppc64_altivec, implicit-def $lr8, implicit $rm, implicit $x3, implicit-def $x3, implicit $x2
295 $x3 = COPY renamable killed $x20
296 BLR8 implicit $lr8, implicit undef $rm, implicit $x3