1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve -run-pass=arm-block-placement -verify-machineinstrs %s -o - | FileCheck %s
5 ; Checks that Predecessor gets moved (to before the LoopExit) if it contains a backward WLS.
6 define void @backwards_branch(i32 %N, ptr nocapture %a, ptr nocapture readonly %b) {
11 ; Checks that Predecessor (containing a backwards WLS) does not get moved to before the loopExit if it is the entry block.
12 define void @backwards_branch_entry_block(i32 %N, ptr nocapture %a, ptr nocapture readonly %b) {
17 ; Checks that Predecessor (to which a forward WLS exists) is not moved if moving it would cause the WLS to become backwards branching.
18 define void @backwards_branch_backwards_wls(i32 %N, i32 %M, ptr nocapture %a, ptr nocapture %b, ptr nocapture %c) {
23 ; Checks that a MachineFunction is unaffected if it doesn't contain any WLS (pseudo) instruction.
24 define void @no_predecessor(i32 %N, i32 %M, ptr nocapture %a, ptr nocapture %b, ptr nocapture %c) {
29 ; Within a nested (Both the WLS and loopExit are at depth=3 here) loop, checks that Predecessor
30 ; gets moved (in backward direction) if there exists a backdwards WLS from it to the LoopExit.
31 define void @nested_loops(i32 %n, i32 %m, i32 %l, ptr noalias %X, ptr noalias %Y) {
36 ; Checks that Predecessor (to which a forward WLS exists) is moved if moving it would NOT cause the WLS
37 ; to become backwards branching.
38 define void @backwards_branch_forwards_wls(i32 %N, i32 %M, ptr nocapture %a, ptr nocapture %b, ptr nocapture %c) {
43 ; Checks that multiple predecessor case is handled appropriately
44 define void @multiple_predecessors(i32 %d, i32 %e, i32 %f) {
49 ; Checks that blocks after jump tables work
50 define void @jump_table(i32 %d, i32 %e, i32 %f) {
55 declare dso_local i32 @g(...)
57 declare dso_local i32 @h(...)
61 name: backwards_branch
62 tracksRegLiveness: true
64 ; CHECK-LABEL: name: backwards_branch
66 ; CHECK-NEXT: successors: %bb.1(0x80000000)
67 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $lr
69 ; CHECK-NEXT: tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
70 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
71 ; CHECK-NEXT: frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
74 ; CHECK-NEXT: successors: %bb.3(0x80000000)
75 ; CHECK-NEXT: liveins: $r0, $r1, $r2
77 ; CHECK-NEXT: $lr = t2WhileLoopStartLR killed renamable $r0, %bb.2, implicit-def dead $cpsr
78 ; CHECK-NEXT: t2B %bb.3, 14 /* CC::al */, $noreg
81 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
84 ; CHECK-NEXT: successors: %bb.3(0x7c000000), %bb.2(0x04000000)
85 ; CHECK-NEXT: liveins: $lr, $r1, $r2
87 ; CHECK-NEXT: renamable $r0 = tLDRi renamable $r2, 0, 14 /* CC::al */, $noreg
88 ; CHECK-NEXT: tSTRi killed renamable $r0, renamable $r1, 0, 14 /* CC::al */, $noreg
89 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.3, implicit-def dead $cpsr
90 ; CHECK-NEXT: t2B %bb.2, 14 /* CC::al */, $noreg
92 successors: %bb.2(0x80000000)
93 liveins: $r0, $r1, $r2, $lr
95 tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
96 t2IT 11, 8, implicit-def $itstate
97 frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
100 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
103 successors: %bb.3(0x80000000)
104 liveins: $r0, $r1, $r2
106 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.1, implicit-def dead $cpsr
109 successors: %bb.3(0x7c000000), %bb.1(0x04000000)
110 liveins: $lr, $r1, $r2
112 renamable $r0 = tLDRi renamable $r2, 0, 14 /* CC::al */, $noreg
113 tSTRi killed renamable $r0, renamable $r1, 0, 14 /* CC::al */, $noreg
114 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.3, implicit-def dead $cpsr
115 t2B %bb.1, 14 /* CC::al */, $noreg
119 name: backwards_branch_entry_block
120 tracksRegLiveness: true
122 ; CHECK-LABEL: name: backwards_branch_entry_block
124 ; CHECK-NEXT: successors: %bb.2(0x80000000)
125 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $lr
127 ; CHECK-NEXT: tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
128 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
129 ; CHECK-NEXT: frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
132 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
135 ; CHECK-NEXT: successors: %bb.3(0x80000000)
136 ; CHECK-NEXT: liveins: $r0, $r1, $r2
138 ; CHECK-NEXT: $lr = t2WhileLoopStartLR killed renamable $r0, %bb.0, implicit-def dead $cpsr
141 ; CHECK-NEXT: successors: %bb.3(0x7c000000), %bb.1(0x04000000)
142 ; CHECK-NEXT: liveins: $lr, $r1, $r2
144 ; CHECK-NEXT: renamable $r0 = tLDRi renamable $r2, 0, 14 /* CC::al */, $noreg
145 ; CHECK-NEXT: tSTRi killed renamable $r0, renamable $r1, 0, 14 /* CC::al */, $noreg
146 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.3, implicit-def dead $cpsr
147 ; CHECK-NEXT: t2B %bb.1, 14 /* CC::al */, $noreg
149 successors: %bb.2(0x80000000)
150 liveins: $r0, $r1, $r2, $lr
152 tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
153 t2IT 11, 8, implicit-def $itstate
154 frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
157 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
160 successors: %bb.3(0x80000000)
161 liveins: $r0, $r1, $r2
163 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.0, implicit-def dead $cpsr
166 successors: %bb.3(0x7c000000), %bb.1(0x04000000)
167 liveins: $lr, $r1, $r2
169 renamable $r0 = tLDRi renamable $r2, 0, 14 /* CC::al */, $noreg
170 tSTRi killed renamable $r0, renamable $r1, 0, 14 /* CC::al */, $noreg
171 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.3, implicit-def dead $cpsr
172 t2B %bb.1, 14 /* CC::al */, $noreg
176 name: backwards_branch_backwards_wls
177 tracksRegLiveness: true
179 ; CHECK-LABEL: name: backwards_branch_backwards_wls
181 ; CHECK-NEXT: successors: %bb.2(0x80000000)
182 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $lr
184 ; CHECK-NEXT: tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
185 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
186 ; CHECK-NEXT: frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
189 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
192 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.6(0x40000000)
193 ; CHECK-NEXT: liveins: $r0, $r1, $r2
195 ; CHECK-NEXT: $lr = t2WhileLoopStartLR killed renamable $r0, %bb.3, implicit-def dead $cpsr
196 ; CHECK-NEXT: t2B %bb.6, 14 /* CC::al */, $noreg
199 ; CHECK-NEXT: successors: %bb.1(0x7c000000), %bb.4(0x04000000)
200 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r2
202 ; CHECK-NEXT: t2CMPri renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
203 ; CHECK-NEXT: t2Bcc %bb.1, 0 /* CC::eq */, $cpsr
206 ; CHECK-NEXT: successors: %bb.5(0x80000000)
207 ; CHECK-NEXT: liveins: $r2, $r1, $r0
209 ; CHECK-NEXT: $lr = t2DoLoopStart renamable $r0
210 ; CHECK-NEXT: t2B %bb.5, 14 /* CC::al */, $noreg
213 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.5(0x40000000)
214 ; CHECK-NEXT: liveins: $lr, $r1, $r2
216 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.5, implicit-def dead $cpsr
217 ; CHECK-NEXT: t2B %bb.1, 14 /* CC::al */, $noreg
220 ; CHECK-NEXT: successors: %bb.6(0x40000000), %bb.3(0x40000000)
221 ; CHECK-NEXT: liveins: $lr, $r1, $r2
223 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.6, implicit-def dead $cpsr
224 ; CHECK-NEXT: t2B %bb.3, 14 /* CC::al */, $noreg
226 successors: %bb.2(0x80000000)
227 liveins: $r0, $r1, $r2, $lr
229 tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
230 t2IT 11, 8, implicit-def $itstate
231 frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
234 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
237 successors: %bb.3(0x80000000), %bb.5(0x80000000)
238 liveins: $r0, $r1, $r2
240 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.3, implicit-def dead $cpsr
241 t2B %bb.5, 14 /* CC::al */, $noreg
244 successors: %bb.1(0x7c000000), %bb.4(0x04000000)
245 liveins: $lr, $r0, $r1, $r2
247 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.1, implicit-def dead $cpsr
248 t2B %bb.4, 14 /* CC::al */, $noreg
251 successors: %bb.1, %bb.4
252 liveins: $lr, $r1, $r2
254 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.4, implicit-def dead $cpsr
255 t2B %bb.1, 14 /* CC::al */, $noreg
258 successors: %bb.5, %bb.3
259 liveins: $lr, $r1, $r2
261 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.5, implicit-def dead $cpsr
262 t2B %bb.3, 14 /* CC::al */, $noreg
266 tracksRegLiveness: true
268 ; CHECK-LABEL: name: no_predecessor
270 ; CHECK-NEXT: successors: %bb.2(0x30000000), %bb.1(0x50000000)
271 ; CHECK-NEXT: liveins: $r0, $r4, $r5, $r7, $lr
273 ; CHECK-NEXT: frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r4, killed $r5, $r7, killed $lr, implicit-def $sp, implicit $sp
274 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
275 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -4
276 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r7, -8
277 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r5, -12
278 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r4, -16
279 ; CHECK-NEXT: $r7 = frame-setup tADDrSPi $sp, 2, 14 /* CC::al */, $noreg
280 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $r7, 8
281 ; CHECK-NEXT: $r4 = tMOVr killed $r0, 14 /* CC::al */, $noreg
282 ; CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @g, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
283 ; CHECK-NEXT: tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
284 ; CHECK-NEXT: t2Bcc %bb.2, 0 /* CC::eq */, killed $cpsr
287 ; CHECK-NEXT: successors: %bb.4(0x80000000)
288 ; CHECK-NEXT: liveins: $r4
290 ; CHECK-NEXT: renamable $r0, dead $cpsr = tMOVi8 4, 14 /* CC::al */, $noreg
291 ; CHECK-NEXT: renamable $r5 = t2LDRSHi12 killed renamable $r0, 0, 14 /* CC::al */, $noreg
292 ; CHECK-NEXT: t2B %bb.4, 14 /* CC::al */, $noreg
295 ; CHECK-NEXT: successors: %bb.4(0x80000000)
296 ; CHECK-NEXT: liveins: $r4
298 ; CHECK-NEXT: renamable $r5, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
299 ; CHECK-NEXT: t2B %bb.4, 14 /* CC::al */, $noreg
302 ; CHECK-NEXT: successors: %bb.4(0x80000000)
303 ; CHECK-NEXT: liveins: $r4, $r5
305 ; CHECK-NEXT: $r0 = tMOVr $r5, 14 /* CC::al */, $noreg
306 ; CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @h, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def dead $r0
309 ; CHECK-NEXT: successors: %bb.5(0x04000000), %bb.3(0x7c000000)
310 ; CHECK-NEXT: liveins: $r4, $r5
312 ; CHECK-NEXT: renamable $r0 = tLDRi renamable $r4, 0, 14 /* CC::al */, $noreg
313 ; CHECK-NEXT: tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
314 ; CHECK-NEXT: t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
317 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r4, def $r5, def $r7, def $pc
319 successors: %bb.1(0x30000000), %bb.2(0x50000000)
320 liveins: $r0, $r4, $r5, $r7, $lr
322 frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r4, killed $r5, $r7, killed $lr, implicit-def $sp, implicit $sp
323 frame-setup CFI_INSTRUCTION def_cfa_offset 16
324 frame-setup CFI_INSTRUCTION offset $lr, -4
325 frame-setup CFI_INSTRUCTION offset $r7, -8
326 frame-setup CFI_INSTRUCTION offset $r5, -12
327 frame-setup CFI_INSTRUCTION offset $r4, -16
328 $r7 = frame-setup tADDrSPi $sp, 2, 14 /* CC::al */, $noreg
329 frame-setup CFI_INSTRUCTION def_cfa $r7, 8
330 $r4 = tMOVr killed $r0, 14 /* CC::al */, $noreg
331 tBL 14 /* CC::al */, $noreg, @g, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
332 tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
333 t2Bcc %bb.1, 0 /* CC::eq */, killed $cpsr
336 successors: %bb.3(0x80000000)
339 renamable $r0, dead $cpsr = tMOVi8 4, 14 /* CC::al */, $noreg
340 renamable $r5 = t2LDRSHi12 killed renamable $r0, 0, 14 /* CC::al */, $noreg
341 t2B %bb.3, 14 /* CC::al */, $noreg
344 successors: %bb.3(0x80000000)
347 renamable $r5, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
348 t2B %bb.3, 14 /* CC::al */, $noreg
351 successors: %bb.3(0x80000000)
354 $r0 = tMOVr $r5, 14 /* CC::al */, $noreg
355 tBL 14 /* CC::al */, $noreg, @h, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def dead $r0
358 successors: %bb.5(0x04000000), %bb.4(0x7c000000)
361 renamable $r0 = tLDRi renamable $r4, 0, 14 /* CC::al */, $noreg
362 tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
363 t2Bcc %bb.4, 1 /* CC::ne */, killed $cpsr
366 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r4, def $r5, def $r7, def $pc
370 tracksRegLiveness: true
381 - { id: 0, size: 4, alignment: 8, isImmutable: true }
383 - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '$lr',
384 callee-saved-restored: false }
385 - { id: 1, type: spill-slot, offset: -8, size: 4, alignment: 4, callee-saved-register: '$r10' }
386 - { id: 2, type: spill-slot, offset: -12, size: 4, alignment: 4, callee-saved-register: '$r9' }
387 - { id: 3, type: spill-slot, offset: -16, size: 4, alignment: 4, callee-saved-register: '$r8' }
388 - { id: 4, type: spill-slot, offset: -20, size: 4, alignment: 4, callee-saved-register: '$r7' }
389 - { id: 5, type: spill-slot, offset: -24, size: 4, alignment: 4, callee-saved-register: '$r6' }
390 - { id: 6, type: spill-slot, offset: -28, size: 4, alignment: 4, callee-saved-register: '$r5' }
391 - { id: 7, type: spill-slot, offset: -32, size: 4, alignment: 4, callee-saved-register: '$r4' }
392 machineFunctionInfo: {}
394 ; CHECK-LABEL: name: nested_loops
396 ; CHECK-NEXT: successors: %bb.1(0x80000000)
397 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $lr
399 ; CHECK-NEXT: $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r4, killed $r5, killed $r6, killed $r7, killed $r8, killed $r9, killed $r10, killed $lr
400 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 32
401 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -4
402 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r10, -8
403 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r9, -12
404 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r8, -16
405 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r7, -20
406 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r6, -24
407 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r5, -28
408 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r4, -32
409 ; CHECK-NEXT: tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
410 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
411 ; CHECK-NEXT: $sp = frame-destroy t2LDMIA_RET $sp, 11 /* CC::lt */, killed $cpsr, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $pc, implicit killed $itstate
414 ; CHECK-NEXT: successors: %bb.3(0x80000000)
415 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r3
417 ; CHECK-NEXT: renamable $r12 = t2LDRi12 $sp, 32, 14 /* CC::al */, $noreg :: (load (s32) from %fixed-stack.0, align 8)
418 ; CHECK-NEXT: $r9 = tMOVr killed $r2, 14 /* CC::al */, $noreg
419 ; CHECK-NEXT: renamable $r8 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
420 ; CHECK-NEXT: t2B %bb.3, 14 /* CC::al */, $noreg
423 ; CHECK-NEXT: successors: %bb.9(0x04000000), %bb.3(0x7c000000)
424 ; CHECK-NEXT: liveins: $r0, $r1, $r3, $r8, $r9, $r12
426 ; CHECK-NEXT: renamable $r8 = nuw nsw t2ADDri killed renamable $r8, 1, 14 /* CC::al */, $noreg, $noreg
427 ; CHECK-NEXT: renamable $r3, dead $cpsr = tADDi8 killed renamable $r3, 1, 14 /* CC::al */, $noreg
428 ; CHECK-NEXT: tCMPhir renamable $r8, renamable $r0, 14 /* CC::al */, $noreg, implicit-def $cpsr
429 ; CHECK-NEXT: renamable $r12 = t2ADDri killed renamable $r12, 1, 14 /* CC::al */, $noreg, $noreg
430 ; CHECK-NEXT: t2Bcc %bb.9, 0 /* CC::eq */, killed $cpsr
433 ; CHECK-NEXT: successors: %bb.4(0x50000000), %bb.2(0x30000000)
434 ; CHECK-NEXT: liveins: $r0, $r1, $r3, $r8, $r9, $r12
436 ; CHECK-NEXT: tCMPi8 renamable $r1, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
437 ; CHECK-NEXT: t2Bcc %bb.2, 11 /* CC::lt */, killed $cpsr
440 ; CHECK-NEXT: successors: %bb.5(0x80000000)
441 ; CHECK-NEXT: liveins: $r0, $r1, $r3, $r8, $r9, $r12
443 ; CHECK-NEXT: renamable $r4, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
444 ; CHECK-NEXT: $r10 = tMOVr $r12, 14 /* CC::al */, $noreg
445 ; CHECK-NEXT: $r2 = tMOVr $r3, 14 /* CC::al */, $noreg
446 ; CHECK-NEXT: t2B %bb.5, 14 /* CC::al */, $noreg
449 ; CHECK-NEXT: successors: %bb.7(0x50000000), %bb.6(0x30000000)
450 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r3, $r4, $r8, $r9, $r10, $r12
452 ; CHECK-NEXT: renamable $lr = t2WhileLoopStartLR killed renamable $r9, %bb.6, implicit-def dead $cpsr
453 ; CHECK-NEXT: t2B %bb.7, 14 /* CC::al */, $noreg
456 ; CHECK-NEXT: successors: %bb.2(0x04000000), %bb.5(0x7c000000)
457 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r3, $r4, $r8, $r9, $r10, $r12
459 ; CHECK-NEXT: renamable $r4, dead $cpsr = nuw nsw tADDi8 killed renamable $r4, 1, 14 /* CC::al */, $noreg
460 ; CHECK-NEXT: renamable $r2, dead $cpsr = tADDi8 killed renamable $r2, 1, 14 /* CC::al */, $noreg
461 ; CHECK-NEXT: tCMPr renamable $r4, renamable $r1, 14 /* CC::al */, $noreg, implicit-def $cpsr
462 ; CHECK-NEXT: renamable $r10 = t2ADDri killed renamable $r10, 1, 14 /* CC::al */, $noreg, $noreg
463 ; CHECK-NEXT: t2Bcc %bb.2, 0 /* CC::eq */, killed $cpsr
464 ; CHECK-NEXT: t2B %bb.5, 14 /* CC::al */, $noreg
467 ; CHECK-NEXT: successors: %bb.8(0x80000000)
468 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r3, $r4, $r8, $r9, $r10, $r12
470 ; CHECK-NEXT: $r5 = tMOVr $r10, 14 /* CC::al */, $noreg
471 ; CHECK-NEXT: $r6 = tMOVr $r2, 14 /* CC::al */, $noreg
472 ; CHECK-NEXT: t2B %bb.8, 14 /* CC::al */, $noreg
475 ; CHECK-NEXT: successors: %bb.8(0x7c000000), %bb.6(0x04000000)
476 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r8, $r9, $r10, $r12
478 ; CHECK-NEXT: tSTRi killed $r0, $r1, 0, 14 /* CC::al */, $noreg
479 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.8, implicit-def dead $cpsr
480 ; CHECK-NEXT: t2B %bb.6, 14 /* CC::al */, $noreg
483 ; CHECK-NEXT: $sp = frame-destroy t2LDMIA_RET $sp, 14 /* CC::al */, $noreg, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $pc
486 liveins: $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $lr
488 $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r4, killed $r5, killed $r6, killed $r7, killed $r8, killed $r9, killed $r10, killed $lr
489 frame-setup CFI_INSTRUCTION def_cfa_offset 32
490 frame-setup CFI_INSTRUCTION offset $lr, -4
491 frame-setup CFI_INSTRUCTION offset $r10, -8
492 frame-setup CFI_INSTRUCTION offset $r9, -12
493 frame-setup CFI_INSTRUCTION offset $r8, -16
494 frame-setup CFI_INSTRUCTION offset $r7, -20
495 frame-setup CFI_INSTRUCTION offset $r6, -24
496 frame-setup CFI_INSTRUCTION offset $r5, -28
497 frame-setup CFI_INSTRUCTION offset $r4, -32
498 tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
499 t2IT 11, 8, implicit-def $itstate
500 $sp = frame-destroy t2LDMIA_RET $sp, 11 /* CC::lt */, killed $cpsr, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $pc, implicit killed $itstate
503 liveins: $r0, $r1, $r2, $r3
505 renamable $r12 = t2LDRi12 $sp, 32, 14 /* CC::al */, $noreg :: (load (s32) from %fixed-stack.0, align 8)
506 $r9 = tMOVr killed $r2, 14 /* CC::al */, $noreg
507 renamable $r8 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
508 t2B %bb.2, 14 /* CC::al */, $noreg
511 successors: %bb.9(0x04000000), %bb.2(0x7c000000)
512 liveins: $r0, $r1, $r3, $r8, $r9, $r12
514 renamable $r8 = nuw nsw t2ADDri killed renamable $r8, 1, 14 /* CC::al */, $noreg, $noreg
515 renamable $r3, dead $cpsr = tADDi8 killed renamable $r3, 1, 14 /* CC::al */, $noreg
516 tCMPhir renamable $r8, renamable $r0, 14 /* CC::al */, $noreg, implicit-def $cpsr
517 renamable $r12 = t2ADDri killed renamable $r12, 1, 14 /* CC::al */, $noreg, $noreg
518 t2Bcc %bb.9, 0 /* CC::eq */, killed $cpsr
521 successors: %bb.3(0x50000000), %bb.8(0x30000000)
522 liveins: $r0, $r1, $r3, $r8, $r9, $r12
524 tCMPi8 renamable $r1, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
525 t2Bcc %bb.8, 11 /* CC::lt */, killed $cpsr
528 liveins: $r0, $r1, $r3, $r8, $r9, $r12
530 renamable $r4, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
531 $r10 = tMOVr $r12, 14 /* CC::al */, $noreg
532 $r2 = tMOVr $r3, 14 /* CC::al */, $noreg
533 t2B %bb.4, 14 /* CC::al */, $noreg
536 successors: %bb.8(0x04000000), %bb.4(0x7c000000)
537 liveins: $r0, $r1, $r2, $r3, $r4, $r8, $r9, $r10, $r12
539 renamable $r4, dead $cpsr = nuw nsw tADDi8 killed renamable $r4, 1, 14 /* CC::al */, $noreg
540 renamable $r2, dead $cpsr = tADDi8 killed renamable $r2, 1, 14 /* CC::al */, $noreg
541 tCMPr renamable $r4, renamable $r1, 14 /* CC::al */, $noreg, implicit-def $cpsr
542 renamable $r10 = t2ADDri killed renamable $r10, 1, 14 /* CC::al */, $noreg, $noreg
543 t2Bcc %bb.8, 0 /* CC::eq */, killed $cpsr
546 successors: %bb.5(0x50000000), %bb.7(0x30000000)
547 liveins: $r0, $r1, $r2, $r3, $r4, $r8, $r9, $r10, $r12
549 renamable $lr = t2WhileLoopStartLR killed renamable $r9, %bb.7, implicit-def dead $cpsr
552 liveins: $r0, $r1, $r2, $r3, $r4, $r8, $r9, $r10, $r12
554 $r5 = tMOVr $r10, 14 /* CC::al */, $noreg
555 $r6 = tMOVr $r2, 14 /* CC::al */, $noreg
556 t2B %bb.6, 14 /* CC::al */, $noreg
559 successors: %bb.6(0x7c000000), %bb.7(0x04000000)
560 liveins: $lr, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r8, $r9, $r10, $r12
562 tSTRi killed $r0, $r1, 0, 14 /* CC::al */, $noreg
563 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.6, implicit-def dead $cpsr
564 t2B %bb.7, 14 /* CC::al */, $noreg
567 $sp = frame-destroy t2LDMIA_RET $sp, 14 /* CC::al */, $noreg, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $pc
571 name: backwards_branch_forwards_wls
572 tracksRegLiveness: true
574 ; CHECK-LABEL: name: backwards_branch_forwards_wls
576 ; CHECK-NEXT: successors: %bb.1(0x80000000)
577 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $lr
579 ; CHECK-NEXT: tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
580 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
581 ; CHECK-NEXT: frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
584 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.5(0x40000000)
585 ; CHECK-NEXT: liveins: $r0, $r1, $r2
587 ; CHECK-NEXT: $lr = t2WhileLoopStartLR killed renamable $r0, %bb.2, implicit-def dead $cpsr
588 ; CHECK-NEXT: t2B %bb.5, 14 /* CC::al */, $noreg
591 ; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.3(0x40000000)
592 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r2
594 ; CHECK-NEXT: $lr = t2WhileLoopStartLR killed renamable $r0, %bb.3, implicit-def dead $cpsr
595 ; CHECK-NEXT: t2B %bb.4, 14 /* CC::al */, $noreg
598 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
601 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.4(0x40000000)
602 ; CHECK-NEXT: liveins: $lr, $r1, $r2
604 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.4, implicit-def dead $cpsr
605 ; CHECK-NEXT: t2B %bb.3, 14 /* CC::al */, $noreg
608 ; CHECK-NEXT: successors: %bb.5(0x40000000), %bb.2(0x40000000)
609 ; CHECK-NEXT: liveins: $lr, $r1, $r2
611 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.5, implicit-def dead $cpsr
612 ; CHECK-NEXT: t2B %bb.2, 14 /* CC::al */, $noreg
615 liveins: $r0, $r1, $r2, $lr
617 tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
618 t2IT 11, 8, implicit-def $itstate
619 frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
622 successors: %bb.3, %bb.5
623 liveins: $r0, $r1, $r2
625 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.3, implicit-def dead $cpsr
626 t2B %bb.5, 14 /* CC::al */, $noreg
629 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
632 successors: %bb.4, %bb.1
633 liveins: $lr, $r0, $r1, $r2
635 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.1, implicit-def dead $cpsr
636 t2B %bb.4, 14 /* CC::al */, $noreg
639 successors: %bb.1, %bb.4
640 liveins: $lr, $r1, $r2
642 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.4, implicit-def dead $cpsr
643 t2B %bb.1, 14 /* CC::al */, $noreg
646 successors: %bb.5, %bb.3
647 liveins: $lr, $r1, $r2
649 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.5, implicit-def dead $cpsr
650 t2B %bb.3, 14 /* CC::al */, $noreg
654 name: multiple_predecessors
655 tracksRegLiveness: true
657 ; CHECK-LABEL: name: multiple_predecessors
659 ; CHECK-NEXT: successors: %bb.3(0x55555555), %bb.2(0x2aaaaaab)
660 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r7, $lr
662 ; CHECK-NEXT: frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
663 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
664 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -4
665 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r7, -8
666 ; CHECK-NEXT: $sp = frame-setup tSUBspi $sp, 1, 14 /* CC::al */, $noreg
667 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 12
668 ; CHECK-NEXT: tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
669 ; CHECK-NEXT: t2IT 0, 8, implicit-def $itstate
670 ; CHECK-NEXT: tCMPi8 killed renamable $r1, 8, 0 /* CC::eq */, killed $cpsr, implicit-def $cpsr, implicit killed $itstate
671 ; CHECK-NEXT: t2Bcc %bb.2, 0 /* CC::eq */, killed $cpsr
672 ; CHECK-NEXT: t2B %bb.3, 14 /* CC::al */, $noreg
675 ; CHECK-NEXT: successors: %bb.6(0x40000000), %bb.3(0x40000000)
676 ; CHECK-NEXT: liveins: $r0, $r1, $r2
678 ; CHECK-NEXT: renamable $lr = t2WhileLoopStartLR killed renamable $r2, %bb.3, implicit-def dead $cpsr
679 ; CHECK-NEXT: t2B %bb.6, 14 /* CC::al */, $noreg
682 ; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.3(0x40000000)
683 ; CHECK-NEXT: liveins: $r2
685 ; CHECK-NEXT: renamable $lr = t2WhileLoopStartLR renamable $r2, %bb.3, implicit-def dead $cpsr
686 ; CHECK-NEXT: t2B %bb.4, 14 /* CC::al */, $noreg
689 ; CHECK-NEXT: $sp = frame-destroy tADDspi $sp, 1, 14 /* CC::al */, $noreg
690 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc, implicit undef $r0
693 ; CHECK-NEXT: successors: %bb.5(0x80000000)
694 ; CHECK-NEXT: liveins: $lr, $r2
696 ; CHECK-NEXT: renamable $r3, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
697 ; CHECK-NEXT: renamable $r1 = t2ADDri $sp, 2, 14 /* CC::al */, $noreg, $noreg
698 ; CHECK-NEXT: renamable $r0 = IMPLICIT_DEF
701 ; CHECK-NEXT: successors: %bb.5(0x7c000000), %bb.1(0x04000000)
702 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r2, $r3
704 ; CHECK-NEXT: renamable $q0, renamable $r0 = MVE_VIWDUPu16 killed renamable $r0, renamable $r3, 1, 0, $noreg, $noreg, undef renamable $q0
705 ; CHECK-NEXT: MVE_VSTRH16_rq undef renamable $q0, renamable $r1, killed renamable $q0, 0, $noreg, $noreg
706 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.5, implicit-def dead $cpsr
707 ; CHECK-NEXT: t2B %bb.1, 14 /* CC::al */, $noreg
710 ; CHECK-NEXT: successors: %bb.7(0x80000000)
711 ; CHECK-NEXT: liveins: $lr, $r0, $r1
713 ; CHECK-NEXT: renamable $r3, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
716 ; CHECK-NEXT: successors: %bb.7(0x7c000000), %bb.3(0x04000000)
717 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r3
719 ; CHECK-NEXT: renamable $q0, renamable $r0 = MVE_VIWDUPu16 killed renamable $r0, renamable $r3, 2, 0, $noreg, $noreg, undef renamable $q0
720 ; CHECK-NEXT: MVE_VSTRH16_rq undef renamable $q0, renamable $r1, killed renamable $q0, 0, $noreg, $noreg
721 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.7, implicit-def dead $cpsr
722 ; CHECK-NEXT: t2B %bb.3, 14 /* CC::al */, $noreg
724 successors: %bb.7(0x80000000), %bb.1(0x40000000)
725 liveins: $r0, $r1, $r2, $r7, $lr
727 frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
728 frame-setup CFI_INSTRUCTION def_cfa_offset 8
729 frame-setup CFI_INSTRUCTION offset $lr, -4
730 frame-setup CFI_INSTRUCTION offset $r7, -8
731 $sp = frame-setup tSUBspi $sp, 1, 14 /* CC::al */, $noreg
732 frame-setup CFI_INSTRUCTION def_cfa_offset 12
733 tCMPi8 killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
734 t2IT 0, 8, implicit-def $itstate
735 tCMPi8 killed renamable $r1, 8, 0 /* CC::eq */, killed $cpsr, implicit-def $cpsr, implicit killed $itstate
736 t2Bcc %bb.1, 0 /* CC::eq */, killed $cpsr
739 $sp = frame-destroy tADDspi $sp, 1, 14 /* CC::al */, $noreg
740 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc, implicit undef $r0
743 successors: %bb.3(0x40000000), %bb.7(0x40000000)
746 renamable $lr = t2WhileLoopStartLR renamable $r2, %bb.7, implicit-def dead $cpsr
747 t2B %bb.3, 14 /* CC::al */, $noreg
750 successors: %bb.4(0x80000000)
753 renamable $r3, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
754 renamable $r1 = t2ADDri $sp, 2, 14 /* CC::al */, $noreg, $noreg
755 renamable $r0 = IMPLICIT_DEF
758 successors: %bb.4(0x7c000000), %bb.2(0x04000000)
759 liveins: $lr, $r0, $r1, $r2, $r3
761 renamable $q0, renamable $r0 = MVE_VIWDUPu16 killed renamable $r0, renamable $r3, 1, 0, $noreg, $noreg, undef renamable $q0
762 MVE_VSTRH16_rq undef renamable $q0, renamable $r1, killed renamable $q0, 0, $noreg, $noreg
763 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.4, implicit-def dead $cpsr
764 t2B %bb.2, 14 /* CC::al */, $noreg
767 successors: %bb.5(0x40000000), %bb.7(0x40000000)
768 liveins: $r0, $r1, $r2
770 renamable $lr = t2WhileLoopStartLR killed renamable $r2, %bb.7, implicit-def dead $cpsr
771 t2B %bb.5, 14 /* CC::al */, $noreg
774 successors: %bb.6(0x80000000)
775 liveins: $lr, $r0, $r1
777 renamable $r3, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
780 successors: %bb.6(0x7c000000), %bb.7(0x04000000)
781 liveins: $lr, $r0, $r1, $r3
783 renamable $q0, renamable $r0 = MVE_VIWDUPu16 killed renamable $r0, renamable $r3, 2, 0, $noreg, $noreg, undef renamable $q0
784 MVE_VSTRH16_rq undef renamable $q0, renamable $r1, killed renamable $q0, 0, $noreg, $noreg
785 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.6, implicit-def dead $cpsr
786 t2B %bb.7, 14 /* CC::al */, $noreg
791 tracksRegLiveness: true
796 blocks: [ '%bb.3', '%bb.1' ]
798 ; CHECK-LABEL: name: jump_table
800 ; CHECK-NEXT: successors: %bb.3(0x80000000)
801 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $lr
803 ; CHECK-NEXT: tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
804 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
805 ; CHECK-NEXT: frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
808 ; CHECK-NEXT: successors: %bb.4(0x80000000)
809 ; CHECK-NEXT: liveins: $r0, $r1, $r2
811 ; CHECK-NEXT: $lr = t2WhileLoopStartLR killed renamable $r0, %bb.2, implicit-def dead $cpsr
812 ; CHECK-NEXT: t2B %bb.4, 14 /* CC::al */, $noreg
815 ; CHECK-NEXT: frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
818 ; CHECK-NEXT: successors: %bb.1(0x7c000000), %bb.2(0x04000000)
819 ; CHECK-NEXT: liveins: $r0
821 ; CHECK-NEXT: renamable $r5 = t2LEApcrelJT %jump-table.0, 14 /* CC::al */, $noreg
822 ; CHECK-NEXT: renamable $r5 = t2ADDrs killed renamable $r5, renamable $r0, 18, 14 /* CC::al */, $noreg, $noreg
823 ; CHECK-NEXT: t2BR_JT killed renamable $r5, killed renamable $r0, %jump-table.0
826 ; CHECK-NEXT: successors: %bb.4(0x7c000000), %bb.2(0x04000000)
827 ; CHECK-NEXT: liveins: $lr, $r1, $r2
829 ; CHECK-NEXT: renamable $r0 = tLDRi renamable $r2, 0, 14 /* CC::al */, $noreg
830 ; CHECK-NEXT: tSTRi killed renamable $r0, renamable $r1, 0, 14 /* CC::al */, $noreg
831 ; CHECK-NEXT: renamable $lr = t2LoopEndDec killed renamable $lr, %bb.4, implicit-def dead $cpsr
832 ; CHECK-NEXT: t2B %bb.2, 14 /* CC::al */, $noreg
834 successors: %bb.2(0x80000000)
835 liveins: $r0, $r1, $r2, $lr
837 tCMPi8 renamable $r0, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
838 t2IT 11, 8, implicit-def $itstate
839 frame-destroy tPOP_RET 11 /* CC::lt */, killed $cpsr, def $r7, def $pc, implicit killed $itstate
842 frame-destroy tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
845 successors: %bb.3(0x7c000000), %bb.1(0x04000000)
848 renamable $r5 = t2LEApcrelJT %jump-table.0, 14 /* CC::al */, $noreg
849 renamable $r5 = t2ADDrs killed renamable $r5, renamable $r0, 18, 14 /* CC::al */, $noreg, $noreg
850 t2BR_JT killed renamable $r5, killed renamable $r0, %jump-table.0
853 successors: %bb.4(0x80000000)
854 liveins: $r0, $r1, $r2
856 $lr = t2WhileLoopStartLR killed renamable $r0, %bb.1, implicit-def dead $cpsr
859 successors: %bb.4(0x7c000000), %bb.1(0x04000000)
860 liveins: $lr, $r1, $r2
862 renamable $r0 = tLDRi renamable $r2, 0, 14 /* CC::al */, $noreg
863 tSTRi killed renamable $r0, renamable $r1, 0, 14 /* CC::al */, $noreg
864 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.4, implicit-def dead $cpsr
865 t2B %bb.1, 14 /* CC::al */, $noreg