1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv7m-none-eabi -run-pass=if-converter -o - %s | FileCheck %s
5 define i32 @f1(i32 %x) #0 { ret i32 %x }
6 define i32 @f2(i32 %x) #0 { ret i32 %x }
7 define i32 @f3(i32 %x) #0 { ret i32 %x }
8 declare i32 @fn(i32 %x) #0
10 attributes #0 = { minsize nounwind optsize }
15 tracksRegLiveness: true
17 - { reg: '$r0', virtual-reg: '' }
19 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
20 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
21 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
22 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
23 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
24 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
26 ; CHECK-LABEL: name: f1
28 ; CHECK: liveins: $r0, $lr, $r7
29 ; CHECK: t2CMPri killed renamable $r0, 1, 14, $noreg, implicit-def $cpsr
30 ; CHECK: tBX_RET 1, killed $cpsr
31 ; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
32 ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
33 ; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
34 ; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
35 ; CHECK: $r0 = t2MOVi 0, 14, $noreg, $noreg
36 ; CHECK: tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
37 ; CHECK: $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
38 ; CHECK: tBX_RET 14, $noreg
40 successors: %bb.1(0x40000000), %bb.2(0x40000000)
41 liveins: $r0, $lr, $r7
43 t2CMPri killed renamable $r0, 1, 14, $noreg, implicit-def $cpsr
44 t2Bcc %bb.2, 1, killed $cpsr
49 $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
50 frame-setup CFI_INSTRUCTION def_cfa_offset 8
51 frame-setup CFI_INSTRUCTION offset $lr, -4
52 frame-setup CFI_INSTRUCTION offset $r7, -8
53 $r0 = t2MOVi 0, 14, $noreg, $noreg
54 tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
55 $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
66 tracksRegLiveness: true
68 - { reg: '$r0', virtual-reg: '' }
70 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
71 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
72 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
73 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
74 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
75 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
77 ; CHECK-LABEL: name: f2
79 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
80 ; CHECK: liveins: $r0, $lr, $r7
81 ; CHECK: t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
82 ; CHECK: t2Bcc %bb.2, 1, killed $cpsr
84 ; CHECK: liveins: $r7, $lr
85 ; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
86 ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
87 ; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
88 ; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
89 ; CHECK: $r0 = t2MOVi 0, 14, $noreg, $noreg
90 ; CHECK: tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
91 ; CHECK: $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
92 ; CHECK: tBX_RET 14, $noreg
94 ; CHECK: liveins: $lr, $r7
95 ; CHECK: tBX_RET 14, $noreg
97 successors: %bb.1(0x40000000), %bb.2(0x40000000)
98 liveins: $r0, $lr, $r7
100 t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
101 t2Bcc %bb.2, 1, killed $cpsr
106 $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
107 frame-setup CFI_INSTRUCTION def_cfa_offset 8
108 frame-setup CFI_INSTRUCTION offset $lr, -4
109 frame-setup CFI_INSTRUCTION offset $r7, -8
110 $r0 = t2MOVi 0, 14, $noreg, $noreg
111 tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
112 $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
123 tracksRegLiveness: true
125 - { reg: '$r0', virtual-reg: '' }
127 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
128 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
129 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
130 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
131 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
132 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
134 ; CHECK-LABEL: name: f3
136 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
137 ; CHECK: liveins: $r0, $lr, $r7
138 ; CHECK: t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
139 ; CHECK: $r1 = t2MOVi 0, 14, $noreg, $noreg
140 ; CHECK: t2Bcc %bb.2, 1, killed $cpsr
142 ; CHECK: liveins: $r7, $lr
143 ; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
144 ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
145 ; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
146 ; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
147 ; CHECK: $r0 = t2MOVi 0, 14, $noreg, $noreg
148 ; CHECK: tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
149 ; CHECK: $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
150 ; CHECK: tBX_RET 14, $noreg
152 ; CHECK: liveins: $lr, $r7
153 ; CHECK: tBX_RET 14, $noreg
155 successors: %bb.1(0x40000000), %bb.2(0x40000000)
156 liveins: $r0, $lr, $r7
158 t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
159 $r1 = t2MOVi 0, 14, $noreg, $noreg
160 t2Bcc %bb.2, 1, killed $cpsr
165 $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
166 frame-setup CFI_INSTRUCTION def_cfa_offset 8
167 frame-setup CFI_INSTRUCTION offset $lr, -4
168 frame-setup CFI_INSTRUCTION offset $r7, -8
169 $r0 = t2MOVi 0, 14, $noreg, $noreg
170 tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
171 $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr