1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=aarch64-apple-ios -run-pass=regbankselect -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 @var_fp = global float 0.0
8 @var_int = global i32 0
10 define float @fp_load_phi() { ret float undef }
11 define i32 @int_load_phi() { ret i32 undef }
17 regBankSelected: false
18 tracksRegLiveness: true
20 ; CHECK-LABEL: name: fp_load_phi
22 ; CHECK: successors: %bb.1(0x80000000)
24 ; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
25 ; CHECK: [[GV:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var_fp
26 ; CHECK: %fp_load:fpr(s32) = G_LOAD [[GV]](p0) :: (load (s32) from @var_fp)
28 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
29 ; CHECK: [[PHI:%[0-9]+]]:fpr(s32) = PHI %fp_load(s32), %bb.0, [[PHI]](s32), %bb.1
30 ; CHECK: G_BRCOND [[COPY]](s32), %bb.1
32 ; CHECK: $s0 = COPY [[PHI]](s32)
33 ; CHECK: RET_ReallyLR implicit $s0
34 ; Here we're checking that the load is assigned an FPR bank, since it's
35 ; loading from an fp type in the IR.
40 %1:_(p0) = G_GLOBAL_VALUE @var_fp
41 %fp_load:_(s32) = G_LOAD %1 :: (load 4 from @var_fp)
44 successors: %bb.1, %bb.2
45 %2:_(s32) = PHI %fp_load, %bb.0, %2, %bb.1
50 RET_ReallyLR implicit $s0
56 regBankSelected: false
57 tracksRegLiveness: true
59 ; CHECK-LABEL: name: int_load_phi
61 ; CHECK: successors: %bb.1(0x80000000)
63 ; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
64 ; CHECK: [[GV:%[0-9]+]]:gpr(p0) = G_GLOBAL_VALUE @var_fp
65 ; CHECK: %fp_load:gpr(s32) = G_LOAD [[GV]](p0) :: (load (s32) from @var_int)
67 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
68 ; CHECK: [[PHI:%[0-9]+]]:gpr(s32) = PHI %fp_load(s32), %bb.0, [[PHI]](s32), %bb.1
69 ; CHECK: G_BRCOND [[COPY]](s32), %bb.1
71 ; CHECK: $s0 = COPY [[PHI]](s32)
72 ; CHECK: RET_ReallyLR implicit $s0
77 %1:_(p0) = G_GLOBAL_VALUE @var_fp
78 %fp_load:_(s32) = G_LOAD %1 :: (load 4 from @var_int)
81 successors: %bb.1, %bb.2
82 %2:_(s32) = PHI %fp_load, %bb.0, %2, %bb.1
87 RET_ReallyLR implicit $s0