1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=thumbv7m-none-eabi -run-pass=arm-cp-islands -o - %s | FileCheck %s
--- |
define i32* @test_simple(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_notfirst(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_redefined(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_notredefined(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_notcmp(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_killflag_1(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_killflag_2(i32* %x, i32 %y) { ret i32* %x }
define i32* @test_cpsr(i32* %x, i32 %y) { ret i32* %x }
declare dso_local i32 @c(i32 %x)
...
---
name: test_simple
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_simple
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: tCBZ $r0, %bb.2
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_notfirst
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_notfirst
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: renamable $r0, $cpsr = tADDrr killed renamable $r0, renamable $r1, 14, $noreg
; CHECK: renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
; CHECK: tCBZ $r0, %bb.2
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
renamable $r0, $cpsr = tADDrr killed renamable $r0, renamable $r1, 14, $noreg
tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_redefined
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_redefined
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
; CHECK: renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
; CHECK: tBcc %bb.2, 0, killed $cpsr
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_notredefined
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_notredefined
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
; CHECK: tCBZ $r0, %bb.2
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
renamable $r1 = t2ADDrs renamable $r0, killed renamable $r1, 18, 14, $noreg, $noreg
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_notcmp
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_notcmp
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
; CHECK: renamable $r1, $cpsr = tADDrr renamable $r0, killed renamable $r1, 14, $noreg
; CHECK: tBcc %bb.2, 0, killed $cpsr
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
renamable $r1, $cpsr = tADDrr renamable $r0, killed renamable $r1, 14, $noreg
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_killflag_1
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_killflag_1
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r0, 18, 14, $noreg, $noreg
; CHECK: tCBZ killed $r1, %bb.2
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 killed renamable $r1, 0, 14, $noreg, implicit-def $cpsr
renamable $r0 = t2ADDrs killed renamable $r0, killed renamable $r0, 18, 14, $noreg, $noreg
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_killflag_2
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_killflag_2
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: renamable $r0 = t2ADDrs renamable $r1, killed renamable $r0, 18, 14, $noreg, $noreg
; CHECK: tCBZ killed $r1, %bb.2
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 renamable $r1, 0, 14, $noreg, implicit-def $cpsr
renamable $r0 = t2ADDrs killed renamable $r1, killed renamable $r0, 18, 14, $noreg, $noreg
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
---
name: test_cpsr
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
- { reg: '$r1', virtual-reg: '' }
body: |
; CHECK-LABEL: name: test_cpsr
; CHECK: bb.0:
; CHECK: successors: %bb.2(0x30000000), %bb.1(0x50000000)
; CHECK: tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
; CHECK: t2IT 0, 8, implicit-def $itstate
; CHECK: renamable $r1 = t2ADDri killed renamable $r1, 1, 1, $cpsr, $noreg, implicit killed $itstate
; CHECK: tBcc %bb.2, 0, killed $cpsr
; CHECK: bb.1:
; CHECK: renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
; CHECK: tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
; CHECK: bb.2:
; CHECK: $r0, dead $cpsr = tMOVi8 0, 14, $noreg
; CHECK: tBX_RET 14, $noreg, implicit killed $r0
bb.0:
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: $r0, $r1
tCMPi8 renamable $r0, 0, 14, $noreg, implicit-def $cpsr
t2IT 0, 8, implicit-def $itstate
renamable $r1 = t2ADDri killed renamable $r1, 1, 1, $cpsr, $noreg, implicit killed $itstate
t2Bcc %bb.1, 0, killed $cpsr
bb.2:
liveins: $r0
renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg :: (load 4 from %ir.x)
tTAILJMPdND @c, 14, $noreg, implicit $sp, implicit $sp, implicit killed $r0
bb.1:
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
tBX_RET 14, $noreg, implicit killed $r0
...
|