1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=aarch64-apple-ios -run-pass=localizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK
7 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
9 define void @local_use() { ret void }
10 define void @non_local_1use() { ret void }
11 define void @non_local_2uses() { ret void }
12 define void @non_local_phi_use() { ret void }
13 define void @non_local_phi_use_followed_by_use() { ret void }
14 define void @non_local_phi_use_followed_by_use_fi() { ret void }
15 define void @float_non_local_phi_use_followed_by_use_fi() { ret void }
16 define void @non_local_phi() { ret void }
17 define void @non_local_label() { ret void }
19 @var1 = common global i32 0, align 4
20 @var2 = common global i32 0, align 4
21 @var3 = common global i32 0, align 4
22 @var4 = common global i32 0, align 4
24 define i32 @intrablock_with_globalvalue() {
26 %0 = load i32, i32* @var1, align 4
27 %cmp = icmp eq i32 %0, 1
28 br i1 %cmp, label %if.then, label %if.end
31 store i32 2, i32* @var2, align 4
32 store i32 3, i32* @var1, align 4
33 store i32 2, i32* @var3, align 4
34 store i32 3, i32* @var1, align 4
40 define i32 @adrp_add() {
42 %0 = load i32, i32* @var1, align 4
43 %cmp = icmp eq i32 %0, 1
44 br i1 %cmp, label %if.then, label %if.end
47 store i32 2, i32* @var2, align 4
48 store i32 3, i32* @var1, align 4
49 store i32 2, i32* @var3, align 4
50 store i32 3, i32* @var1, align 4
57 define void @test_inttoptr() { ret void }
58 define void @many_local_use_intra_block() { ret void }
59 define void @non_local_phi_use_nonunique() { ret void }
68 ; CHECK-LABEL: name: local_use
69 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
70 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
71 %0:gpr(s32) = G_CONSTANT i32 1
72 %1:gpr(s32) = G_ADD %0, %0
80 ; CHECK-LABEL: name: non_local_1use
82 ; CHECK: successors: %bb.1(0x80000000)
83 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
84 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
86 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
87 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[C1]], [[ADD]]
89 ; Existing registers should be left untouched
90 ; The newly created reg should be on the same regbank/regclass as its origin.
95 %0:gpr(s32) = G_CONSTANT i32 1
96 %1:gpr(s32) = G_ADD %0, %0
99 %2:gpr(s32) = G_ADD %0, %1
103 name: non_local_2uses
105 regBankSelected: true
107 ; CHECK-LABEL: name: non_local_2uses
109 ; CHECK: successors: %bb.1(0x80000000)
110 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
111 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
113 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
114 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[C1]], [[C1]]
116 ; Existing registers should be left untouched
117 ; The newly created reg should be on the same regbank/regclass as its origin.
122 %0:gpr(s32) = G_CONSTANT i32 1
123 %1:gpr(s32) = G_ADD %0, %0
126 %2:gpr(s32) = G_ADD %0, %0
130 name: non_local_phi_use
132 regBankSelected: true
133 tracksRegLiveness: true
135 ; CHECK-LABEL: name: non_local_phi_use
137 ; CHECK: successors: %bb.1(0x80000000)
138 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
139 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
141 ; CHECK: successors: %bb.2(0x80000000)
142 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
144 ; CHECK: [[PHI:%[0-9]+]]:gpr(s32) = PHI [[C1]](s32), %bb.1
145 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[PHI]], [[PHI]]
147 ; Existing registers should be left untouched
148 ; The newly created reg should be on the same regbank/regclass as its origin.
153 %0:gpr(s32) = G_CONSTANT i32 1
154 %1:gpr(s32) = G_ADD %0, %0
160 %3:gpr(s32) = PHI %0(s32), %bb.1
161 %2:gpr(s32) = G_ADD %3, %3
165 name: non_local_phi_use_followed_by_use
167 regBankSelected: true
168 tracksRegLiveness: true
170 ; CHECK-LABEL: name: non_local_phi_use_followed_by_use
172 ; CHECK: successors: %bb.1(0x80000000)
173 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
174 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
176 ; CHECK: successors: %bb.2(0x80000000)
177 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
179 ; CHECK: [[PHI:%[0-9]+]]:gpr(s32) = PHI [[C1]](s32), %bb.1
180 ; CHECK: [[C2:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
181 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[PHI]], [[C2]]
183 ; Existing registers should be left untouched
184 ; The newly created reg should be on the same regbank/regclass as its origin.
189 %0:gpr(s32) = G_CONSTANT i32 1
190 %1:gpr(s32) = G_ADD %0, %0
196 %3:gpr(s32) = PHI %0(s32), %bb.1
197 %2:gpr(s32) = G_ADD %3, %0
201 name: non_local_phi_use_followed_by_use_fi
203 regBankSelected: true
204 tracksRegLiveness: true
206 ; CHECK-LABEL: name: non_local_phi_use_followed_by_use_fi
208 ; CHECK: successors: %bb.1(0x80000000)
209 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:gpr(s32) = G_FRAME_INDEX 1
210 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[FRAME_INDEX]], [[FRAME_INDEX]]
212 ; CHECK: successors: %bb.2(0x80000000)
213 ; CHECK: [[FRAME_INDEX1:%[0-9]+]]:gpr(s32) = G_FRAME_INDEX 1
215 ; CHECK: [[PHI:%[0-9]+]]:gpr(s32) = PHI [[FRAME_INDEX1]](s32), %bb.1
216 ; CHECK: [[FRAME_INDEX2:%[0-9]+]]:gpr(s32) = G_FRAME_INDEX 1
217 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[PHI]], [[FRAME_INDEX2]]
219 ; Existing registers should be left untouched
220 ; The newly created reg should be on the same regbank/regclass as its origin.
225 %0:gpr(s32) = G_FRAME_INDEX 1
226 %1:gpr(s32) = G_ADD %0, %0
232 %3:gpr(s32) = PHI %0(s32), %bb.1
233 %2:gpr(s32) = G_ADD %3, %0
237 name: float_non_local_phi_use_followed_by_use_fi
239 regBankSelected: true
240 tracksRegLiveness: true
242 ; CHECK-LABEL: name: float_non_local_phi_use_followed_by_use_fi
244 ; CHECK: successors: %bb.1(0x80000000)
245 ; CHECK: [[C:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
246 ; CHECK: [[FADD:%[0-9]+]]:fpr(s32) = G_FADD [[C]], [[C]]
248 ; CHECK: successors: %bb.2(0x80000000)
249 ; CHECK: [[C1:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
251 ; CHECK: [[PHI:%[0-9]+]]:fpr(s32) = PHI [[C1]](s32), %bb.1
252 ; CHECK: [[C2:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
253 ; CHECK: [[FADD1:%[0-9]+]]:fpr(s32) = G_FADD [[PHI]], [[C2]]
255 ; Existing registers should be left untouched
256 ; The newly created reg should be on the same regbank/regclass as its origin.
261 %0:fpr(s32) = G_FCONSTANT float 1.0
262 %1:fpr(s32) = G_FADD %0, %0
268 %3:fpr(s32) = PHI %0(s32), %bb.1
269 %2:fpr(s32) = G_FADD %3, %0
273 # Make sure we don't insert a constant before PHIs.
274 # This used to happen for loops of one basic block.
277 regBankSelected: true
278 tracksRegLiveness: true
280 ; CHECK-LABEL: name: non_local_phi
282 ; CHECK: successors: %bb.1(0x80000000)
283 ; CHECK: [[C:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
284 ; CHECK: [[FADD:%[0-9]+]]:fpr(s32) = G_FADD [[C]], [[C]]
286 ; CHECK: successors: %bb.1(0x80000000)
287 ; CHECK: [[PHI:%[0-9]+]]:fpr(s32) = PHI [[FADD]](s32), %bb.0, %4(s32), %bb.1
288 ; CHECK: [[C1:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
289 ; CHECK: [[FADD1:%[0-9]+]]:fpr(s32) = G_FADD [[PHI]], [[FADD]]
292 ; Existing registers should be left untouched
293 ; The newly created reg should be on the same regbank/regclass as its origin.
298 %0:fpr(s32) = G_FCONSTANT float 1.0
299 %1:fpr(s32) = G_FADD %0, %0
304 %3:fpr(s32) = PHI %1(s32), %bb.0, %0(s32), %bb.1
305 %2:fpr(s32) = G_FADD %3, %1
310 # Make sure we don't insert a constant before EH_LABELs.
311 name: non_local_label
313 regBankSelected: true
314 tracksRegLiveness: true
316 ; CHECK-LABEL: name: non_local_label
318 ; CHECK: successors: %bb.1(0x80000000)
319 ; CHECK: liveins: $s0
320 ; CHECK: [[COPY:%[0-9]+]]:fpr(s32) = COPY $s0
321 ; CHECK: [[C:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
323 ; CHECK: successors: %bb.1(0x80000000)
325 ; CHECK: [[C1:%[0-9]+]]:fpr(s32) = G_FCONSTANT float 1.000000e+00
326 ; CHECK: [[FADD:%[0-9]+]]:fpr(s32) = G_FADD [[COPY]], [[C1]]
329 ; Existing registers should be left untouched
330 ; The newly created reg should be on the same regbank/regclass as its origin.
336 %0:fpr(s32) = COPY $s0
337 %1:fpr(s32) = G_FCONSTANT float 1.0
343 %2:fpr(s32) = G_FADD %0, %1
347 name: intrablock_with_globalvalue
349 regBankSelected: true
350 tracksRegLiveness: true
352 ; CHECK-LABEL: name: intrablock_with_globalvalue
354 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
355 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 2
356 ; CHECK: [[GV:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var2
357 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 3
358 ; CHECK: [[GV1:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var3
359 ; CHECK: [[C2:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
360 ; CHECK: [[GV2:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var1
361 ; CHECK: [[LOAD:%[0-9]+]]:gpr(s32) = G_LOAD [[GV2]](p0) :: (load (s32) from @var1)
362 ; CHECK: [[C3:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
363 ; CHECK: [[ICMP:%[0-9]+]]:gpr(s32) = G_ICMP intpred(eq), [[LOAD]](s32), [[C3]]
364 ; CHECK: [[TRUNC:%[0-9]+]]:gpr(s1) = G_TRUNC [[ICMP]](s32)
365 ; CHECK: G_BRCOND [[TRUNC]](s1), %bb.1
367 ; CHECK: bb.1.if.then:
368 ; CHECK: successors: %bb.2(0x80000000)
369 ; CHECK: [[GV3:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var2
370 ; CHECK: [[C4:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 2
371 ; CHECK: G_STORE [[C4]](s32), [[GV3]](p0) :: (store (s32) into @var2)
372 ; CHECK: [[C5:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 3
373 ; CHECK: [[GV4:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var1
374 ; CHECK: G_STORE [[C5]](s32), [[GV4]](p0) :: (store (s32) into @var1)
375 ; CHECK: [[GV5:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var3
376 ; CHECK: G_STORE [[C4]](s32), [[GV5]](p0) :: (store (s32) into @var3)
377 ; CHECK: G_STORE [[C5]](s32), [[GV4]](p0) :: (store (s32) into @var1)
378 ; CHECK: bb.2.if.end:
379 ; CHECK: [[C6:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
380 ; CHECK: $w0 = COPY [[C6]](s32)
381 ; CHECK: RET_ReallyLR implicit $w0
383 ; Some of these instructions are dead. We're checking that the other instructions are
384 ; sunk immediately before their first user in the if.then block or as close as possible.
386 %1:gpr(p0) = G_GLOBAL_VALUE @var1
387 %2:gpr(s32) = G_CONSTANT i32 1
388 %4:gpr(s32) = G_CONSTANT i32 2
389 %5:gpr(p0) = G_GLOBAL_VALUE @var2
390 %6:gpr(s32) = G_CONSTANT i32 3
391 %7:gpr(p0) = G_GLOBAL_VALUE @var3
392 %8:gpr(s32) = G_CONSTANT i32 0
393 %0:gpr(s32) = G_LOAD %1(p0) :: (load (s32) from @var1)
394 %9:gpr(s32) = G_ICMP intpred(eq), %0(s32), %2
395 %3:gpr(s1) = G_TRUNC %9(s32)
396 G_BRCOND %3(s1), %bb.2
400 G_STORE %4(s32), %5(p0) :: (store (s32) into @var2)
401 G_STORE %6(s32), %1(p0) :: (store (s32) into @var1)
402 G_STORE %4(s32), %7(p0) :: (store (s32) into @var3)
403 G_STORE %6(s32), %1(p0) :: (store (s32) into @var1)
407 RET_ReallyLR implicit $w0
413 regBankSelected: true
414 tracksRegLiveness: true
416 ; CHECK-LABEL: name: adrp_add
418 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
419 ; CHECK: [[ADRP:%[0-9]+]]:gpr64(p0) = ADRP target-flags(aarch64-page) @var1
420 ; CHECK: %addlow1:gpr(p0) = G_ADD_LOW [[ADRP]](p0), target-flags(aarch64-pageoff, aarch64-nc) @var1
421 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 2
422 ; CHECK: [[ADRP1:%[0-9]+]]:gpr64(p0) = ADRP target-flags(aarch64-page) @var2
423 ; CHECK: %addlow2:gpr(p0) = G_ADD_LOW [[ADRP1]](p0), target-flags(aarch64-pageoff, aarch64-nc) @var2
424 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 3
425 ; CHECK: [[ADRP2:%[0-9]+]]:gpr64(p0) = ADRP target-flags(aarch64-page) @var3
426 ; CHECK: %addlow3:gpr(p0) = G_ADD_LOW [[ADRP2]](p0), target-flags(aarch64-pageoff, aarch64-nc) @var3
427 ; CHECK: [[C2:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
428 ; CHECK: [[LOAD:%[0-9]+]]:gpr(s32) = G_LOAD [[ADRP]](p0) :: (load (s32) from @var1)
429 ; CHECK: [[C3:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
430 ; CHECK: [[ICMP:%[0-9]+]]:gpr(s32) = G_ICMP intpred(eq), [[LOAD]](s32), [[C3]]
431 ; CHECK: [[TRUNC:%[0-9]+]]:gpr(s1) = G_TRUNC [[ICMP]](s32)
432 ; CHECK: G_BRCOND [[TRUNC]](s1), %bb.1
434 ; CHECK: bb.1.if.then:
435 ; CHECK: successors: %bb.2(0x80000000)
436 ; CHECK: [[ADRP3:%[0-9]+]]:gpr64(p0) = ADRP target-flags(aarch64-page) @var2
437 ; CHECK: [[ADD_LOW:%[0-9]+]]:gpr(p0) = G_ADD_LOW [[ADRP3]](p0), target-flags(aarch64-pageoff, aarch64-nc) @var2
438 ; CHECK: [[C4:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 2
439 ; CHECK: G_STORE [[C4]](s32), [[ADD_LOW]](p0) :: (store (s32) into @var2)
440 ; CHECK: [[C5:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 3
441 ; CHECK: [[ADRP4:%[0-9]+]]:gpr64(p0) = ADRP target-flags(aarch64-page) @var1
442 ; CHECK: [[ADD_LOW1:%[0-9]+]]:gpr(p0) = G_ADD_LOW [[ADRP4]](p0), target-flags(aarch64-pageoff, aarch64-nc) @var1
443 ; CHECK: G_STORE [[C5]](s32), [[ADD_LOW1]](p0) :: (store (s32) into @var1)
444 ; CHECK: [[ADRP5:%[0-9]+]]:gpr64(p0) = ADRP target-flags(aarch64-page) @var3
445 ; CHECK: [[ADD_LOW2:%[0-9]+]]:gpr(p0) = G_ADD_LOW [[ADRP5]](p0), target-flags(aarch64-pageoff, aarch64-nc) @var3
446 ; CHECK: G_STORE [[C4]](s32), [[ADD_LOW2]](p0) :: (store (s32) into @var3)
447 ; CHECK: G_STORE [[C5]](s32), [[ADD_LOW1]](p0) :: (store (s32) into @var1)
448 ; CHECK: bb.2.if.end:
449 ; CHECK: [[C6:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
450 ; CHECK: $w0 = COPY [[C6]](s32)
451 ; CHECK: RET_ReallyLR implicit $w0
453 ; Some of these instructions are dead.
455 %1:gpr64(p0) = ADRP target-flags(aarch64-page) @var1
456 %addlow1:gpr(p0) = G_ADD_LOW %1(p0), target-flags(aarch64-pageoff, aarch64-nc) @var1
457 %2:gpr(s32) = G_CONSTANT i32 1
458 %4:gpr(s32) = G_CONSTANT i32 2
459 %5:gpr64(p0) = ADRP target-flags(aarch64-page) @var2
460 %addlow2:gpr(p0) = G_ADD_LOW %5(p0), target-flags(aarch64-pageoff, aarch64-nc) @var2
461 %6:gpr(s32) = G_CONSTANT i32 3
462 %7:gpr64(p0) = ADRP target-flags(aarch64-page) @var3
463 %addlow3:gpr(p0) = G_ADD_LOW %7(p0), target-flags(aarch64-pageoff, aarch64-nc) @var3
464 %8:gpr(s32) = G_CONSTANT i32 0
465 %0:gpr(s32) = G_LOAD %1(p0) :: (load (s32) from @var1)
466 %9:gpr(s32) = G_ICMP intpred(eq), %0(s32), %2
467 %3:gpr(s1) = G_TRUNC %9(s32)
468 G_BRCOND %3(s1), %bb.2
472 G_STORE %4(s32), %addlow2(p0) :: (store (s32) into @var2)
473 G_STORE %6(s32), %addlow1(p0) :: (store (s32) into @var1)
474 G_STORE %4(s32), %addlow3(p0) :: (store (s32) into @var3)
475 G_STORE %6(s32), %addlow1(p0) :: (store (s32) into @var1)
479 RET_ReallyLR implicit $w0
486 regBankSelected: true
487 tracksRegLiveness: true
489 ; CHECK-LABEL: name: test_inttoptr
491 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
492 ; CHECK: liveins: $w0, $x1
493 ; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
494 ; CHECK: [[COPY1:%[0-9]+]]:gpr(p0) = COPY $x1
495 ; CHECK: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 0
496 ; CHECK: [[INTTOPTR:%[0-9]+]]:gpr(p0) = G_INTTOPTR [[C]](s64)
497 ; CHECK: [[C1:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 128
498 ; CHECK: [[INTTOPTR1:%[0-9]+]]:gpr(p0) = G_INTTOPTR [[C1]](s64)
499 ; CHECK: [[C2:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
500 ; CHECK: [[ICMP:%[0-9]+]]:gpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[C2]]
501 ; CHECK: [[TRUNC:%[0-9]+]]:gpr(s1) = G_TRUNC [[ICMP]](s32)
502 ; CHECK: G_BRCOND [[TRUNC]](s1), %bb.1
505 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[COPY]], [[COPY]]
506 ; CHECK: G_STORE [[ADD]](s32), [[COPY1]](p0) :: (store (s32)
507 ; CHECK: [[C3:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 128
508 ; CHECK: [[INTTOPTR2:%[0-9]+]]:gpr(p0) = G_INTTOPTR [[C3]](s64)
509 ; CHECK: $x0 = COPY [[INTTOPTR2]](p0)
510 ; CHECK: RET_ReallyLR implicit $x0
512 ; CHECK: [[C4:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 0
513 ; CHECK: [[INTTOPTR3:%[0-9]+]]:gpr(p0) = G_INTTOPTR [[C4]](s64)
514 ; CHECK: $x0 = COPY [[INTTOPTR3]](p0)
515 ; CHECK: RET_ReallyLR implicit $x0
519 %0:gpr(s32) = COPY $w0
520 %1:gpr(p0) = COPY $x1
521 %2:gpr(s64) = G_CONSTANT i64 128
522 %4:gpr(s32) = G_CONSTANT i32 0
523 %7:gpr(s64) = G_CONSTANT i64 0
524 %6:gpr(p0) = G_INTTOPTR %7(s64)
525 %3:gpr(p0) = G_INTTOPTR %2(s64)
526 %9:gpr(s32) = G_ICMP intpred(eq), %0(s32), %4
527 %5:gpr(s1) = G_TRUNC %9(s32)
528 G_BRCOND %5(s1), %bb.2
532 %8:gpr(s32) = G_ADD %0, %0
533 G_STORE %8(s32), %1(p0) :: (store (s32))
535 RET_ReallyLR implicit $x0
539 RET_ReallyLR implicit $x0
544 name: many_local_use_intra_block
546 regBankSelected: true
549 ; CHECK-LABEL: name: many_local_use_intra_block
550 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
551 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
552 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
553 ; CHECK: [[ADD2:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
554 ; CHECK: [[ADD3:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
555 ; CHECK: [[ADD4:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
556 ; CHECK: [[C1:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 2
557 ; CHECK: [[ADD5:%[0-9]+]]:gpr(s32) = G_ADD [[C1]], [[C1]]
558 %0:gpr(s32) = G_CONSTANT i32 1
559 %1:gpr(s32) = G_CONSTANT i32 2
560 %2:gpr(s32) = G_ADD %0, %0
561 %3:gpr(s32) = G_ADD %0, %0
562 %4:gpr(s32) = G_ADD %0, %0
563 %5:gpr(s32) = G_ADD %0, %0
564 %6:gpr(s32) = G_ADD %0, %0
565 %7:gpr(s32) = G_ADD %1, %1
569 name: non_local_phi_use_nonunique
571 regBankSelected: true
572 tracksRegLiveness: true
574 ; CHECK-LABEL: name: non_local_phi_use_nonunique
576 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
577 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
578 ; CHECK: [[ADD:%[0-9]+]]:gpr(s32) = G_ADD [[C]], [[C]]
579 ; CHECK: %cmp:gpr(s32) = G_ICMP intpred(eq), [[ADD]](s32), [[C]]
580 ; CHECK: %cond:gpr(s1) = G_TRUNC %cmp(s32)
581 ; CHECK: G_BRCOND %cond(s1), %bb.1
584 ; CHECK: successors: %bb.2(0x80000000)
586 ; CHECK: [[PHI:%[0-9]+]]:gpr(s32) = G_PHI [[C]](s32), %bb.1
587 ; CHECK: [[ADD1:%[0-9]+]]:gpr(s32) = G_ADD [[PHI]], [[PHI]]
589 ; Don't localize the 1 into bb.1, because there are multiple edges
590 ; using that register.
593 successors: %bb.1, %bb.2
595 %0:gpr(s32) = G_CONSTANT i32 1
596 %1:gpr(s32) = G_ADD %0, %0
597 %cmp:gpr(s32) = G_ICMP intpred(eq), %1(s32), %0
598 %cond:gpr(s1) = G_TRUNC %cmp(s32)
599 G_BRCOND %cond(s1), %bb.1
606 %3:gpr(s32) = G_PHI %0(s32), %bb.1, %0(s32), %bb.0
607 %2:gpr(s32) = G_ADD %3, %3