1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX8 %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX9 %s
4 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
9 name: xor_s32_sgpr_sgpr_sgpr
12 tracksRegLiveness: true
16 liveins: $sgpr0, $sgpr1, $sgpr2
17 ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_sgpr
18 ; GFX8: liveins: $sgpr0, $sgpr1, $sgpr2
20 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
21 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
22 ; GFX8-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
23 ; GFX8-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
24 ; GFX8-NEXT: [[S_XOR_B32_1:%[0-9]+]]:sreg_32 = S_XOR_B32 [[S_XOR_B32_]], [[COPY2]], implicit-def dead $scc
25 ; GFX8-NEXT: S_ENDPGM 0, implicit [[S_XOR_B32_1]]
27 ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_sgpr
28 ; GFX9: liveins: $sgpr0, $sgpr1, $sgpr2
30 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
31 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
32 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
33 ; GFX9-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
34 ; GFX9-NEXT: [[S_XOR_B32_1:%[0-9]+]]:sreg_32 = S_XOR_B32 [[S_XOR_B32_]], [[COPY2]], implicit-def dead $scc
35 ; GFX9-NEXT: S_ENDPGM 0, implicit [[S_XOR_B32_1]]
37 ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_sgpr
38 ; GFX10: liveins: $sgpr0, $sgpr1, $sgpr2
40 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
41 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
42 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
43 ; GFX10-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
44 ; GFX10-NEXT: [[S_XOR_B32_1:%[0-9]+]]:sreg_32 = S_XOR_B32 [[S_XOR_B32_]], [[COPY2]], implicit-def dead $scc
45 ; GFX10-NEXT: S_ENDPGM 0, implicit [[S_XOR_B32_1]]
46 %0:sgpr(s32) = COPY $sgpr0
47 %1:sgpr(s32) = COPY $sgpr1
48 %2:sgpr(s32) = COPY $sgpr2
49 %3:sgpr(s32) = G_XOR %0, %1
50 %4:sgpr(s32) = G_XOR %3, %2
51 S_ENDPGM 0, implicit %4
56 name: xor_s32_vgpr_vgpr_vgpr
59 tracksRegLiveness: true
63 liveins: $vgpr0, $vgpr1, $vgpr2
64 ; GFX8-LABEL: name: xor_s32_vgpr_vgpr_vgpr
65 ; GFX8: liveins: $vgpr0, $vgpr1, $vgpr2
67 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
68 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
69 ; GFX8-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
70 ; GFX8-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY]], [[COPY1]], implicit $exec
71 ; GFX8-NEXT: [[V_XOR_B32_e64_1:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[V_XOR_B32_e64_]], [[COPY2]], implicit $exec
72 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_1]]
74 ; GFX9-LABEL: name: xor_s32_vgpr_vgpr_vgpr
75 ; GFX9: liveins: $vgpr0, $vgpr1, $vgpr2
77 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
78 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
79 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
80 ; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY]], [[COPY1]], implicit $exec
81 ; GFX9-NEXT: [[V_XOR_B32_e64_1:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[V_XOR_B32_e64_]], [[COPY2]], implicit $exec
82 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_1]]
84 ; GFX10-LABEL: name: xor_s32_vgpr_vgpr_vgpr
85 ; GFX10: liveins: $vgpr0, $vgpr1, $vgpr2
87 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
88 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
89 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
90 ; GFX10-NEXT: [[V_XOR3_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR3_B32_e64 [[COPY]], [[COPY1]], [[COPY2]], implicit $exec
91 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_XOR3_B32_e64_]]
92 %0:vgpr(s32) = COPY $vgpr0
93 %1:vgpr(s32) = COPY $vgpr1
94 %2:vgpr(s32) = COPY $vgpr2
95 %3:vgpr(s32) = G_XOR %0, %1
96 %4:vgpr(s32) = G_XOR %3, %2
97 S_ENDPGM 0, implicit %4
100 # Mixed SGPR and VGPR, with full copy from scalar xor to VGPR, as
101 #should actually be produced by RegBankSelect
105 name: xor_s32_sgpr_sgpr_vgpr_copy
107 regBankSelected: true
108 tracksRegLiveness: true
112 liveins: $sgpr0, $sgpr1, $vgpr0
114 ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy
115 ; GFX8: liveins: $sgpr0, $sgpr1, $vgpr0
117 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
118 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
119 ; GFX8-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
120 ; GFX8-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
121 ; GFX8-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[S_XOR_B32_]]
122 ; GFX8-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY3]], [[COPY2]], implicit $exec
123 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
125 ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy
126 ; GFX9: liveins: $sgpr0, $sgpr1, $vgpr0
128 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
129 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
130 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
131 ; GFX9-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
132 ; GFX9-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[S_XOR_B32_]]
133 ; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY3]], [[COPY2]], implicit $exec
134 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
136 ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy
137 ; GFX10: liveins: $sgpr0, $sgpr1, $vgpr0
139 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
140 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
141 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
142 ; GFX10-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
143 ; GFX10-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[S_XOR_B32_]]
144 ; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY3]], [[COPY2]], implicit $exec
145 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
146 %0:sgpr(s32) = COPY $sgpr0
147 %1:sgpr(s32) = COPY $sgpr1
148 %2:vgpr(s32) = COPY $vgpr0
149 %3:sgpr(s32) = G_XOR %0, %1
150 %4:vgpr(s32) = COPY %3
151 %5:vgpr(s32) = G_XOR %4, %2
152 S_ENDPGM 0, implicit %5
157 name: xor_s32_sgpr_sgpr_vgpr_copy_commute
159 regBankSelected: true
160 tracksRegLiveness: true
164 liveins: $sgpr0, $sgpr1, $vgpr0
166 ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy_commute
167 ; GFX8: liveins: $sgpr0, $sgpr1, $vgpr0
169 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
170 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
171 ; GFX8-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
172 ; GFX8-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
173 ; GFX8-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[S_XOR_B32_]]
174 ; GFX8-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY2]], [[COPY3]], implicit $exec
175 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
177 ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy_commute
178 ; GFX9: liveins: $sgpr0, $sgpr1, $vgpr0
180 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
181 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
182 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
183 ; GFX9-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
184 ; GFX9-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[S_XOR_B32_]]
185 ; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY2]], [[COPY3]], implicit $exec
186 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
188 ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy_commute
189 ; GFX10: liveins: $sgpr0, $sgpr1, $vgpr0
191 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
192 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
193 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
194 ; GFX10-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
195 ; GFX10-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[S_XOR_B32_]]
196 ; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[COPY2]], [[COPY3]], implicit $exec
197 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
198 %0:sgpr(s32) = COPY $sgpr0
199 %1:sgpr(s32) = COPY $sgpr1
200 %2:vgpr(s32) = COPY $vgpr0
201 %3:sgpr(s32) = G_XOR %0, %1
202 %4:vgpr(s32) = COPY %3
203 %5:vgpr(s32) = G_XOR %2, %4
204 S_ENDPGM 0, implicit %5
209 name: xor_s32_sgpr_sgpr_vgpr
211 regBankSelected: true
212 tracksRegLiveness: true
216 liveins: $sgpr0, $sgpr1, $vgpr0
218 ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_vgpr
219 ; GFX8: liveins: $sgpr0, $sgpr1, $vgpr0
221 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
222 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
223 ; GFX8-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
224 ; GFX8-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
225 ; GFX8-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_XOR_B32_]], [[COPY2]], implicit $exec
226 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
228 ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_vgpr
229 ; GFX9: liveins: $sgpr0, $sgpr1, $vgpr0
231 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
232 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
233 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
234 ; GFX9-NEXT: [[S_XOR_B32_:%[0-9]+]]:sreg_32 = S_XOR_B32 [[COPY]], [[COPY1]], implicit-def dead $scc
235 ; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_XOR_B32_]], [[COPY2]], implicit $exec
236 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]]
238 ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_vgpr
239 ; GFX10: liveins: $sgpr0, $sgpr1, $vgpr0
241 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
242 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
243 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
244 ; GFX10-NEXT: [[V_XOR3_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR3_B32_e64 [[COPY]], [[COPY1]], [[COPY2]], implicit $exec
245 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_XOR3_B32_e64_]]
246 %0:sgpr(s32) = COPY $sgpr0
247 %1:sgpr(s32) = COPY $sgpr1
248 %2:vgpr(s32) = COPY $vgpr0
249 %3:sgpr(s32) = G_XOR %0, %1
250 %4:vgpr(s32) = G_XOR %3, %2
251 S_ENDPGM 0, implicit %4