1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -global-isel -mtriple aarch64 -O0 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -simplify-mir -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
4 define i32 @switch(i32 %argc) {
5 ; CHECK-LABEL: name: switch
7 ; CHECK-NEXT: liveins: $w0
9 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
10 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 100
11 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 200
12 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
13 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
14 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
15 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
16 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
17 ; CHECK-NEXT: G_BR %bb.6
19 ; CHECK-NEXT: bb.6.entry:
20 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]]
21 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.4
22 ; CHECK-NEXT: G_BR %bb.2
24 ; CHECK-NEXT: bb.2.default:
25 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C4]]
26 ; CHECK-NEXT: G_BR %bb.5
28 ; CHECK-NEXT: bb.3.case100:
29 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C3]]
30 ; CHECK-NEXT: G_BR %bb.5
32 ; CHECK-NEXT: bb.4.case200:
33 ; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]]
34 ; CHECK-NEXT: G_BR %bb.5
36 ; CHECK-NEXT: bb.5.return:
37 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[ADD]](s32), %bb.2, [[ADD1]](s32), %bb.3, [[ADD2]](s32), %bb.4
38 ; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
39 ; CHECK-NEXT: RET_ReallyLR implicit $w0
41 switch i32 %argc, label %default [
42 i32 100, label %case100
43 i32 200, label %case200
47 %tmp0 = add i32 %argc, 0
51 %tmp1 = add i32 %argc, 1
55 %tmp2 = add i32 %argc, 2
59 %res = phi i32 [ %tmp0, %default ], [ %tmp1, %case100 ], [ %tmp2, %case200 ]
63 define i32 @test_cfg_remap(i32 %in) {
64 ; CHECK-LABEL: name: test_cfg_remap
66 ; CHECK-NEXT: liveins: $w0
68 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
69 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
70 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 57
71 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
72 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
73 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
74 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.2
75 ; CHECK-NEXT: G_BR %bb.5
77 ; CHECK-NEXT: bb.5.entry:
78 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]]
79 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.3
80 ; CHECK-NEXT: G_BR %bb.4
82 ; CHECK-NEXT: bb.2.next:
83 ; CHECK-NEXT: G_BR %bb.4
85 ; CHECK-NEXT: bb.3.other:
86 ; CHECK-NEXT: $w0 = COPY [[DEF]](s32)
87 ; CHECK-NEXT: RET_ReallyLR implicit $w0
89 ; CHECK-NEXT: bb.4.phi.block:
90 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C]](s32), %bb.5, [[C2]](s32), %bb.2
91 ; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
92 ; CHECK-NEXT: RET_ReallyLR implicit $w0
94 switch i32 %in, label %phi.block [i32 1, label %next
104 %res = phi i32 [1, %entry], [42, %next]
108 define i32 @test_cfg_remap_multiple_preds(i32 %in) {
109 ; CHECK-LABEL: name: test_cfg_remap_multiple_preds
111 ; CHECK-NEXT: liveins: $w0
113 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
114 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
115 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 57
116 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 128
117 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
118 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
119 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
120 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
121 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
122 ; CHECK-NEXT: G_BR %bb.6
124 ; CHECK-NEXT: bb.6.entry:
125 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]]
126 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.4
127 ; CHECK-NEXT: G_BR %bb.7
129 ; CHECK-NEXT: bb.7.entry:
130 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C2]]
131 ; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.5
132 ; CHECK-NEXT: G_BR %bb.8
134 ; CHECK-NEXT: bb.8.entry:
135 ; CHECK-NEXT: G_BR %bb.5
137 ; CHECK-NEXT: bb.2.odd:
138 ; CHECK-NEXT: successors:
142 ; CHECK-NEXT: G_BR %bb.5
144 ; CHECK-NEXT: bb.4.other:
145 ; CHECK-NEXT: $w0 = COPY [[DEF]](s32)
146 ; CHECK-NEXT: RET_ReallyLR implicit $w0
148 ; CHECK-NEXT: bb.5.phi.block:
149 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C]](s32), %bb.7, [[C]](s32), %bb.8, [[C4]](s32), %bb.3
150 ; CHECK-NEXT: $w0 = COPY [[C3]](s32)
151 ; CHECK-NEXT: RET_ReallyLR implicit $w0
153 switch i32 %in, label %odd [i32 1, label %next
155 i32 128, label %phi.block
156 i32 256, label %phi.block]
167 %res = phi i32 [1, %entry], [1, %entry], [42, %next]
171 define i32 @jt_test(i32 %x) {
172 ; CHECK-LABEL: name: jt_test
174 ; CHECK-NEXT: liveins: $w0
176 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
177 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 71
178 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
179 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
180 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
181 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
182 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[C4]]
183 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[SUB]](s32)
184 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[C]](s32)
185 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[ZEXT]](s64), [[ZEXT1]]
186 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.4
188 ; CHECK-NEXT: bb.5.entry:
189 ; CHECK-NEXT: successors: %bb.3, %bb.4, %bb.2
191 ; CHECK-NEXT: [[JUMP_TABLE:%[0-9]+]]:_(p0) = G_JUMP_TABLE %jump-table.0
192 ; CHECK-NEXT: G_BRJT [[JUMP_TABLE]](p0), %jump-table.0, [[ZEXT]](s64)
194 ; CHECK-NEXT: bb.2.sw.bb:
195 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[C2]]
196 ; CHECK-NEXT: G_BR %bb.4
198 ; CHECK-NEXT: bb.3.sw.bb1:
199 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = nsw G_MUL [[COPY]], [[C1]]
200 ; CHECK-NEXT: G_BR %bb.4
202 ; CHECK-NEXT: bb.4.return:
203 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[MUL]](s32), %bb.3, [[ADD]](s32), %bb.2, [[C3]](s32), %bb.1, [[C3]](s32), %bb.5
204 ; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
205 ; CHECK-NEXT: RET_ReallyLR implicit $w0
207 switch i32 %x, label %return [
219 %add = add nsw i32 %x, 42
223 %mul = mul nsw i32 %x, 3
227 %retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ]
231 %0 = type { i32, ptr }
232 %1 = type { ptr, i32, i32 }
234 @global = external hidden constant [55 x %0], align 8
236 define void @jt_multiple_jump_tables(ptr %arg, i32 %arg1, ptr %arg2) {
237 ; CHECK-LABEL: name: jt_multiple_jump_tables
239 ; CHECK-NEXT: liveins: $w1, $x0, $x2
241 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
242 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
243 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
244 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
245 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
246 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
247 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
248 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
249 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
250 ; CHECK-NEXT: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
251 ; CHECK-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 11
252 ; CHECK-NEXT: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
253 ; CHECK-NEXT: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 13
254 ; CHECK-NEXT: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 14
255 ; CHECK-NEXT: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
256 ; CHECK-NEXT: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
257 ; CHECK-NEXT: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
258 ; CHECK-NEXT: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 18
259 ; CHECK-NEXT: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 19
260 ; CHECK-NEXT: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
261 ; CHECK-NEXT: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 21
262 ; CHECK-NEXT: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 22
263 ; CHECK-NEXT: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 23
264 ; CHECK-NEXT: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
265 ; CHECK-NEXT: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 25
266 ; CHECK-NEXT: [[C22:%[0-9]+]]:_(s32) = G_CONSTANT i32 26
267 ; CHECK-NEXT: [[C23:%[0-9]+]]:_(s32) = G_CONSTANT i32 27
268 ; CHECK-NEXT: [[C24:%[0-9]+]]:_(s32) = G_CONSTANT i32 28
269 ; CHECK-NEXT: [[C25:%[0-9]+]]:_(s32) = G_CONSTANT i32 29
270 ; CHECK-NEXT: [[C26:%[0-9]+]]:_(s32) = G_CONSTANT i32 30
271 ; CHECK-NEXT: [[C27:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
272 ; CHECK-NEXT: [[C28:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
273 ; CHECK-NEXT: [[C29:%[0-9]+]]:_(s32) = G_CONSTANT i32 33
274 ; CHECK-NEXT: [[C30:%[0-9]+]]:_(s32) = G_CONSTANT i32 34
275 ; CHECK-NEXT: [[C31:%[0-9]+]]:_(s32) = G_CONSTANT i32 35
276 ; CHECK-NEXT: [[C32:%[0-9]+]]:_(s32) = G_CONSTANT i32 36
277 ; CHECK-NEXT: [[C33:%[0-9]+]]:_(s32) = G_CONSTANT i32 37
278 ; CHECK-NEXT: [[C34:%[0-9]+]]:_(s32) = G_CONSTANT i32 38
279 ; CHECK-NEXT: [[C35:%[0-9]+]]:_(s32) = G_CONSTANT i32 39
280 ; CHECK-NEXT: [[C36:%[0-9]+]]:_(s32) = G_CONSTANT i32 41
281 ; CHECK-NEXT: [[C37:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
282 ; CHECK-NEXT: [[C38:%[0-9]+]]:_(s32) = G_CONSTANT i32 43
283 ; CHECK-NEXT: [[C39:%[0-9]+]]:_(s32) = G_CONSTANT i32 44
284 ; CHECK-NEXT: [[C40:%[0-9]+]]:_(s32) = G_CONSTANT i32 45
285 ; CHECK-NEXT: [[C41:%[0-9]+]]:_(s32) = G_CONSTANT i32 46
286 ; CHECK-NEXT: [[C42:%[0-9]+]]:_(s32) = G_CONSTANT i32 47
287 ; CHECK-NEXT: [[C43:%[0-9]+]]:_(s32) = G_CONSTANT i32 48
288 ; CHECK-NEXT: [[C44:%[0-9]+]]:_(s32) = G_CONSTANT i32 49
289 ; CHECK-NEXT: [[C45:%[0-9]+]]:_(s32) = G_CONSTANT i32 50
290 ; CHECK-NEXT: [[C46:%[0-9]+]]:_(s32) = G_CONSTANT i32 51
291 ; CHECK-NEXT: [[C47:%[0-9]+]]:_(s32) = G_CONSTANT i32 52
292 ; CHECK-NEXT: [[C48:%[0-9]+]]:_(s32) = G_CONSTANT i32 53
293 ; CHECK-NEXT: [[C49:%[0-9]+]]:_(s32) = G_CONSTANT i32 54
294 ; CHECK-NEXT: [[C50:%[0-9]+]]:_(s32) = G_CONSTANT i32 55
295 ; CHECK-NEXT: [[C51:%[0-9]+]]:_(s32) = G_CONSTANT i32 4352
296 ; CHECK-NEXT: [[C52:%[0-9]+]]:_(s32) = G_CONSTANT i32 4353
297 ; CHECK-NEXT: [[C53:%[0-9]+]]:_(s32) = G_CONSTANT i32 4354
298 ; CHECK-NEXT: [[C54:%[0-9]+]]:_(s32) = G_CONSTANT i32 4355
299 ; CHECK-NEXT: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @global
300 ; CHECK-NEXT: [[C55:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
301 ; CHECK-NEXT: [[C56:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
302 ; CHECK-NEXT: [[C57:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
303 ; CHECK-NEXT: [[C58:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
304 ; CHECK-NEXT: [[C59:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
305 ; CHECK-NEXT: [[C60:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
306 ; CHECK-NEXT: [[C61:%[0-9]+]]:_(s64) = G_CONSTANT i64 5
307 ; CHECK-NEXT: [[C62:%[0-9]+]]:_(s64) = G_CONSTANT i64 6
308 ; CHECK-NEXT: [[C63:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
309 ; CHECK-NEXT: [[C64:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
310 ; CHECK-NEXT: [[C65:%[0-9]+]]:_(s64) = G_CONSTANT i64 9
311 ; CHECK-NEXT: [[C66:%[0-9]+]]:_(s64) = G_CONSTANT i64 10
312 ; CHECK-NEXT: [[C67:%[0-9]+]]:_(s64) = G_CONSTANT i64 11
313 ; CHECK-NEXT: [[C68:%[0-9]+]]:_(s64) = G_CONSTANT i64 12
314 ; CHECK-NEXT: [[C69:%[0-9]+]]:_(s64) = G_CONSTANT i64 13
315 ; CHECK-NEXT: [[C70:%[0-9]+]]:_(s64) = G_CONSTANT i64 14
316 ; CHECK-NEXT: [[C71:%[0-9]+]]:_(s64) = G_CONSTANT i64 15
317 ; CHECK-NEXT: [[C72:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
318 ; CHECK-NEXT: [[C73:%[0-9]+]]:_(s64) = G_CONSTANT i64 17
319 ; CHECK-NEXT: [[C74:%[0-9]+]]:_(s64) = G_CONSTANT i64 18
320 ; CHECK-NEXT: [[C75:%[0-9]+]]:_(s64) = G_CONSTANT i64 19
321 ; CHECK-NEXT: [[C76:%[0-9]+]]:_(s64) = G_CONSTANT i64 20
322 ; CHECK-NEXT: [[C77:%[0-9]+]]:_(s64) = G_CONSTANT i64 21
323 ; CHECK-NEXT: [[C78:%[0-9]+]]:_(s64) = G_CONSTANT i64 22
324 ; CHECK-NEXT: [[C79:%[0-9]+]]:_(s64) = G_CONSTANT i64 23
325 ; CHECK-NEXT: [[C80:%[0-9]+]]:_(s64) = G_CONSTANT i64 24
326 ; CHECK-NEXT: [[C81:%[0-9]+]]:_(s64) = G_CONSTANT i64 25
327 ; CHECK-NEXT: [[C82:%[0-9]+]]:_(s64) = G_CONSTANT i64 26
328 ; CHECK-NEXT: [[C83:%[0-9]+]]:_(s64) = G_CONSTANT i64 27
329 ; CHECK-NEXT: [[C84:%[0-9]+]]:_(s64) = G_CONSTANT i64 28
330 ; CHECK-NEXT: [[C85:%[0-9]+]]:_(s64) = G_CONSTANT i64 29
331 ; CHECK-NEXT: [[C86:%[0-9]+]]:_(s64) = G_CONSTANT i64 30
332 ; CHECK-NEXT: [[C87:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
333 ; CHECK-NEXT: [[C88:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
334 ; CHECK-NEXT: [[C89:%[0-9]+]]:_(s64) = G_CONSTANT i64 33
335 ; CHECK-NEXT: [[C90:%[0-9]+]]:_(s64) = G_CONSTANT i64 34
336 ; CHECK-NEXT: [[C91:%[0-9]+]]:_(s64) = G_CONSTANT i64 35
337 ; CHECK-NEXT: [[C92:%[0-9]+]]:_(s64) = G_CONSTANT i64 36
338 ; CHECK-NEXT: [[C93:%[0-9]+]]:_(s64) = G_CONSTANT i64 37
339 ; CHECK-NEXT: [[C94:%[0-9]+]]:_(s64) = G_CONSTANT i64 38
340 ; CHECK-NEXT: [[C95:%[0-9]+]]:_(s64) = G_CONSTANT i64 39
341 ; CHECK-NEXT: [[C96:%[0-9]+]]:_(s64) = G_CONSTANT i64 40
342 ; CHECK-NEXT: [[C97:%[0-9]+]]:_(s64) = G_CONSTANT i64 41
343 ; CHECK-NEXT: [[C98:%[0-9]+]]:_(s64) = G_CONSTANT i64 42
344 ; CHECK-NEXT: [[C99:%[0-9]+]]:_(s64) = G_CONSTANT i64 43
345 ; CHECK-NEXT: [[C100:%[0-9]+]]:_(s64) = G_CONSTANT i64 44
346 ; CHECK-NEXT: [[C101:%[0-9]+]]:_(s64) = G_CONSTANT i64 45
347 ; CHECK-NEXT: [[C102:%[0-9]+]]:_(s64) = G_CONSTANT i64 46
348 ; CHECK-NEXT: [[C103:%[0-9]+]]:_(s64) = G_CONSTANT i64 47
349 ; CHECK-NEXT: [[C104:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
350 ; CHECK-NEXT: [[C105:%[0-9]+]]:_(s64) = G_CONSTANT i64 49
351 ; CHECK-NEXT: [[C106:%[0-9]+]]:_(s64) = G_CONSTANT i64 50
352 ; CHECK-NEXT: [[C107:%[0-9]+]]:_(s64) = G_CONSTANT i64 51
353 ; CHECK-NEXT: [[C108:%[0-9]+]]:_(s64) = G_CONSTANT i64 52
354 ; CHECK-NEXT: [[C109:%[0-9]+]]:_(s64) = G_CONSTANT i64 53
355 ; CHECK-NEXT: [[C110:%[0-9]+]]:_(s64) = G_CONSTANT i64 54
356 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0.tmp
357 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
358 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.56
359 ; CHECK-NEXT: G_BR %bb.61
361 ; CHECK-NEXT: bb.61.bb:
362 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C1]]
363 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.2
364 ; CHECK-NEXT: G_BR %bb.62
366 ; CHECK-NEXT: bb.62.bb:
367 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C2]]
368 ; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.3
369 ; CHECK-NEXT: G_BR %bb.63
371 ; CHECK-NEXT: bb.63.bb:
372 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C3]]
373 ; CHECK-NEXT: G_BRCOND [[ICMP3]](s1), %bb.4
374 ; CHECK-NEXT: G_BR %bb.64
376 ; CHECK-NEXT: bb.64.bb:
377 ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C4]]
378 ; CHECK-NEXT: G_BRCOND [[ICMP4]](s1), %bb.5
379 ; CHECK-NEXT: G_BR %bb.65
381 ; CHECK-NEXT: bb.65.bb:
382 ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C5]]
383 ; CHECK-NEXT: G_BRCOND [[ICMP5]](s1), %bb.6
384 ; CHECK-NEXT: G_BR %bb.66
386 ; CHECK-NEXT: bb.66.bb:
387 ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C6]]
388 ; CHECK-NEXT: G_BRCOND [[ICMP6]](s1), %bb.7
389 ; CHECK-NEXT: G_BR %bb.67
391 ; CHECK-NEXT: bb.67.bb:
392 ; CHECK-NEXT: [[ICMP7:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C7]]
393 ; CHECK-NEXT: G_BRCOND [[ICMP7]](s1), %bb.8
394 ; CHECK-NEXT: G_BR %bb.68
396 ; CHECK-NEXT: bb.68.bb:
397 ; CHECK-NEXT: [[ICMP8:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C8]]
398 ; CHECK-NEXT: G_BRCOND [[ICMP8]](s1), %bb.9
399 ; CHECK-NEXT: G_BR %bb.69
401 ; CHECK-NEXT: bb.69.bb:
402 ; CHECK-NEXT: [[ICMP9:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C9]]
403 ; CHECK-NEXT: G_BRCOND [[ICMP9]](s1), %bb.10
404 ; CHECK-NEXT: G_BR %bb.70
406 ; CHECK-NEXT: bb.70.bb:
407 ; CHECK-NEXT: [[ICMP10:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C10]]
408 ; CHECK-NEXT: G_BRCOND [[ICMP10]](s1), %bb.11
409 ; CHECK-NEXT: G_BR %bb.71
411 ; CHECK-NEXT: bb.71.bb:
412 ; CHECK-NEXT: [[ICMP11:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C11]]
413 ; CHECK-NEXT: G_BRCOND [[ICMP11]](s1), %bb.12
414 ; CHECK-NEXT: G_BR %bb.72
416 ; CHECK-NEXT: bb.72.bb:
417 ; CHECK-NEXT: [[ICMP12:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C12]]
418 ; CHECK-NEXT: G_BRCOND [[ICMP12]](s1), %bb.13
419 ; CHECK-NEXT: G_BR %bb.73
421 ; CHECK-NEXT: bb.73.bb:
422 ; CHECK-NEXT: [[ICMP13:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C13]]
423 ; CHECK-NEXT: G_BRCOND [[ICMP13]](s1), %bb.14
424 ; CHECK-NEXT: G_BR %bb.74
426 ; CHECK-NEXT: bb.74.bb:
427 ; CHECK-NEXT: [[ICMP14:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C14]]
428 ; CHECK-NEXT: G_BRCOND [[ICMP14]](s1), %bb.15
429 ; CHECK-NEXT: G_BR %bb.75
431 ; CHECK-NEXT: bb.75.bb:
432 ; CHECK-NEXT: [[ICMP15:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C15]]
433 ; CHECK-NEXT: G_BRCOND [[ICMP15]](s1), %bb.16
434 ; CHECK-NEXT: G_BR %bb.76
436 ; CHECK-NEXT: bb.76.bb:
437 ; CHECK-NEXT: [[ICMP16:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C16]]
438 ; CHECK-NEXT: G_BRCOND [[ICMP16]](s1), %bb.17
439 ; CHECK-NEXT: G_BR %bb.77
441 ; CHECK-NEXT: bb.77.bb:
442 ; CHECK-NEXT: [[ICMP17:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C17]]
443 ; CHECK-NEXT: G_BRCOND [[ICMP17]](s1), %bb.18
444 ; CHECK-NEXT: G_BR %bb.78
446 ; CHECK-NEXT: bb.78.bb:
447 ; CHECK-NEXT: [[ICMP18:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C18]]
448 ; CHECK-NEXT: G_BRCOND [[ICMP18]](s1), %bb.19
449 ; CHECK-NEXT: G_BR %bb.79
451 ; CHECK-NEXT: bb.79.bb:
452 ; CHECK-NEXT: [[ICMP19:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C19]]
453 ; CHECK-NEXT: G_BRCOND [[ICMP19]](s1), %bb.20
454 ; CHECK-NEXT: G_BR %bb.80
456 ; CHECK-NEXT: bb.80.bb:
457 ; CHECK-NEXT: [[ICMP20:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C20]]
458 ; CHECK-NEXT: G_BRCOND [[ICMP20]](s1), %bb.21
459 ; CHECK-NEXT: G_BR %bb.81
461 ; CHECK-NEXT: bb.81.bb:
462 ; CHECK-NEXT: [[ICMP21:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C21]]
463 ; CHECK-NEXT: G_BRCOND [[ICMP21]](s1), %bb.22
464 ; CHECK-NEXT: G_BR %bb.82
466 ; CHECK-NEXT: bb.82.bb:
467 ; CHECK-NEXT: [[ICMP22:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C22]]
468 ; CHECK-NEXT: G_BRCOND [[ICMP22]](s1), %bb.23
469 ; CHECK-NEXT: G_BR %bb.83
471 ; CHECK-NEXT: bb.83.bb:
472 ; CHECK-NEXT: [[ICMP23:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C23]]
473 ; CHECK-NEXT: G_BRCOND [[ICMP23]](s1), %bb.24
474 ; CHECK-NEXT: G_BR %bb.84
476 ; CHECK-NEXT: bb.84.bb:
477 ; CHECK-NEXT: [[ICMP24:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C24]]
478 ; CHECK-NEXT: G_BRCOND [[ICMP24]](s1), %bb.25
479 ; CHECK-NEXT: G_BR %bb.85
481 ; CHECK-NEXT: bb.85.bb:
482 ; CHECK-NEXT: [[ICMP25:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C25]]
483 ; CHECK-NEXT: G_BRCOND [[ICMP25]](s1), %bb.26
484 ; CHECK-NEXT: G_BR %bb.86
486 ; CHECK-NEXT: bb.86.bb:
487 ; CHECK-NEXT: [[ICMP26:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C26]]
488 ; CHECK-NEXT: G_BRCOND [[ICMP26]](s1), %bb.27
489 ; CHECK-NEXT: G_BR %bb.87
491 ; CHECK-NEXT: bb.87.bb:
492 ; CHECK-NEXT: [[ICMP27:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C27]]
493 ; CHECK-NEXT: G_BRCOND [[ICMP27]](s1), %bb.28
494 ; CHECK-NEXT: G_BR %bb.88
496 ; CHECK-NEXT: bb.88.bb:
497 ; CHECK-NEXT: [[ICMP28:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C28]]
498 ; CHECK-NEXT: G_BRCOND [[ICMP28]](s1), %bb.29
499 ; CHECK-NEXT: G_BR %bb.89
501 ; CHECK-NEXT: bb.89.bb:
502 ; CHECK-NEXT: [[ICMP29:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C29]]
503 ; CHECK-NEXT: G_BRCOND [[ICMP29]](s1), %bb.30
504 ; CHECK-NEXT: G_BR %bb.90
506 ; CHECK-NEXT: bb.90.bb:
507 ; CHECK-NEXT: [[ICMP30:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C30]]
508 ; CHECK-NEXT: G_BRCOND [[ICMP30]](s1), %bb.31
509 ; CHECK-NEXT: G_BR %bb.91
511 ; CHECK-NEXT: bb.91.bb:
512 ; CHECK-NEXT: [[ICMP31:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C31]]
513 ; CHECK-NEXT: G_BRCOND [[ICMP31]](s1), %bb.32
514 ; CHECK-NEXT: G_BR %bb.92
516 ; CHECK-NEXT: bb.92.bb:
517 ; CHECK-NEXT: [[ICMP32:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C32]]
518 ; CHECK-NEXT: G_BRCOND [[ICMP32]](s1), %bb.33
519 ; CHECK-NEXT: G_BR %bb.93
521 ; CHECK-NEXT: bb.93.bb:
522 ; CHECK-NEXT: [[ICMP33:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C33]]
523 ; CHECK-NEXT: G_BRCOND [[ICMP33]](s1), %bb.34
524 ; CHECK-NEXT: G_BR %bb.94
526 ; CHECK-NEXT: bb.94.bb:
527 ; CHECK-NEXT: [[ICMP34:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C34]]
528 ; CHECK-NEXT: G_BRCOND [[ICMP34]](s1), %bb.35
529 ; CHECK-NEXT: G_BR %bb.95
531 ; CHECK-NEXT: bb.95.bb:
532 ; CHECK-NEXT: [[ICMP35:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C35]]
533 ; CHECK-NEXT: G_BRCOND [[ICMP35]](s1), %bb.36
534 ; CHECK-NEXT: G_BR %bb.96
536 ; CHECK-NEXT: bb.96.bb:
537 ; CHECK-NEXT: [[ICMP36:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C36]]
538 ; CHECK-NEXT: G_BRCOND [[ICMP36]](s1), %bb.37
539 ; CHECK-NEXT: G_BR %bb.97
541 ; CHECK-NEXT: bb.97.bb:
542 ; CHECK-NEXT: [[ICMP37:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C37]]
543 ; CHECK-NEXT: G_BRCOND [[ICMP37]](s1), %bb.38
544 ; CHECK-NEXT: G_BR %bb.98
546 ; CHECK-NEXT: bb.98.bb:
547 ; CHECK-NEXT: [[ICMP38:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C38]]
548 ; CHECK-NEXT: G_BRCOND [[ICMP38]](s1), %bb.39
549 ; CHECK-NEXT: G_BR %bb.99
551 ; CHECK-NEXT: bb.99.bb:
552 ; CHECK-NEXT: [[ICMP39:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C39]]
553 ; CHECK-NEXT: G_BRCOND [[ICMP39]](s1), %bb.40
554 ; CHECK-NEXT: G_BR %bb.100
556 ; CHECK-NEXT: bb.100.bb:
557 ; CHECK-NEXT: [[ICMP40:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C40]]
558 ; CHECK-NEXT: G_BRCOND [[ICMP40]](s1), %bb.41
559 ; CHECK-NEXT: G_BR %bb.101
561 ; CHECK-NEXT: bb.101.bb:
562 ; CHECK-NEXT: [[ICMP41:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C41]]
563 ; CHECK-NEXT: G_BRCOND [[ICMP41]](s1), %bb.42
564 ; CHECK-NEXT: G_BR %bb.102
566 ; CHECK-NEXT: bb.102.bb:
567 ; CHECK-NEXT: [[ICMP42:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C42]]
568 ; CHECK-NEXT: G_BRCOND [[ICMP42]](s1), %bb.43
569 ; CHECK-NEXT: G_BR %bb.103
571 ; CHECK-NEXT: bb.103.bb:
572 ; CHECK-NEXT: [[ICMP43:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C43]]
573 ; CHECK-NEXT: G_BRCOND [[ICMP43]](s1), %bb.44
574 ; CHECK-NEXT: G_BR %bb.104
576 ; CHECK-NEXT: bb.104.bb:
577 ; CHECK-NEXT: [[ICMP44:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C44]]
578 ; CHECK-NEXT: G_BRCOND [[ICMP44]](s1), %bb.45
579 ; CHECK-NEXT: G_BR %bb.105
581 ; CHECK-NEXT: bb.105.bb:
582 ; CHECK-NEXT: [[ICMP45:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C45]]
583 ; CHECK-NEXT: G_BRCOND [[ICMP45]](s1), %bb.46
584 ; CHECK-NEXT: G_BR %bb.106
586 ; CHECK-NEXT: bb.106.bb:
587 ; CHECK-NEXT: [[ICMP46:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C46]]
588 ; CHECK-NEXT: G_BRCOND [[ICMP46]](s1), %bb.47
589 ; CHECK-NEXT: G_BR %bb.107
591 ; CHECK-NEXT: bb.107.bb:
592 ; CHECK-NEXT: [[ICMP47:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C47]]
593 ; CHECK-NEXT: G_BRCOND [[ICMP47]](s1), %bb.48
594 ; CHECK-NEXT: G_BR %bb.108
596 ; CHECK-NEXT: bb.108.bb:
597 ; CHECK-NEXT: [[ICMP48:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C48]]
598 ; CHECK-NEXT: G_BRCOND [[ICMP48]](s1), %bb.49
599 ; CHECK-NEXT: G_BR %bb.109
601 ; CHECK-NEXT: bb.109.bb:
602 ; CHECK-NEXT: [[ICMP49:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C49]]
603 ; CHECK-NEXT: G_BRCOND [[ICMP49]](s1), %bb.50
604 ; CHECK-NEXT: G_BR %bb.110
606 ; CHECK-NEXT: bb.110.bb:
607 ; CHECK-NEXT: [[ICMP50:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C50]]
608 ; CHECK-NEXT: G_BRCOND [[ICMP50]](s1), %bb.51
609 ; CHECK-NEXT: G_BR %bb.111
611 ; CHECK-NEXT: bb.111.bb:
612 ; CHECK-NEXT: [[ICMP51:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C51]]
613 ; CHECK-NEXT: G_BRCOND [[ICMP51]](s1), %bb.52
614 ; CHECK-NEXT: G_BR %bb.112
616 ; CHECK-NEXT: bb.112.bb:
617 ; CHECK-NEXT: [[ICMP52:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C52]]
618 ; CHECK-NEXT: G_BRCOND [[ICMP52]](s1), %bb.53
619 ; CHECK-NEXT: G_BR %bb.113
621 ; CHECK-NEXT: bb.113.bb:
622 ; CHECK-NEXT: [[ICMP53:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C53]]
623 ; CHECK-NEXT: G_BRCOND [[ICMP53]](s1), %bb.54
624 ; CHECK-NEXT: G_BR %bb.114
626 ; CHECK-NEXT: bb.114.bb:
627 ; CHECK-NEXT: [[ICMP54:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C54]]
628 ; CHECK-NEXT: G_BRCOND [[ICMP54]](s1), %bb.55
629 ; CHECK-NEXT: G_BR %bb.60
631 ; CHECK-NEXT: bb.2.bb3:
632 ; CHECK-NEXT: G_BR %bb.56
634 ; CHECK-NEXT: bb.3.bb4:
635 ; CHECK-NEXT: G_BR %bb.56
637 ; CHECK-NEXT: bb.4.bb5:
638 ; CHECK-NEXT: G_BR %bb.56
640 ; CHECK-NEXT: bb.5.bb6:
641 ; CHECK-NEXT: G_BR %bb.56
643 ; CHECK-NEXT: bb.6.bb7:
644 ; CHECK-NEXT: G_BR %bb.56
646 ; CHECK-NEXT: bb.7.bb8:
647 ; CHECK-NEXT: G_BR %bb.56
649 ; CHECK-NEXT: bb.8.bb9:
650 ; CHECK-NEXT: G_BR %bb.56
652 ; CHECK-NEXT: bb.9.bb10:
653 ; CHECK-NEXT: G_BR %bb.56
655 ; CHECK-NEXT: bb.10.bb11:
656 ; CHECK-NEXT: G_BR %bb.56
658 ; CHECK-NEXT: bb.11.bb12:
659 ; CHECK-NEXT: G_BR %bb.56
661 ; CHECK-NEXT: bb.12.bb13:
662 ; CHECK-NEXT: G_BR %bb.56
664 ; CHECK-NEXT: bb.13.bb14:
665 ; CHECK-NEXT: G_BR %bb.56
667 ; CHECK-NEXT: bb.14.bb15:
668 ; CHECK-NEXT: G_BR %bb.56
670 ; CHECK-NEXT: bb.15.bb16:
671 ; CHECK-NEXT: G_BR %bb.56
673 ; CHECK-NEXT: bb.16.bb17:
674 ; CHECK-NEXT: G_BR %bb.56
676 ; CHECK-NEXT: bb.17.bb18:
677 ; CHECK-NEXT: G_BR %bb.56
679 ; CHECK-NEXT: bb.18.bb19:
680 ; CHECK-NEXT: G_BR %bb.56
682 ; CHECK-NEXT: bb.19.bb20:
683 ; CHECK-NEXT: G_BR %bb.56
685 ; CHECK-NEXT: bb.20.bb21:
686 ; CHECK-NEXT: G_BR %bb.56
688 ; CHECK-NEXT: bb.21.bb22:
689 ; CHECK-NEXT: G_BR %bb.56
691 ; CHECK-NEXT: bb.22.bb23:
692 ; CHECK-NEXT: G_BR %bb.56
694 ; CHECK-NEXT: bb.23.bb24:
695 ; CHECK-NEXT: G_BR %bb.56
697 ; CHECK-NEXT: bb.24.bb25:
698 ; CHECK-NEXT: G_BR %bb.56
700 ; CHECK-NEXT: bb.25.bb26:
701 ; CHECK-NEXT: G_BR %bb.56
703 ; CHECK-NEXT: bb.26.bb27:
704 ; CHECK-NEXT: G_BR %bb.56
706 ; CHECK-NEXT: bb.27.bb28:
707 ; CHECK-NEXT: G_BR %bb.56
709 ; CHECK-NEXT: bb.28.bb29:
710 ; CHECK-NEXT: G_BR %bb.56
712 ; CHECK-NEXT: bb.29.bb30:
713 ; CHECK-NEXT: G_BR %bb.56
715 ; CHECK-NEXT: bb.30.bb31:
716 ; CHECK-NEXT: G_BR %bb.56
718 ; CHECK-NEXT: bb.31.bb32:
719 ; CHECK-NEXT: G_BR %bb.56
721 ; CHECK-NEXT: bb.32.bb33:
722 ; CHECK-NEXT: G_BR %bb.56
724 ; CHECK-NEXT: bb.33.bb34:
725 ; CHECK-NEXT: G_BR %bb.56
727 ; CHECK-NEXT: bb.34.bb35:
728 ; CHECK-NEXT: G_BR %bb.56
730 ; CHECK-NEXT: bb.35.bb36:
731 ; CHECK-NEXT: G_BR %bb.56
733 ; CHECK-NEXT: bb.36.bb37:
734 ; CHECK-NEXT: G_BR %bb.56
736 ; CHECK-NEXT: bb.37.bb38:
737 ; CHECK-NEXT: G_BR %bb.56
739 ; CHECK-NEXT: bb.38.bb39:
740 ; CHECK-NEXT: G_BR %bb.56
742 ; CHECK-NEXT: bb.39.bb40:
743 ; CHECK-NEXT: G_BR %bb.56
745 ; CHECK-NEXT: bb.40.bb41:
746 ; CHECK-NEXT: G_BR %bb.56
748 ; CHECK-NEXT: bb.41.bb42:
749 ; CHECK-NEXT: G_BR %bb.56
751 ; CHECK-NEXT: bb.42.bb43:
752 ; CHECK-NEXT: G_BR %bb.56
754 ; CHECK-NEXT: bb.43.bb44:
755 ; CHECK-NEXT: G_BR %bb.56
757 ; CHECK-NEXT: bb.44.bb45:
758 ; CHECK-NEXT: G_BR %bb.56
760 ; CHECK-NEXT: bb.45.bb46:
761 ; CHECK-NEXT: G_BR %bb.56
763 ; CHECK-NEXT: bb.46.bb47:
764 ; CHECK-NEXT: G_BR %bb.56
766 ; CHECK-NEXT: bb.47.bb48:
767 ; CHECK-NEXT: G_BR %bb.56
769 ; CHECK-NEXT: bb.48.bb49:
770 ; CHECK-NEXT: G_BR %bb.56
772 ; CHECK-NEXT: bb.49.bb50:
773 ; CHECK-NEXT: G_BR %bb.56
775 ; CHECK-NEXT: bb.50.bb51:
776 ; CHECK-NEXT: G_BR %bb.56
778 ; CHECK-NEXT: bb.51.bb52:
779 ; CHECK-NEXT: G_BR %bb.56
781 ; CHECK-NEXT: bb.52.bb53:
782 ; CHECK-NEXT: G_BR %bb.56
784 ; CHECK-NEXT: bb.53.bb54:
785 ; CHECK-NEXT: G_BR %bb.56
787 ; CHECK-NEXT: bb.54.bb55:
788 ; CHECK-NEXT: G_BR %bb.56
790 ; CHECK-NEXT: bb.55.bb56:
791 ; CHECK-NEXT: G_BR %bb.56
793 ; CHECK-NEXT: bb.56.bb57:
794 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s64) = G_PHI [[C56]](s64), %bb.1, [[C57]](s64), %bb.2, [[C58]](s64), %bb.3, [[C59]](s64), %bb.4, [[C60]](s64), %bb.5, [[C61]](s64), %bb.6, [[C62]](s64), %bb.7, [[C63]](s64), %bb.8, [[C64]](s64), %bb.9, [[C65]](s64), %bb.10, [[C66]](s64), %bb.11, [[C67]](s64), %bb.12, [[C68]](s64), %bb.13, [[C69]](s64), %bb.14, [[C70]](s64), %bb.15, [[C71]](s64), %bb.16, [[C72]](s64), %bb.17, [[C73]](s64), %bb.18, [[C74]](s64), %bb.19, [[C75]](s64), %bb.20, [[C76]](s64), %bb.21, [[C77]](s64), %bb.22, [[C78]](s64), %bb.23, [[C79]](s64), %bb.24, [[C80]](s64), %bb.25, [[C81]](s64), %bb.26, [[C82]](s64), %bb.27, [[C83]](s64), %bb.28, [[C84]](s64), %bb.29, [[C85]](s64), %bb.30, [[C86]](s64), %bb.31, [[C87]](s64), %bb.32, [[C88]](s64), %bb.33, [[C89]](s64), %bb.34, [[C90]](s64), %bb.35, [[C91]](s64), %bb.36, [[C92]](s64), %bb.37, [[C93]](s64), %bb.38, [[C94]](s64), %bb.39, [[C95]](s64), %bb.40, [[C96]](s64), %bb.41, [[C97]](s64), %bb.42, [[C98]](s64), %bb.43, [[C99]](s64), %bb.44, [[C100]](s64), %bb.45, [[C101]](s64), %bb.46, [[C102]](s64), %bb.47, [[C103]](s64), %bb.48, [[C104]](s64), %bb.49, [[C105]](s64), %bb.50, [[C106]](s64), %bb.51, [[C107]](s64), %bb.52, [[C108]](s64), %bb.53, [[C109]](s64), %bb.54, [[C110]](s64), %bb.55
795 ; CHECK-NEXT: [[C111:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
796 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[PHI]], [[C111]]
797 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[GV]], [[MUL]](s64)
798 ; CHECK-NEXT: [[C112:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
799 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTR_ADD]], [[C112]](s64)
800 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[PTR_ADD1]](p0) :: (load (p0) from %ir.tmp59)
801 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
802 ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
803 ; CHECK-NEXT: $x1 = COPY [[LOAD]](p0)
804 ; CHECK-NEXT: BL @wibble, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1
805 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
806 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
807 ; CHECK-NEXT: G_BR %bb.59
809 ; CHECK-NEXT: bb.57.bb62:
810 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
811 ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
812 ; CHECK-NEXT: $x1 = COPY [[COPY2]](p0)
813 ; CHECK-NEXT: BL @wibble, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1
814 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
815 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
816 ; CHECK-NEXT: G_BR %bb.59
818 ; CHECK-NEXT: bb.58.bb64:
819 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
820 ; CHECK-NEXT: $w0 = COPY [[COPY1]](s32)
821 ; CHECK-NEXT: $x1 = COPY [[FRAME_INDEX]](p0)
822 ; CHECK-NEXT: BL @baz, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $x1
823 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
824 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
825 ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
826 ; CHECK-NEXT: $x1 = COPY [[FRAME_INDEX]](p0)
827 ; CHECK-NEXT: BL @wibble, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1
828 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
829 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
830 ; CHECK-NEXT: G_BR %bb.59
832 ; CHECK-NEXT: bb.59.bb68:
833 ; CHECK-NEXT: RET_ReallyLR
835 ; CHECK-NEXT: bb.60.bb69:
836 ; CHECK-NEXT: [[ICMP55:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY2]](p0), [[C55]]
837 ; CHECK-NEXT: G_BRCOND [[ICMP55]](s1), %bb.58
838 ; CHECK-NEXT: G_BR %bb.57
840 %tmp = alloca [16 x i32], align 4
841 switch i32 %arg1, label %bb69 [
893 i32 4352, label %bb53
894 i32 4353, label %bb54
895 i32 4354, label %bb55
896 i32 4355, label %bb56
1061 bb57: ; preds = %bb56, %bb55, %bb54, %bb53, %bb52, %bb51, %bb50, %bb49, %bb48, %bb47, %bb46, %bb45, %bb44, %bb43, %bb42, %bb41, %bb40, %bb39, %bb38, %bb37, %bb36, %bb35, %bb34, %bb33, %bb32, %bb31, %bb30, %bb29, %bb28, %bb27, %bb26, %bb25, %bb24, %bb23, %bb22, %bb21, %bb20, %bb19, %bb18, %bb17, %bb16, %bb15, %bb14, %bb13, %bb12, %bb11, %bb10, %bb9, %bb8, %bb7, %bb6, %bb5, %bb4, %bb3, %bb
1062 %tmp58 = phi i64 [ 0, %bb ], [ 1, %bb3 ], [ 2, %bb4 ], [ 3, %bb5 ], [ 4, %bb6 ], [ 5, %bb7 ], [ 6, %bb8 ], [ 7, %bb9 ], [ 8, %bb10 ], [ 9, %bb11 ], [ 10, %bb12 ], [ 11, %bb13 ], [ 12, %bb14 ], [ 13, %bb15 ], [ 14, %bb16 ], [ 15, %bb17 ], [ 16, %bb18 ], [ 17, %bb19 ], [ 18, %bb20 ], [ 19, %bb21 ], [ 20, %bb22 ], [ 21, %bb23 ], [ 22, %bb24 ], [ 23, %bb25 ], [ 24, %bb26 ], [ 25, %bb27 ], [ 26, %bb28 ], [ 27, %bb29 ], [ 28, %bb30 ], [ 29, %bb31 ], [ 30, %bb32 ], [ 31, %bb33 ], [ 32, %bb34 ], [ 33, %bb35 ], [ 34, %bb36 ], [ 35, %bb37 ], [ 36, %bb38 ], [ 37, %bb39 ], [ 38, %bb40 ], [ 39, %bb41 ], [ 40, %bb42 ], [ 41, %bb43 ], [ 42, %bb44 ], [ 43, %bb45 ], [ 44, %bb46 ], [ 45, %bb47 ], [ 46, %bb48 ], [ 47, %bb49 ], [ 48, %bb50 ], [ 49, %bb51 ], [ 50, %bb52 ], [ 51, %bb53 ], [ 52, %bb54 ], [ 53, %bb55 ], [ 54, %bb56 ]
1063 %tmp59 = getelementptr inbounds [55 x %0], ptr @global, i64 0, i64 %tmp58, i32 1
1064 %tmp60 = load ptr, ptr %tmp59, align 8
1065 %tmp61 = call ptr @wibble(ptr %arg, ptr %tmp60)
1068 bb62: ; preds = %bb69
1069 %tmp63 = call ptr @wibble(ptr %arg, ptr nonnull %arg2)
1072 bb64: ; preds = %bb69
1073 call void @baz(i32 %arg1, ptr %tmp)
1074 %tmp67 = call ptr @wibble(ptr %arg, ptr %tmp)
1077 bb68: ; preds = %bb64, %bb62, %bb57
1081 %tmp70 = icmp eq ptr %arg2, null
1082 br i1 %tmp70, label %bb64, label %bb62
1085 declare ptr @wibble(ptr returned, ptr)
1087 declare void @baz(i32, ptr)
1090 ; Check that with 2 jump tables, the phi node doesn't lose the edge from the
1092 define void @jt_2_tables_phi_edge_from_second() {
1093 ; CHECK-LABEL: name: jt_2_tables_phi_edge_from_second
1094 ; CHECK: bb.1.entry:
1095 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
1096 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 123
1097 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 263
1098 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 265
1099 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 270
1100 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 279
1101 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1102 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 37
1103 ; CHECK-NEXT: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 43
1104 ; CHECK-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 45
1105 ; CHECK-NEXT: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 60
1106 ; CHECK-NEXT: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 278
1107 ; CHECK-NEXT: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 280
1108 ; CHECK-NEXT: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 281
1109 ; CHECK-NEXT: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 283
1110 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s1) = G_IMPLICIT_DEF
1111 ; CHECK-NEXT: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1112 ; CHECK-NEXT: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
1113 ; CHECK-NEXT: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
1114 ; CHECK-NEXT: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
1115 ; CHECK-NEXT: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
1116 ; CHECK-NEXT: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
1117 ; CHECK-NEXT: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
1118 ; CHECK-NEXT: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
1119 ; CHECK-NEXT: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
1120 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[DEF]](p0) :: (load (s32) from `ptr undef`, align 8)
1121 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C]]
1122 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.6
1123 ; CHECK-NEXT: G_BR %bb.19
1124 ; CHECK-NEXT: {{ $}}
1125 ; CHECK-NEXT: bb.19.entry:
1126 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C1]]
1127 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.4
1128 ; CHECK-NEXT: G_BR %bb.20
1129 ; CHECK-NEXT: {{ $}}
1130 ; CHECK-NEXT: bb.20.entry:
1131 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C2]]
1132 ; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.7
1133 ; CHECK-NEXT: G_BR %bb.21
1134 ; CHECK-NEXT: {{ $}}
1135 ; CHECK-NEXT: bb.21.entry:
1136 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C3]]
1137 ; CHECK-NEXT: G_BRCOND [[ICMP3]](s1), %bb.2
1138 ; CHECK-NEXT: G_BR %bb.22
1139 ; CHECK-NEXT: {{ $}}
1140 ; CHECK-NEXT: bb.22.entry:
1141 ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C4]]
1142 ; CHECK-NEXT: G_BRCOND [[ICMP4]](s1), %bb.5
1143 ; CHECK-NEXT: G_BR %bb.23
1144 ; CHECK-NEXT: {{ $}}
1145 ; CHECK-NEXT: bb.23.entry:
1146 ; CHECK-NEXT: G_BR %bb.3
1147 ; CHECK-NEXT: {{ $}}
1148 ; CHECK-NEXT: bb.2.if.then:
1149 ; CHECK-NEXT: successors:
1152 ; CHECK: bb.3.sw.bb2.i41:
1153 ; CHECK-NEXT: successors:
1156 ; CHECK: bb.4.sw.bb7.i44:
1157 ; CHECK-NEXT: successors:
1160 ; CHECK: bb.5.sw.bb8.i45:
1161 ; CHECK-NEXT: successors:
1164 ; CHECK: bb.6.sw.bb13.i47:
1165 ; CHECK: successors:
1168 ; CHECK: bb.7.sw.bb14.i48:
1169 ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C5]]
1170 ; CHECK-NEXT: G_BRCOND [[ICMP5]](s1), %bb.10
1171 ; CHECK-NEXT: G_BR %bb.24
1172 ; CHECK-NEXT: {{ $}}
1173 ; CHECK-NEXT: bb.24.sw.bb14.i48:
1174 ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C6]]
1175 ; CHECK-NEXT: G_BRCOND [[ICMP6]](s1), %bb.16
1176 ; CHECK-NEXT: G_BR %bb.25
1177 ; CHECK-NEXT: {{ $}}
1178 ; CHECK-NEXT: bb.25.sw.bb14.i48:
1179 ; CHECK-NEXT: [[ICMP7:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C7]]
1180 ; CHECK-NEXT: G_BRCOND [[ICMP7]](s1), %bb.9
1181 ; CHECK-NEXT: G_BR %bb.26
1182 ; CHECK-NEXT: {{ $}}
1183 ; CHECK-NEXT: bb.26.sw.bb14.i48:
1184 ; CHECK-NEXT: [[ICMP8:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C8]]
1185 ; CHECK-NEXT: G_BRCOND [[ICMP8]](s1), %bb.14
1186 ; CHECK-NEXT: G_BR %bb.27
1187 ; CHECK-NEXT: {{ $}}
1188 ; CHECK-NEXT: bb.27.sw.bb14.i48:
1189 ; CHECK-NEXT: [[ICMP9:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C9]]
1190 ; CHECK-NEXT: G_BRCOND [[ICMP9]](s1), %bb.11
1191 ; CHECK-NEXT: G_BR %bb.28
1192 ; CHECK-NEXT: {{ $}}
1193 ; CHECK-NEXT: bb.28.sw.bb14.i48:
1194 ; CHECK-NEXT: [[ICMP10:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C10]]
1195 ; CHECK-NEXT: G_BRCOND [[ICMP10]](s1), %bb.13
1196 ; CHECK-NEXT: G_BR %bb.29
1197 ; CHECK-NEXT: {{ $}}
1198 ; CHECK-NEXT: bb.29.sw.bb14.i48:
1199 ; CHECK-NEXT: [[ICMP11:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C11]]
1200 ; CHECK-NEXT: G_BRCOND [[ICMP11]](s1), %bb.15
1201 ; CHECK-NEXT: G_BR %bb.30
1202 ; CHECK-NEXT: {{ $}}
1203 ; CHECK-NEXT: bb.30.sw.bb14.i48:
1204 ; CHECK-NEXT: [[ICMP12:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C12]]
1205 ; CHECK-NEXT: G_BRCOND [[ICMP12]](s1), %bb.12
1206 ; CHECK-NEXT: G_BR %bb.18
1207 ; CHECK-NEXT: {{ $}}
1208 ; CHECK-NEXT: bb.8.sw.default.i49:
1209 ; CHECK-NEXT: successors:
1212 ; CHECK: bb.9.sw.bb1.i:
1213 ; CHECK-NEXT: G_BR %bb.16
1214 ; CHECK-NEXT: {{ $}}
1215 ; CHECK-NEXT: bb.10.sw.bb4.i:
1216 ; CHECK-NEXT: G_BR %bb.16
1217 ; CHECK-NEXT: {{ $}}
1218 ; CHECK-NEXT: bb.11.sw.bb6.i:
1219 ; CHECK-NEXT: G_BR %bb.16
1220 ; CHECK-NEXT: {{ $}}
1221 ; CHECK-NEXT: bb.12.sw.bb7.i:
1222 ; CHECK-NEXT: G_BR %bb.16
1223 ; CHECK-NEXT: {{ $}}
1224 ; CHECK-NEXT: bb.13.sw.bb8.i:
1225 ; CHECK-NEXT: G_BR %bb.16
1226 ; CHECK-NEXT: {{ $}}
1227 ; CHECK-NEXT: bb.14.sw.bb9.i:
1228 ; CHECK-NEXT: G_BR %bb.16
1229 ; CHECK-NEXT: {{ $}}
1230 ; CHECK-NEXT: bb.15.sw.bb12.i:
1231 ; CHECK-NEXT: G_BR %bb.16
1232 ; CHECK-NEXT: {{ $}}
1233 ; CHECK-NEXT: bb.16.land.rhs.lr.ph:
1234 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C13]](s32), %bb.24, [[C14]](s32), %bb.9, [[C15]](s32), %bb.10, [[C16]](s32), %bb.11, [[C17]](s32), %bb.12, [[C18]](s32), %bb.13, [[C19]](s32), %bb.14, [[C20]](s32), %bb.15
1235 ; CHECK-NEXT: G_BRCOND [[DEF2]](s1), %bb.17
1236 ; CHECK-NEXT: G_BR %bb.18
1237 ; CHECK-NEXT: {{ $}}
1238 ; CHECK-NEXT: bb.17.while.body:
1239 ; CHECK-NEXT: successors:
1241 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
1242 ; CHECK-NEXT: BL @jt_2_tables_phi_edge_from_second, csr_aarch64_aapcs, implicit-def $lr, implicit $sp
1243 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
1244 ; CHECK-NEXT: {{ $}}
1245 ; CHECK-NEXT: bb.18.while.end:
1246 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(s32) = G_PHI [[C21]](s32), %bb.30, [[PHI]](s32), %bb.16
1247 ; CHECK-NEXT: RET_ReallyLR
1249 %0 = load i32, ptr undef, align 8
1250 switch i32 %0, label %sw.default.i49 [
1251 i32 270, label %if.then
1252 i32 265, label %sw.bb14.i48
1253 i32 123, label %sw.bb13.i47
1254 i32 279, label %sw.bb8.i45
1255 i32 286, label %sw.bb2.i41
1256 i32 263, label %sw.bb7.i44
1259 if.then: ; preds = %entry
1262 sw.bb2.i41: ; preds = %entry
1265 sw.bb7.i44: ; preds = %entry
1268 sw.bb8.i45: ; preds = %entry
1271 sw.bb13.i47: ; preds = %entry
1274 sw.bb14.i48: ; preds = %entry
1275 switch i32 undef, label %while.end [
1276 i32 43, label %land.rhs.lr.ph
1277 i32 45, label %sw.bb1.i
1278 i32 280, label %sw.bb8.i
1279 i32 60, label %sw.bb9.i
1280 i32 37, label %sw.bb4.i
1281 i32 281, label %sw.bb12.i
1282 i32 278, label %sw.bb6.i
1283 i32 283, label %sw.bb7.i
1286 sw.default.i49: ; preds = %entry
1289 sw.bb1.i: ; preds = %sw.bb14.i48
1290 br label %land.rhs.lr.ph
1292 sw.bb4.i: ; preds = %sw.bb14.i48
1293 br label %land.rhs.lr.ph
1295 sw.bb6.i: ; preds = %sw.bb14.i48
1296 br label %land.rhs.lr.ph
1298 sw.bb7.i: ; preds = %sw.bb14.i48
1299 br label %land.rhs.lr.ph
1301 sw.bb8.i: ; preds = %sw.bb14.i48
1302 br label %land.rhs.lr.ph
1304 sw.bb9.i: ; preds = %sw.bb14.i48
1305 br label %land.rhs.lr.ph
1307 sw.bb12.i: ; preds = %sw.bb14.i48
1308 br label %land.rhs.lr.ph
1310 land.rhs.lr.ph: ; preds = %sw.bb12.i, %sw.bb9.i, %sw.bb8.i, %sw.bb7.i, %sw.bb6.i, %sw.bb4.i, %sw.bb1.i, %sw.bb14.i48
1311 %retval.0.i.ph = phi i32 [ 0, %sw.bb14.i48 ], [ 1, %sw.bb1.i ], [ 4, %sw.bb4.i ], [ 6, %sw.bb6.i ], [ 7, %sw.bb7.i ], [ 8, %sw.bb8.i ], [ 9, %sw.bb9.i ], [ 12, %sw.bb12.i ]
1312 br i1 undef, label %while.body, label %while.end
1314 while.body: ; preds = %land.rhs.lr.ph
1315 call void @jt_2_tables_phi_edge_from_second()
1318 while.end: ; preds = %land.rhs.lr.ph, %sw.bb14.i48
1319 %op.0.lcssa = phi i32 [ 15, %sw.bb14.i48 ], [ %retval.0.i.ph, %land.rhs.lr.ph ]
1324 define i32 @range_test(i32 %x) {
1325 ; CHECK-LABEL: name: range_test
1326 ; CHECK: bb.1.entry:
1327 ; CHECK-NEXT: liveins: $w0
1328 ; CHECK-NEXT: {{ $}}
1329 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
1330 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
1331 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
1332 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
1333 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
1334 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1335 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
1336 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
1337 ; CHECK-NEXT: G_BR %bb.5
1338 ; CHECK-NEXT: {{ $}}
1339 ; CHECK-NEXT: bb.5.entry:
1340 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[C1]]
1341 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
1342 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ule), [[SUB]](s32), [[C5]]
1343 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.2
1344 ; CHECK-NEXT: G_BR %bb.4
1345 ; CHECK-NEXT: {{ $}}
1346 ; CHECK-NEXT: bb.2.sw.bb:
1347 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[C3]]
1348 ; CHECK-NEXT: G_BR %bb.4
1349 ; CHECK-NEXT: {{ $}}
1350 ; CHECK-NEXT: bb.3.sw.bb1:
1351 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = nsw G_MUL [[COPY]], [[C2]]
1352 ; CHECK-NEXT: G_BR %bb.4
1353 ; CHECK-NEXT: {{ $}}
1354 ; CHECK-NEXT: bb.4.return:
1355 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[MUL]](s32), %bb.3, [[ADD]](s32), %bb.2, [[C4]](s32), %bb.5
1356 ; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
1357 ; CHECK-NEXT: RET_ReallyLR implicit $w0
1359 switch i32 %x, label %return [
1360 i32 24, label %sw.bb
1361 i32 25, label %sw.bb
1362 i32 26, label %sw.bb
1363 i32 6, label %sw.bb1
1367 %add = add nsw i32 %x, 42
1371 %mul = mul nsw i32 %x, 3
1375 %retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ]
1379 define ptr @test_range_phi_switch_cycle() {
1380 ; CHECK-LABEL: name: test_range_phi_switch_cycle
1382 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
1383 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 305
1384 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 307
1385 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 497
1386 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
1387 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
1388 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
1389 ; CHECK-NEXT: G_BR %bb.2
1390 ; CHECK-NEXT: {{ $}}
1391 ; CHECK-NEXT: bb.2.bb1:
1392 ; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[DEF]](s32), %bb.1, [[C3]](s32), %bb.3, [[C4]](s32), %bb.4, [[C5]](s32), %bb.2
1393 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C]]
1394 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.2
1395 ; CHECK-NEXT: G_BR %bb.6
1396 ; CHECK-NEXT: {{ $}}
1397 ; CHECK-NEXT: bb.6.bb1:
1398 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C1]]
1399 ; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.3
1400 ; CHECK-NEXT: G_BR %bb.7
1401 ; CHECK-NEXT: {{ $}}
1402 ; CHECK-NEXT: bb.7.bb1:
1403 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C2]]
1404 ; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.4
1405 ; CHECK-NEXT: G_BR %bb.5
1406 ; CHECK-NEXT: {{ $}}
1407 ; CHECK-NEXT: bb.3.bb2:
1408 ; CHECK-NEXT: G_BR %bb.2
1409 ; CHECK-NEXT: {{ $}}
1410 ; CHECK-NEXT: bb.4.bb3:
1411 ; CHECK-NEXT: G_BR %bb.2
1412 ; CHECK-NEXT: {{ $}}
1413 ; CHECK-NEXT: bb.5.bb4:
1414 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
1415 ; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
1416 ; CHECK-NEXT: BL @ham, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit-def $x0
1417 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
1418 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
1422 bb1: ; preds = %bb3, %bb2, %bb1, %bb
1423 %tmp = phi i32 [undef, %bb ], [ 4, %bb2 ], [ 3, %bb3 ], [ 1, %bb1]
1424 switch i32 undef, label %bb4 [
1437 %tmp5 = tail call ptr @ham(i32 %tmp)
1441 declare ptr @ham(i32)
1443 define internal void @bar() unnamed_addr #1 {
1444 ; CHECK-LABEL: name: bar
1445 ; CHECK: bb.1 (%ir-block.0):
1449 define i1 @i1_value_cmp_is_signed(i1) {
1450 ; CHECK-LABEL: name: i1_value_cmp_is_signed
1451 ; CHECK: bb.1.Entry:
1452 ; CHECK-NEXT: liveins: $w0
1453 ; CHECK-NEXT: {{ $}}
1454 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
1455 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
1456 ; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s8) = G_ASSERT_ZEXT [[TRUNC]], 1
1457 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ASSERT_ZEXT]](s8)
1458 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 true
1459 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s1) = G_CONSTANT i1 false
1460 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(sle), [[TRUNC1]](s1), [[C1]]
1461 ; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
1462 ; CHECK-NEXT: G_BR %bb.2
1463 ; CHECK-NEXT: {{ $}}
1464 ; CHECK-NEXT: bb.2.BadValue:
1465 ; CHECK-NEXT: successors:
1467 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
1468 ; CHECK-NEXT: BL @bar, csr_aarch64_aapcs, implicit-def $lr, implicit $sp
1469 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
1470 ; CHECK-NEXT: {{ $}}
1471 ; CHECK-NEXT: bb.3.OkValue:
1472 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s8) = G_ZEXT [[TRUNC1]](s1)
1473 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ZEXT]](s8)
1474 ; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32)
1475 ; CHECK-NEXT: RET_ReallyLR implicit $w0
1477 switch i1 %0, label %BadValue [
1478 i1 false, label %OkValue
1479 i1 true, label %OkValue
1483 call fastcc void @bar()