1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc %s -o - -run-pass=if-converter -verify-machineinstrs | FileCheck %s
3 # Make sure we correctly if-convert blocks containing an unanalyzable branch sequence.
4 # (In this case, multiple conditional branches)
7 target triple = "thumbv7-unknown-linux-gnueabi"
9 define dso_local ptr @fn1() {
13 ret ptr blockaddress(@fn1, %l_yes)
16 declare dso_local i32 @fn2(...)
21 tracksRegLiveness: true
23 ; CHECK-LABEL: name: fn1
25 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
26 ; CHECK-NEXT: liveins: $r0, $r1, $r2, $r4, $lr
28 ; CHECK-NEXT: $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r4, killed $lr
29 ; CHECK-NEXT: t2CMPri killed renamable $r2, 34, 14 /* CC::al */, $noreg, implicit-def $cpsr
30 ; CHECK-NEXT: $r0 = t2MOVi 2, 1 /* CC::ne */, $cpsr, $noreg
31 ; CHECK-NEXT: $r0 = t2MOVi 3, 0 /* CC::eq */, killed $cpsr, $noreg, implicit killed $r0
32 ; CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit-def $sp, implicit-def dead $r0
33 ; CHECK-NEXT: t2CMPri $sp, 34, 14 /* CC::al */, $noreg, implicit-def $cpsr
34 ; CHECK-NEXT: t2Bcc %bb.2, 1 /* CC::ne */, $cpsr
35 ; CHECK-NEXT: t2Bcc %bb.2, 2 /* CC::hs */, killed $cpsr
36 ; CHECK-NEXT: t2B %bb.1, 14 /* CC::al */, $noreg
39 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */
40 ; CHECK-NEXT: $sp = t2LDMIA_RET $sp, 14 /* CC::al */, $noreg, def $r4, def $pc
42 ; CHECK-NEXT: bb.2.l_yes (ir-block-address-taken %ir-block.l_yes):
43 ; CHECK-NEXT: $sp = t2LDMIA_RET $sp, 14 /* CC::al */, $noreg, def $r4, def $pc
45 successors: %bb.1(0x40000000), %bb.2(0x40000000)
46 liveins: $r0, $r1, $r2, $r4, $lr
48 $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r4, killed $lr
49 t2CMPri killed renamable $r2, 34, 14, $noreg, implicit-def $cpsr
50 t2Bcc %bb.2, 1, killed $cpsr
53 successors: %bb.3(0x40000000), %bb.4(0x40000000)
56 $r0 = t2MOVi 3, 14, $noreg, $noreg
57 tBL 14, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit $r1, implicit-def $sp, implicit-def dead $r0
58 t2CMPri $sp, 34, 14, $noreg, implicit-def $cpsr
60 t2Bcc %bb.4, 2, killed $cpsr
64 successors: %bb.3(0x40000000), %bb.4(0x40000000)
67 $r0 = t2MOVi 2, 14, $noreg, $noreg
68 tBL 14, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit $r1, implicit-def $sp, implicit-def dead $r0
69 t2CMPri $sp, 34, 14, $noreg, implicit-def $cpsr
71 t2Bcc %bb.4, 2, killed $cpsr
76 $sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc
78 bb.4.l_yes (ir-block-address-taken %ir-block.l_yes):
79 $sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc