1 # RUN: llc -ppc-asm-full-reg-names -mtriple=powerpc-ibm-aix-xcoff \
2 # RUN: -run-pass=ppc-ctrloops %s -o - -verify-machineinstrs | FileCheck %s
8 tracksRegLiveness: true
18 MTCTRloop killed %0:gprc, implicit-def dead $ctr
22 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
23 BC killed %1:crbitrc, %bb.1
28 BLR implicit $lr, implicit $rm
31 name: test_fail_clobber
32 # CHECK: test_fail_clobber
33 tracksRegLiveness: true
38 ; CHECK-NOT: MTCTRloop
43 MTCTRloop killed %0:gprc, implicit-def dead $ctr
47 INLINEASM &"", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def early-clobber $ctr
48 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
49 BC killed %1:crbitrc, %bb.1
54 BLR implicit $lr, implicit $rm
57 name: test_fail_use_in_loop
58 # CHECK: test_fail_use_in_loop
59 tracksRegLiveness: true
64 ; CHECK-NOT: MTCTRloop
69 MTCTRloop killed %0:gprc, implicit-def dead $ctr
73 %1:gprc = MFCTR implicit $ctr
74 %2:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
75 BC killed %2:crbitrc, %bb.1
80 BLR implicit $lr, implicit $rm
83 name: test_fail_call_in_preheader_after_mtctr
84 # CHECK: test_fail_call_in_preheader_after_mtctr
85 tracksRegLiveness: true
95 MTCTRloop killed %0:gprc, implicit-def dead $ctr
96 BL @test_fail_use_in_loop, csr_aix32, implicit-def dead $lr, implicit $rm
100 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
101 BC killed %1:crbitrc, %bb.1
106 BLR implicit $lr, implicit $rm
109 name: test_succ_call_in_preheader_before_mtctr
110 # CHECK: test_succ_call_in_preheader_before_mtctr
111 tracksRegLiveness: true
116 BL @test_fail_use_in_loop, csr_aix32, implicit-def dead $lr, implicit $rm
122 MTCTRloop killed %0:gprc, implicit-def dead $ctr
126 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
127 BC killed %1:crbitrc, %bb.1
132 BLR implicit $lr, implicit $rm
135 name: test_fail_call_in_loop
136 # CHECK: test_fail_call_in_loop
137 tracksRegLiveness: true
147 MTCTRloop killed %0:gprc, implicit-def dead $ctr
151 BL @test_fail_use_in_loop, csr_aix32, implicit-def dead $lr, implicit $rm
152 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
153 BC killed %1:crbitrc, %bb.1
158 BLR implicit $lr, implicit $rm
161 name: test_fail_indirect_call_in_loop
162 # CHECK: test_fail_indirect_call_in_loop
163 tracksRegLiveness: true
174 renamable %1:crrc = CMPLW killed renamable $r3, killed renamable $r4
175 renamable %2:crbitrc = COPY %1.sub_gt
176 MTLR %0:gprc, implicit-def $lr
177 MTCTRloop %0:gprc, implicit-def dead $ctr
181 BCLRL renamable %2, implicit $lr, implicit $rm
182 %3:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
183 BC killed %3:crbitrc, %bb.1
188 BLR implicit $lr, implicit $rm
191 name: test_fail_livein_preheader
192 # CHECK: test_fail_livein_preheader
193 tracksRegLiveness: true
199 ; CHECK-NOT: MTCTRloop
204 MTCTRloop killed %0:gprc, implicit-def dead $ctr
208 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
209 BC killed %1:crbitrc, %bb.1
214 BLR implicit $lr, implicit $rm
217 name: test_fail_def_preheader
218 # CHECK: test_fail_def_preheader
219 tracksRegLiveness: true
223 INLINEASM &"", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def early-clobber $ctr
225 ; CHECK-NOT: MTCTRloop
230 MTCTRloop killed %0:gprc, implicit-def dead $ctr
234 %1:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
235 BC killed %1:crbitrc, %bb.1
240 BLR implicit $lr, implicit $rm
243 name: test_success_only_use_preheader
244 # CHECK: test_success_only_use_preheader
245 tracksRegLiveness: true
249 %0:gprc = MFCTR implicit $ctr
256 MTCTRloop killed %1:gprc, implicit-def dead $ctr
260 %2:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
261 BC killed %2:crbitrc, %bb.1
266 BLR implicit $lr, implicit $rm
269 name: test_fail_use_after_mtctr
270 # CHECK: test_fail_use_after_mtctr
271 tracksRegLiveness: true
276 ; CHECK-NOT: MTCTRloop
281 MTCTRloop killed %0:gprc, implicit-def dead $ctr
282 %1:gprc = MFCTR implicit $ctr
286 %2:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
287 BC killed %2:crbitrc, %bb.1
292 BLR implicit $lr, implicit $rm
295 name: test_fail_def_after_mtctr
296 # CHECK: test_fail_def_after_mtctr
297 tracksRegLiveness: true
302 ; CHECK-NOT: MTCTRloop
307 MTCTRloop killed %0:gprc, implicit-def dead $ctr
308 INLINEASM &"", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def early-clobber $ctr
312 %2:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
313 BC killed %2:crbitrc, %bb.1
318 BLR implicit $lr, implicit $rm
321 name: test_success_def_after_loop
322 # CHECK: test_success_def_after_loop
323 tracksRegLiveness: true
333 MTCTRloop killed %0:gprc, implicit-def dead $ctr
337 %2:crbitrc = DecreaseCTRloop 1, implicit-def dead $ctr, implicit $ctr
338 BC killed %2:crbitrc, %bb.1
342 INLINEASM &"", 1 /* sideeffect attdialect */, 12 /* clobber */, implicit-def early-clobber $ctr
344 BLR implicit $lr, implicit $rm