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
9 tracksRegLiveness: true
12 ; CHECK-LABEL: name: test0
13 ; CHECK: renamable $x4 = LI8 1024
14 ; CHECK: $x3 = COPY killed renamable $x4
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 $x5 = LI8 42
31 ; CHECK: renamable $x4 = COPY killed renamable $x5
35 ; CHECK: $x3 = COPY killed renamable $x4
36 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
40 renamable $x5 = LI8 42
41 renamable $x4 = COPY renamable killed $x5
46 $x3 = COPY renamable killed $x4
47 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
51 # Use reserved register
55 tracksRegLiveness: true
58 ; CHECK-LABEL: name: test2
59 ; CHECK: renamable $x4 = LI8 1024
60 ; CHECK: $x13 = COPY killed renamable $x4
61 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit undef $x3
62 renamable $x4 = LI8 1024
63 $x13 = COPY renamable killed $x4
64 BLR8 implicit $lr8, implicit undef $rm, implicit undef $x3
68 # Intermediate read of copy's src
72 tracksRegLiveness: true
75 ; CHECK-LABEL: name: test3
76 ; CHECK: renamable $x4 = LI8 0
77 ; CHECK: renamable $x5 = ADDI8 $x4, 1
78 ; CHECK: $x3 = COPY killed renamable $x4
79 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
81 renamable $x5 = ADDI8 $x4, 1
82 $x3 = COPY renamable killed $x4
83 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
87 # Intermediate read of copy's def
91 tracksRegLiveness: true
96 ; CHECK-LABEL: name: test4
98 ; CHECK: renamable $x4 = LI8 0
99 ; CHECK: renamable $x5 = ADDI8 $x3, 1
100 ; CHECK: $x3 = COPY killed renamable $x4
101 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
102 renamable $x4 = LI8 0
103 renamable $x5 = ADDI8 $x3, 1
104 $x3 = COPY renamable killed $x4
105 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
109 # Intermiediate clobber of copy's def
113 tracksRegLiveness: true
118 ; CHECK-LABEL: name: test5
119 ; CHECK: liveins: $x3, $x5
120 ; CHECK: renamable $x4 = LI8 0
121 ; CHECK: renamable $x3 = ADDI8 $x5, 1
122 ; CHECK: $x3 = COPY killed renamable $x4
123 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
124 renamable $x4 = LI8 0
125 renamable $x3 = ADDI8 $x5, 1
126 $x3 = COPY renamable killed $x4
127 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
132 name: iterative_deletion
134 tracksRegLiveness: true
139 ; CHECK-LABEL: name: iterative_deletion
140 ; CHECK: liveins: $x5
141 ; CHECK: renamable $x6 = ADDI8 killed renamable $x5, 1
142 ; CHECK: $x3 = COPY $x6
143 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
144 renamable $x6 = ADDI8 renamable killed $x5, 1
145 renamable $x4 = COPY renamable killed $x6
146 renamable $x7 = COPY renamable killed $x4
147 $x3 = COPY renamable killed $x7
148 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
155 tracksRegLiveness: true
159 ; CHECK-LABEL: name: Enter
160 ; CHECK: liveins: $x4, $x7
161 ; CHECK: renamable $x5 = COPY killed renamable $x7
162 ; CHECK: renamable $x6 = ADDI8 killed renamable $x4, 1
163 ; CHECK: $x3 = ADD8 killed renamable $x5, $x6
164 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
165 renamable $x5 = COPY killed renamable $x7
166 renamable $x6 = ADDI8 killed renamable $x4, 1
167 renamable $x7 = COPY killed renamable $x6
168 $x3 = ADD8 renamable killed $x5, renamable killed $x7
169 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
176 tracksRegLiveness: true
180 ; CHECK-LABEL: name: foo
181 ; CHECK: liveins: $x4, $x7
182 ; CHECK: renamable $x5 = COPY killed renamable $x7
183 ; CHECK: renamable $x6 = ADDI8 renamable $x4, 1
184 ; CHECK: renamable $x7 = COPY killed renamable $x6
185 ; CHECK: renamable $x8 = ADDI8 killed $x4, 2
186 ; CHECK: $x3 = ADD8 killed renamable $x5, $x8
187 ; CHECK: $x3 = ADD8 $x3, killed renamable $x7
188 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
189 renamable $x5 = COPY killed renamable $x7
190 renamable $x6 = ADDI8 renamable $x4, 1
191 renamable $x7 = COPY killed renamable $x6
192 renamable $x8 = ADDI8 killed $x4, 2
193 renamable $x6 = COPY killed renamable $x8
194 $x3 = ADD8 renamable killed $x5, renamable killed $x6
195 $x3 = ADD8 $x3, renamable killed $x7
196 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
203 tracksRegLiveness: true
207 ; CHECK-LABEL: name: bar
208 ; CHECK: liveins: $x4, $x7
209 ; CHECK: renamable $x5 = COPY killed renamable $x7
210 ; CHECK: renamable $x6 = ADDI8 renamable $x4, 1
211 ; CHECK: renamable $x8 = COPY $x6
212 ; CHECK: renamable $x6 = ADDI8 renamable $x5, 2
213 ; CHECK: $x3 = ADD8 killed renamable $x5, $x6
214 ; CHECK: $x3 = ADD8 $x3, killed renamable $x8
215 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
216 renamable $x5 = COPY killed renamable $x7
217 renamable $x6 = ADDI8 renamable $x4, 1
218 renamable $x7 = COPY killed renamable $x6
219 renamable $x8 = COPY killed renamable $x7
220 renamable $x6 = ADDI8 renamable $x5, 2
221 renamable $x7 = COPY killed renamable $x6
222 $x3 = ADD8 renamable killed $x5, renamable killed $x7
223 $x3 = ADD8 $x3, renamable killed $x8
224 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
231 tracksRegLiveness: true
235 ; CHECK-LABEL: name: bogus
236 ; CHECK: liveins: $x7
237 ; CHECK: renamable $x5 = COPY renamable $x7
238 ; CHECK: renamable $x6 = ADDI8 $x7, 1
239 ; CHECK: renamable $x7 = COPY $x6
240 ; CHECK: renamable $x6 = ADDI8 renamable $x5, 2
241 ; CHECK: $x3 = ADD8 $x7, killed renamable $x5
242 ; CHECK: $x3 = ADD8 $x3, killed renamable $x6
243 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
244 renamable $x5 = COPY killed renamable $x7
245 renamable $x6 = ADDI8 renamable $x5, 1
246 renamable $x4 = COPY killed renamable $x6
247 renamable $x7 = COPY killed renamable $x4
248 renamable $x6 = ADDI8 renamable $x5, 2
249 renamable $x4 = COPY killed renamable $x7
250 $x3 = ADD8 renamable killed $x4, renamable killed $x5
251 $x3 = ADD8 $x3, renamable killed $x6
252 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
259 tracksRegLiveness: true
263 ; CHECK-LABEL: name: foobar
264 ; CHECK: liveins: $x7
265 ; CHECK: renamable $x6 = ADDI8 $x7, 1
266 ; CHECK: renamable $x8 = COPY $x6
267 ; CHECK: renamable $x6 = ADDI8 $x7, 2
268 ; CHECK: $x3 = ADD8 $x6, $x7
269 ; CHECK: $x3 = ADD8 $x3, killed renamable $x8
270 ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
271 renamable $x5 = COPY killed renamable $x7
272 renamable $x6 = ADDI8 renamable $x5, 1
273 renamable $x4 = COPY killed renamable $x6
274 renamable $x8 = COPY killed renamable $x4
275 renamable $x6 = ADDI8 renamable $x5, 2
276 renamable $x4 = COPY killed renamable $x6
277 $x3 = ADD8 renamable killed $x4, renamable killed $x5
278 $x3 = ADD8 $x3, renamable killed $x8
279 BLR8 implicit $lr8, implicit undef $rm, implicit $x3