1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv7m-none-eabi -run-pass=arm-cp-islands -o - %s | FileCheck %s
5 define i32* @test_simple(i32* %x, i32 %y) { ret i32* %x }
6 define i32* @test_notfirst(i32* %x, i32 %y) { ret i32* %x }
7 define i32* @test_redefined(i32* %x, i32 %y) { ret i32* %x }
8 define i32* @test_notredefined(i32* %x, i32 %y) { ret i32* %x }
9 define i32* @test_notcmp(i32* %x, i32 %y) { ret i32* %x }
10 define i32* @test_killflag_1(i32* %x, i32 %y) { ret i32* %x }
11 define i32* @test_killflag_2(i32* %x, i32 %y) { ret i32* %x }
12 define i32* @test_cpsr(i32* %x, i32 %y) { ret i32* %x }
14 declare dso_local i32 @c(i32 %x)
18 tracksRegLiveness: true
20 - { reg: '$r0', virtual-reg: '' }
21 - { reg: '$r1', virtual-reg: '' }
23 ; CHECK-LABEL: name: test_simple
25 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
26 ; CHECK: tCBZ $r0, %bb.2
28 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
29 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
31 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
32 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
34 successors: %bb.1(0x30000000), %bb.2(0x50000000)
37 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
38 t2Bcc %bb.1, 0, killed $cpsr
43 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
44 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
47 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
48 tBX_RET 14, $noreg, implicit killed $r0
53 tracksRegLiveness: true
55 - { reg: '$r0', virtual-reg: '' }
56 - { reg: '$r1', virtual-reg: '' }
58 ; CHECK-LABEL: name: test_notfirst
60 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
61 ; CHECK: renamable $r0, $cpsr = tADDrr killed renamable $r0, renamable $r1, 14, $noreg
62 ; CHECK: renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
63 ; CHECK: tCBZ $r0, %bb.2
65 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
66 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
68 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
69 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
71 successors: %bb.1(0x30000000), %bb.2(0x50000000)
74 renamable $r0, $cpsr = tADDrr killed renamable $r0, renamable $r1, 14, $noreg
75 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
76 renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
77 t2Bcc %bb.1, 0, killed $cpsr
82 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
83 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
86 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
87 tBX_RET 14, $noreg, implicit killed $r0
92 tracksRegLiveness: true
94 - { reg: '$r0', virtual-reg: '' }
95 - { reg: '$r1', virtual-reg: '' }
97 ; CHECK-LABEL: name: test_redefined
99 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
100 ; CHECK: tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
101 ; CHECK: renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
102 ; CHECK: tBcc %bb.2, 0, killed $cpsr
104 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
105 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
107 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
108 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
110 successors: %bb.1(0x30000000), %bb.2(0x50000000)
113 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
114 renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
115 t2Bcc %bb.1, 0, killed $cpsr
120 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
121 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
124 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
125 tBX_RET 14, $noreg, implicit killed $r0
129 name: test_notredefined
130 tracksRegLiveness: true
132 - { reg: '$r0', virtual-reg: '' }
133 - { reg: '$r1', virtual-reg: '' }
135 ; CHECK-LABEL: name: test_notredefined
137 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
138 ; CHECK: renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
139 ; CHECK: tCBZ $r0, %bb.2
141 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
142 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
144 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
145 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
147 successors: %bb.1(0x30000000), %bb.2(0x50000000)
150 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
151 renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
152 t2Bcc %bb.1, 0, killed $cpsr
157 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
158 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
161 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
162 tBX_RET 14, $noreg, implicit killed $r0
167 tracksRegLiveness: true
169 - { reg: '$r0', virtual-reg: '' }
170 - { reg: '$r1', virtual-reg: '' }
172 ; CHECK-LABEL: name: test_notcmp
174 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
175 ; CHECK: tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
176 ; CHECK: renamable $r1, $cpsr = tADDrr renamable $r0, killed renamable $r1, 14, $noreg
177 ; CHECK: tBcc %bb.2, 0, killed $cpsr
179 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
180 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
182 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
183 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
185 successors: %bb.1(0x30000000), %bb.2(0x50000000)
188 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
189 renamable $r1, $cpsr = tADDrr renamable $r0, killed renamable $r1, 14, $noreg
190 t2Bcc %bb.1, 0, killed $cpsr
195 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
196 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
199 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
200 tBX_RET 14, $noreg, implicit killed $r0
204 name: test_killflag_1
205 tracksRegLiveness: true
207 - { reg: '$r0', virtual-reg: '' }
208 - { reg: '$r1', virtual-reg: '' }
210 ; CHECK-LABEL: name: test_killflag_1
212 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
213 ; CHECK: renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r0, 18, 14, $noreg, $noreg
214 ; CHECK: tCBZ killed $r1, %bb.2
216 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
217 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
219 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
220 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
222 successors: %bb.1(0x30000000), %bb.2(0x50000000)
225 tCMPi8 killed renamable $r1, 0, 14, $noreg, implicit-def $cpsr
226 renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r0, 18, 14, $noreg, $noreg
227 t2Bcc %bb.1, 0, killed $cpsr
232 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
233 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
236 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
237 tBX_RET 14, $noreg, implicit killed $r0
241 name: test_killflag_2
242 tracksRegLiveness: true
244 - { reg: '$r0', virtual-reg: '' }
245 - { reg: '$r1', virtual-reg: '' }
247 ; CHECK-LABEL: name: test_killflag_2
249 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
250 ; CHECK: renamable $r0 = t2ADDrs renamable $r1, killed renamable $r0, 18, 14, $noreg, $noreg
251 ; CHECK: tCBZ killed $r1, %bb.2
253 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
254 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
256 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
257 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
259 successors: %bb.1(0x30000000), %bb.2(0x50000000)
262 tCMPi8 renamable $r1, 0, 14, $noreg, implicit-def $cpsr
263 renamable $r0 = t2ADDrs killed renamable $r1, killed renamable $r0, 18, 14, $noreg, $noreg
264 t2Bcc %bb.1, 0, killed $cpsr
269 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
270 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
273 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
274 tBX_RET 14, $noreg, implicit killed $r0
279 tracksRegLiveness: true
281 - { reg: '$r0', virtual-reg: '' }
282 - { reg: '$r1', virtual-reg: '' }
284 ; CHECK-LABEL: name: test_cpsr
286 ; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
287 ; CHECK: tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
288 ; CHECK: t2IT 0, 8, implicit-def $itstate
289 ; CHECK: renamable $r1 = t2ADDri killed renamable $r1, 1, 1, $cpsr, $noreg, implicit killed $itstate
290 ; CHECK: tBcc %bb.2, 0, killed $cpsr
292 ; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
293 ; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
295 ; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
296 ; CHECK: tBX_RET 14, $noreg, implicit killed $r0
298 successors: %bb.1(0x30000000), %bb.2(0x50000000)
301 tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
302 t2IT 0, 8, implicit-def $itstate
303 renamable $r1 = t2ADDri killed renamable $r1, 1, 1, $cpsr, $noreg, implicit killed $itstate
304 t2Bcc %bb.1, 0, killed $cpsr
309 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
310 tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
313 $r0, dead $cpsr = tMOVi8 0, 14, $noreg
314 tBX_RET 14, $noreg, implicit killed $r0