1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=hawaii -run-pass=amdgpu-regbankselect -regbankselect-fast -verify-machineinstrs -o - %s | FileCheck -check-prefixes=CHECK,FAST %s
3 # RUN: llc -mtriple=amdgcn -mcpu=hawaii -run-pass=amdgpu-regbankselect -regbankselect-greedy -verify-machineinstrs -o - %s | FileCheck -check-prefixes=CHECK,GREEDY %s
6 name: test_implicit_def_s32_vgpr_use
12 ; CHECK-LABEL: name: test_implicit_def_s32_vgpr_use
13 ; CHECK: liveins: $vgpr0_vgpr1
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
16 ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr(s32) = G_IMPLICIT_DEF
17 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[DEF]](s32)
18 ; CHECK-NEXT: G_STORE [[COPY1]](s32), [[COPY]](p1) :: (store (s32), addrspace 1)
19 %0:_(p1) = COPY $vgpr0_vgpr1
20 %1:_(s32) = G_IMPLICIT_DEF
21 G_STORE %1, %0 :: (store (s32), addrspace 1)
26 name: test_implicit_def_s32_sgpr_use
30 ; CHECK-LABEL: name: test_implicit_def_s32_sgpr_use
31 ; CHECK: [[DEF:%[0-9]+]]:sgpr(s32) = G_IMPLICIT_DEF
32 ; CHECK-NEXT: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.s.sendmsg), 0, [[DEF]](s32)
33 %0:_(s32) = G_IMPLICIT_DEF
34 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.s.sendmsg), 0, %0
39 name: test_implicit_def_s64_vgpr_use
45 ; CHECK-LABEL: name: test_implicit_def_s64_vgpr_use
46 ; CHECK: liveins: $vgpr0_vgpr1
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
49 ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr(s64) = G_IMPLICIT_DEF
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s64) = COPY [[DEF]](s64)
51 ; CHECK-NEXT: G_STORE [[COPY1]](s64), [[COPY]](p1) :: (store (s64), addrspace 1)
52 %0:_(p1) = COPY $vgpr0_vgpr1
53 %1:_(s64) = G_IMPLICIT_DEF
54 G_STORE %1, %0 :: (store (s64), addrspace 1)
59 name: test_implicit_def_v3s32_vgpr_use
65 ; CHECK-LABEL: name: test_implicit_def_v3s32_vgpr_use
66 ; CHECK: liveins: $vgpr0_vgpr1
68 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
69 ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr(<3 x s32>) = G_IMPLICIT_DEF
70 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<3 x s32>) = COPY [[DEF]](<3 x s32>)
71 ; CHECK-NEXT: G_STORE [[COPY1]](<3 x s32>), [[COPY]](p1) :: (store (<3 x s32>), align 4, addrspace 1)
72 %0:_(p1) = COPY $vgpr0_vgpr1
73 %1:_(<3 x s32>) = G_IMPLICIT_DEF
74 G_STORE %1, %0 :: (store (<3 x s32>), addrspace 1, align 4)
79 name: test_implicit_def_v4s32_vgpr_use
85 ; CHECK-LABEL: name: test_implicit_def_v4s32_vgpr_use
86 ; CHECK: liveins: $vgpr0_vgpr1
88 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
89 ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr(<4 x s32>) = G_IMPLICIT_DEF
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<4 x s32>) = COPY [[DEF]](<4 x s32>)
91 ; CHECK-NEXT: G_STORE [[COPY1]](<4 x s32>), [[COPY]](p1) :: (store (<4 x s32>), align 4, addrspace 1)
92 %0:_(p1) = COPY $vgpr0_vgpr1
93 %1:_(<4 x s32>) = G_IMPLICIT_DEF
94 G_STORE %1, %0 :: (store (<4 x s32>), addrspace 1, align 4)
99 name: test_implicit_def_s64_sgpr_use
103 ; CHECK-LABEL: name: test_implicit_def_s64_sgpr_use
104 ; CHECK: [[DEF:%[0-9]+]]:sgpr(s64) = G_IMPLICIT_DEF
105 ; CHECK-NEXT: $sgpr8_sgpr9 = COPY [[DEF]](s64)
106 %0:_(s64) = G_IMPLICIT_DEF
107 $sgpr8_sgpr9 = COPY %0
112 name: test_implicit_def_s128_sgpr_use
116 ; CHECK-LABEL: name: test_implicit_def_s128_sgpr_use
117 ; CHECK: [[DEF:%[0-9]+]]:sgpr(s128) = G_IMPLICIT_DEF
118 ; CHECK-NEXT: $sgpr8_sgpr9_sgpr10_sgpr11 = COPY [[DEF]](s128)
119 %0:_(s128) = G_IMPLICIT_DEF
120 $sgpr8_sgpr9_sgpr10_sgpr11 = COPY %0
125 name: test_implicit_def_s1_sgpr_use
129 liveins: $sgpr8, $sgpr9
130 ; CHECK-LABEL: name: test_implicit_def_s1_sgpr_use
131 ; CHECK: liveins: $sgpr8, $sgpr9
133 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr8
134 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr9
135 ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr(s32) = G_IMPLICIT_DEF
136 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[DEF]](s32)
137 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s1)
138 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ZEXT]](s32), [[COPY]], [[COPY1]]
139 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SELECT]](s32)
140 %0:_(s32) = COPY $sgpr8
141 %1:_(s32) = COPY $sgpr9
142 %2:_(s1) = G_IMPLICIT_DEF
143 %3:_(s32) = G_SELECT %2, %0, %1
144 S_ENDPGM 0, implicit %3
149 name: test_implicit_def_s1_vcc_use
153 liveins: $vgpr0, $vgpr1
154 ; CHECK-LABEL: name: test_implicit_def_s1_vcc_use
155 ; CHECK: liveins: $vgpr0, $vgpr1
157 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
158 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
159 ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr(s32) = G_IMPLICIT_DEF
160 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[DEF]](s32)
161 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
162 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY2]](s1), [[COPY]], [[COPY1]]
163 ; CHECK-NEXT: S_ENDPGM 0, implicit [[SELECT]](s32)
164 %0:_(s32) = COPY $vgpr0
165 %1:_(s32) = COPY $vgpr1
166 %2:_(s1) = G_IMPLICIT_DEF
167 %3:_(s32) = G_SELECT %2, %0, %1
168 S_ENDPGM 0, implicit %3
173 name: test_implicit_def_s1_explicit_vcc_use_0
177 liveins: $vgpr0, $vgpr1
178 ; FAST-LABEL: name: test_implicit_def_s1_explicit_vcc_use_0
179 ; FAST: liveins: $vgpr0, $vgpr1
181 ; FAST-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
182 ; FAST-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
183 ; FAST-NEXT: [[DEF:%[0-9]+]]:sgpr(s32) = G_IMPLICIT_DEF
184 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[DEF]](s32)
185 ; FAST-NEXT: [[COPY2:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
186 ; FAST-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[COPY2]](s1), [[COPY]], [[COPY1]]
187 ; FAST-NEXT: S_ENDPGM 0, implicit [[SELECT]](s32)
188 ; GREEDY-LABEL: name: test_implicit_def_s1_explicit_vcc_use_0
189 ; GREEDY: liveins: $vgpr0, $vgpr1
190 ; GREEDY-NEXT: {{ $}}
191 ; GREEDY-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
192 ; GREEDY-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
193 ; GREEDY-NEXT: [[DEF:%[0-9]+]]:vcc(s1) = G_IMPLICIT_DEF
194 ; GREEDY-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[DEF]](s1), [[COPY]], [[COPY1]]
195 ; GREEDY-NEXT: S_ENDPGM 0, implicit [[SELECT]](s32)
196 %0:_(s32) = COPY $vgpr0
197 %1:_(s32) = COPY $vgpr1
198 %2:vcc(s1) = G_IMPLICIT_DEF
199 %3:_(s32) = G_SELECT %2, %0, %1
200 S_ENDPGM 0, implicit %3
205 name: test_implicit_def_s1_explicit_vcc_use_1
209 ; FAST-LABEL: name: test_implicit_def_s1_explicit_vcc_use_1
210 ; FAST: [[DEF:%[0-9]+]]:sgpr(s32) = G_IMPLICIT_DEF
211 ; FAST-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[DEF]](s32)
212 ; FAST-NEXT: [[COPY:%[0-9]+]]:vcc(s1) = COPY [[TRUNC]](s1)
213 ; FAST-NEXT: S_ENDPGM 0, implicit [[COPY]](s1)
214 ; GREEDY-LABEL: name: test_implicit_def_s1_explicit_vcc_use_1
215 ; GREEDY: [[DEF:%[0-9]+]]:vcc(s1) = G_IMPLICIT_DEF
216 ; GREEDY-NEXT: S_ENDPGM 0, implicit [[DEF]](s1)
217 %2:vcc(s1) = G_IMPLICIT_DEF
218 S_ENDPGM 0, implicit %2