[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / GlobalISel / inst-select-pattern-xor3.mir
blob6bd34308aad22dc65cc85b024c9b4465c931b2de
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
7 ---
9 name:            xor_s32_sgpr_sgpr_sgpr
10 legalized:       true
11 regBankSelected: true
12 tracksRegLiveness: true
14 body: |
15   bb.0:
16     liveins: $sgpr0, $sgpr1, $sgpr2
17     ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_sgpr
18     ; GFX8: liveins: $sgpr0, $sgpr1, $sgpr2
19     ; GFX8-NEXT: {{  $}}
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]]
26     ;
27     ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_sgpr
28     ; GFX9: liveins: $sgpr0, $sgpr1, $sgpr2
29     ; GFX9-NEXT: {{  $}}
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]]
36     ;
37     ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_sgpr
38     ; GFX10: liveins: $sgpr0, $sgpr1, $sgpr2
39     ; GFX10-NEXT: {{  $}}
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
52 ...
54 ---
56 name:            xor_s32_vgpr_vgpr_vgpr
57 legalized:       true
58 regBankSelected: true
59 tracksRegLiveness: true
61 body: |
62   bb.0:
63     liveins: $vgpr0, $vgpr1, $vgpr2
64     ; GFX8-LABEL: name: xor_s32_vgpr_vgpr_vgpr
65     ; GFX8: liveins: $vgpr0, $vgpr1, $vgpr2
66     ; GFX8-NEXT: {{  $}}
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]]
73     ;
74     ; GFX9-LABEL: name: xor_s32_vgpr_vgpr_vgpr
75     ; GFX9: liveins: $vgpr0, $vgpr1, $vgpr2
76     ; GFX9-NEXT: {{  $}}
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]]
83     ;
84     ; GFX10-LABEL: name: xor_s32_vgpr_vgpr_vgpr
85     ; GFX10: liveins: $vgpr0, $vgpr1, $vgpr2
86     ; GFX10-NEXT: {{  $}}
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
98 ...
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
106 legalized:       true
107 regBankSelected: true
108 tracksRegLiveness: true
110 body: |
111   bb.0:
112     liveins: $sgpr0, $sgpr1, $vgpr0
114     ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy
115     ; GFX8: liveins: $sgpr0, $sgpr1, $vgpr0
116     ; GFX8-NEXT: {{  $}}
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_]]
124     ;
125     ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy
126     ; GFX9: liveins: $sgpr0, $sgpr1, $vgpr0
127     ; GFX9-NEXT: {{  $}}
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_]]
135     ;
136     ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy
137     ; GFX10: liveins: $sgpr0, $sgpr1, $vgpr0
138     ; GFX10-NEXT: {{  $}}
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
158 legalized:       true
159 regBankSelected: true
160 tracksRegLiveness: true
162 body: |
163   bb.0:
164     liveins: $sgpr0, $sgpr1, $vgpr0
166     ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy_commute
167     ; GFX8: liveins: $sgpr0, $sgpr1, $vgpr0
168     ; GFX8-NEXT: {{  $}}
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_]]
176     ;
177     ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy_commute
178     ; GFX9: liveins: $sgpr0, $sgpr1, $vgpr0
179     ; GFX9-NEXT: {{  $}}
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_]]
187     ;
188     ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_vgpr_copy_commute
189     ; GFX10: liveins: $sgpr0, $sgpr1, $vgpr0
190     ; GFX10-NEXT: {{  $}}
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
210 legalized:       true
211 regBankSelected: true
212 tracksRegLiveness: true
214 body: |
215   bb.0:
216     liveins: $sgpr0, $sgpr1, $vgpr0
218     ; GFX8-LABEL: name: xor_s32_sgpr_sgpr_vgpr
219     ; GFX8: liveins: $sgpr0, $sgpr1, $vgpr0
220     ; GFX8-NEXT: {{  $}}
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_]]
227     ;
228     ; GFX9-LABEL: name: xor_s32_sgpr_sgpr_vgpr
229     ; GFX9: liveins: $sgpr0, $sgpr1, $vgpr0
230     ; GFX9-NEXT: {{  $}}
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_]]
237     ;
238     ; GFX10-LABEL: name: xor_s32_sgpr_sgpr_vgpr
239     ; GFX10: liveins: $sgpr0, $sgpr1, $vgpr0
240     ; GFX10-NEXT: {{  $}}
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