1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -march=amdgcn -mcpu=hawaii  -run-pass=legalizer -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX7 %s
3# RUN: llc -O0 -march=amdgcn -mcpu=fiji  -run-pass=legalizer -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX8 %s
4# RUN: llc -O0 -march=amdgcn -mcpu=gfx900  -run-pass=legalizer -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX9 %s
5
6---
7name: test_icmp_s32
8body: |
9  bb.0:
10    liveins: $vgpr0
11    ; GFX7-LABEL: name: test_icmp_s32
12    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
13    ; GFX7: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
15    ; GFX7: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[C]], [[COPY]]
16    ; GFX7: $vgpr0 = COPY [[SELECT]](s32)
17    ; GFX8-LABEL: name: test_icmp_s32
18    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
19    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
20    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
21    ; GFX8: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[C]], [[COPY]]
22    ; GFX8: $vgpr0 = COPY [[SELECT]](s32)
23    ; GFX9-LABEL: name: test_icmp_s32
24    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
25    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
26    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[COPY]]
27    ; GFX9: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[C]], [[COPY]]
28    ; GFX9: $vgpr0 = COPY [[SELECT]](s32)
29    %0:_(s32) = G_CONSTANT i32 0
30    %1:_(s32) = COPY $vgpr0
31    %2:_(s1) = G_ICMP intpred(ne), %0, %1
32    %3:_(s32) = G_SELECT %2, %0, %1
33    $vgpr0 = COPY %3
34...
35
36---
37name: test_icmp_s64
38body: |
39  bb.0:
40    liveins: $vgpr0_vgpr1
41    ; GFX7-LABEL: name: test_icmp_s64
42    ; GFX7: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
43    ; GFX7: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
44    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s64), [[COPY]]
45    ; GFX7: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s1), [[C]], [[COPY]]
46    ; GFX7: $vgpr0_vgpr1 = COPY [[SELECT]](s64)
47    ; GFX8-LABEL: name: test_icmp_s64
48    ; GFX8: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
49    ; GFX8: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
50    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s64), [[COPY]]
51    ; GFX8: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s1), [[C]], [[COPY]]
52    ; GFX8: $vgpr0_vgpr1 = COPY [[SELECT]](s64)
53    ; GFX9-LABEL: name: test_icmp_s64
54    ; GFX9: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
55    ; GFX9: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
56    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s64), [[COPY]]
57    ; GFX9: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s1), [[C]], [[COPY]]
58    ; GFX9: $vgpr0_vgpr1 = COPY [[SELECT]](s64)
59    %0:_(s64) = G_CONSTANT i64 0
60    %1:_(s64) = COPY $vgpr0_vgpr1
61    %2:_(s1) = G_ICMP intpred(ne), %0, %1
62    %3:_(s64) = G_SELECT %2, %0, %1
63    $vgpr0_vgpr1 = COPY %3
64...
65
66---
67name: test_icmp_s16
68body: |
69  bb.0:
70    liveins: $vgpr0
71    ; GFX7-LABEL: name: test_icmp_s16
72    ; GFX7: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
73    ; GFX7: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
74    ; GFX7: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
75    ; GFX7: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
76    ; GFX7: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
77    ; GFX7: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
78    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
79    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C1]](s32), [[AND]]
80    ; GFX7: [[SELECT:%[0-9]+]]:_(s16) = G_SELECT [[ICMP]](s1), [[C]], [[TRUNC]]
81    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SELECT]](s16)
82    ; GFX7: $vgpr0 = COPY [[ANYEXT]](s32)
83    ; GFX8-LABEL: name: test_icmp_s16
84    ; GFX8: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
85    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
86    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
87    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s16), [[TRUNC]]
88    ; GFX8: [[SELECT:%[0-9]+]]:_(s16) = G_SELECT [[ICMP]](s1), [[C]], [[TRUNC]]
89    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SELECT]](s16)
90    ; GFX8: $vgpr0 = COPY [[ANYEXT]](s32)
91    ; GFX9-LABEL: name: test_icmp_s16
92    ; GFX9: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
93    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
94    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
95    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s16), [[TRUNC]]
96    ; GFX9: [[SELECT:%[0-9]+]]:_(s16) = G_SELECT [[ICMP]](s1), [[C]], [[TRUNC]]
97    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SELECT]](s16)
98    ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
99    %0:_(s16) = G_CONSTANT i16 0
100    %1:_(s32) = COPY $vgpr0
101    %2:_(s16) = G_TRUNC %1
102    %3:_(s1) = G_ICMP intpred(ne), %0, %2
103    %4:_(s16) = G_SELECT %3, %0, %2
104    %5:_(s32) = G_ANYEXT %4
105    $vgpr0 = COPY %5
106...
107
108---
109name: test_icmp_s8
110body: |
111  bb.0:
112    liveins: $vgpr0
113    ; GFX7-LABEL: name: test_icmp_s8
114    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
115    ; GFX7: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
116    ; GFX7: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
117    ; GFX7: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
118    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
119    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
120    ; GFX7: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
121    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
122    ; GFX7: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
123    ; GFX7: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
124    ; GFX7: [[SELECT:%[0-9]+]]:_(s16) = G_SELECT [[ICMP]](s1), [[C2]], [[TRUNC]]
125    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SELECT]](s16)
126    ; GFX7: $vgpr0 = COPY [[ANYEXT]](s32)
127    ; GFX8-LABEL: name: test_icmp_s8
128    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
129    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
130    ; GFX8: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
131    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
132    ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
133    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
134    ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
135    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
136    ; GFX8: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
137    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
138    ; GFX8: [[SELECT:%[0-9]+]]:_(s16) = G_SELECT [[ICMP]](s1), [[C2]], [[TRUNC]]
139    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SELECT]](s16)
140    ; GFX8: $vgpr0 = COPY [[ANYEXT]](s32)
141    ; GFX9-LABEL: name: test_icmp_s8
142    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
143    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
144    ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
145    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
146    ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
147    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
148    ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
149    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
150    ; GFX9: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
151    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
152    ; GFX9: [[SELECT:%[0-9]+]]:_(s16) = G_SELECT [[ICMP]](s1), [[C2]], [[TRUNC]]
153    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SELECT]](s16)
154    ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
155    %0:_(s8) = G_CONSTANT i8 0
156    %1:_(s32) = COPY $vgpr0
157    %2:_(s8) = G_TRUNC %1
158    %3:_(s1) = G_ICMP intpred(ne), %0, %2
159    %4:_(s8) = G_SELECT %3, %0, %2
160    %5:_(s32) = G_ANYEXT %4
161    $vgpr0 = COPY %5
162...
163
164---
165name: test_icmp_s24
166body: |
167  bb.0:
168    liveins: $vgpr0
169    ; GFX7-LABEL: name: test_icmp_s24
170    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
171    ; GFX7: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
172    ; GFX7: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215
173    ; GFX7: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
174    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
175    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
176    ; GFX7: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
177    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
178    ; GFX7: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
179    ; GFX7: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
180    ; GFX7: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY3]], [[COPY4]]
181    ; GFX7: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
182    ; GFX7: $vgpr0 = COPY [[COPY5]](s32)
183    ; GFX8-LABEL: name: test_icmp_s24
184    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
185    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
186    ; GFX8: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215
187    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
188    ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
189    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
190    ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
191    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
192    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
193    ; GFX8: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
194    ; GFX8: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY3]], [[COPY4]]
195    ; GFX8: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
196    ; GFX8: $vgpr0 = COPY [[COPY5]](s32)
197    ; GFX9-LABEL: name: test_icmp_s24
198    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
199    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
200    ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215
201    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
202    ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
203    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
204    ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
205    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
206    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
207    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
208    ; GFX9: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[COPY3]], [[COPY4]]
209    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
210    ; GFX9: $vgpr0 = COPY [[COPY5]](s32)
211    %0:_(s24) = G_CONSTANT i24 0
212    %1:_(s32) = COPY $vgpr0
213    %2:_(s24) = G_TRUNC %1
214    %3:_(s1) = G_ICMP intpred(ne), %0, %2
215    %4:_(s24) = G_SELECT %3, %0, %2
216    %5:_(s32) = G_ANYEXT %4
217    $vgpr0 = COPY %5
218...
219
220---
221name: test_icmp_v2s32
222body: |
223  bb.0:
224    liveins: $vgpr0_vgpr1
225    ; GFX7-LABEL: name: test_icmp_v2s32
226    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
227    ; GFX7: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
228    ; GFX7: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
229    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[UV]]
230    ; GFX7: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[UV1]]
231    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
232    ; GFX7: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
233    ; GFX7: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
234    ; GFX7: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
235    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
236    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
237    ; GFX7: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
238    ; GFX7: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32)
239    ; GFX7: S_NOP 0, implicit [[BUILD_VECTOR]](<2 x s32>)
240    ; GFX8-LABEL: name: test_icmp_v2s32
241    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
242    ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
243    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
244    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[UV]]
245    ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[UV1]]
246    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
247    ; GFX8: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
248    ; GFX8: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
249    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
250    ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
251    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
252    ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
253    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32)
254    ; GFX8: S_NOP 0, implicit [[BUILD_VECTOR]](<2 x s32>)
255    ; GFX9-LABEL: name: test_icmp_v2s32
256    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
257    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
258    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
259    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[UV]]
260    ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[C]](s32), [[UV1]]
261    ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
262    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
263    ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C1]]
264    ; GFX9: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
265    ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C1]]
266    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32)
267    ; GFX9: S_NOP 0, implicit [[BUILD_VECTOR]](<2 x s32>)
268    %0:_(s32) = G_CONSTANT i32 0
269    %1:_(<2 x s32>) = G_BUILD_VECTOR %0, %0
270    %2:_(<2 x s32>) = COPY $vgpr0_vgpr1
271    %3:_(<2 x s1>) = G_ICMP intpred(ne), %1, %2
272    %4:_(<2 x s32>) = G_ZEXT %3
273    S_NOP 0, implicit %4
274...
275
276---
277name: test_icmp_v3s32
278body: |
279  bb.0:
280    liveins: $vgpr0_vgpr1_vgpr2
281
282    ; GFX7-LABEL: name: test_icmp_v3s32
283    ; GFX7: [[DEF:%[0-9]+]]:_(<3 x s32>) = G_IMPLICIT_DEF
284    ; GFX7: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
285    ; GFX7: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<3 x s32>)
286    ; GFX7: [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
287    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV3]]
288    ; GFX7: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV4]]
289    ; GFX7: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV2]](s32), [[UV5]]
290    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
291    ; GFX7: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
292    ; GFX7: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP2]](s1)
293    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
294    ; GFX7: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
295    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
296    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
297    ; GFX7: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
298    ; GFX7: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT2]](s32)
299    ; GFX7: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
300    ; GFX7: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32)
301    ; GFX7: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s32>)
302    ; GFX8-LABEL: name: test_icmp_v3s32
303    ; GFX8: [[DEF:%[0-9]+]]:_(<3 x s32>) = G_IMPLICIT_DEF
304    ; GFX8: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
305    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<3 x s32>)
306    ; GFX8: [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
307    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV3]]
308    ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV4]]
309    ; GFX8: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV2]](s32), [[UV5]]
310    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
311    ; GFX8: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
312    ; GFX8: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP2]](s1)
313    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
314    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
315    ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
316    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
317    ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
318    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT2]](s32)
319    ; GFX8: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
320    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32)
321    ; GFX8: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s32>)
322    ; GFX9-LABEL: name: test_icmp_v3s32
323    ; GFX9: [[DEF:%[0-9]+]]:_(<3 x s32>) = G_IMPLICIT_DEF
324    ; GFX9: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
325    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<3 x s32>)
326    ; GFX9: [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
327    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV3]]
328    ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV4]]
329    ; GFX9: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV2]](s32), [[UV5]]
330    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
331    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
332    ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C]]
333    ; GFX9: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
334    ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C]]
335    ; GFX9: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP2]](s1)
336    ; GFX9: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ANYEXT2]], [[C]]
337    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32)
338    ; GFX9: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s32>)
339    %0:_(<3 x s32>) = G_IMPLICIT_DEF
340    %1:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
341    %2:_(<3 x s1>) = G_ICMP intpred(ne), %0, %1
342    %3:_(<3 x s32>) = G_ZEXT %2
343    S_NOP 0, implicit %3
344...
345
346---
347name: test_icmp_v4s32
348body: |
349  bb.0:
350    liveins: $vgpr0_vgpr1_vgpr2_vgpr3
351
352    ; GFX7-LABEL: name: test_icmp_v4s32
353    ; GFX7: [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
354    ; GFX7: [[LOAD:%[0-9]+]]:_(<4 x s32>) = G_LOAD [[DEF]](p1) :: (volatile load 16)
355    ; GFX7: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
356    ; GFX7: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[LOAD]](<4 x s32>)
357    ; GFX7: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
358    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV4]]
359    ; GFX7: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV5]]
360    ; GFX7: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV2]](s32), [[UV6]]
361    ; GFX7: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV3]](s32), [[UV7]]
362    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
363    ; GFX7: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
364    ; GFX7: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP2]](s1)
365    ; GFX7: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP3]](s1)
366    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
367    ; GFX7: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
368    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
369    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
370    ; GFX7: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
371    ; GFX7: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT2]](s32)
372    ; GFX7: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
373    ; GFX7: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ANYEXT3]](s32)
374    ; GFX7: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
375    ; GFX7: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32), [[AND3]](s32)
376    ; GFX7: S_NOP 0, implicit [[BUILD_VECTOR]](<4 x s32>)
377    ; GFX8-LABEL: name: test_icmp_v4s32
378    ; GFX8: [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
379    ; GFX8: [[LOAD:%[0-9]+]]:_(<4 x s32>) = G_LOAD [[DEF]](p1) :: (volatile load 16)
380    ; GFX8: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
381    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[LOAD]](<4 x s32>)
382    ; GFX8: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
383    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV4]]
384    ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV5]]
385    ; GFX8: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV2]](s32), [[UV6]]
386    ; GFX8: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV3]](s32), [[UV7]]
387    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
388    ; GFX8: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
389    ; GFX8: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP2]](s1)
390    ; GFX8: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP3]](s1)
391    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
392    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
393    ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
394    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
395    ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
396    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT2]](s32)
397    ; GFX8: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
398    ; GFX8: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ANYEXT3]](s32)
399    ; GFX8: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
400    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32), [[AND3]](s32)
401    ; GFX8: S_NOP 0, implicit [[BUILD_VECTOR]](<4 x s32>)
402    ; GFX9-LABEL: name: test_icmp_v4s32
403    ; GFX9: [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
404    ; GFX9: [[LOAD:%[0-9]+]]:_(<4 x s32>) = G_LOAD [[DEF]](p1) :: (volatile load 16)
405    ; GFX9: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
406    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[LOAD]](<4 x s32>)
407    ; GFX9: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
408    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](s32), [[UV4]]
409    ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](s32), [[UV5]]
410    ; GFX9: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV2]](s32), [[UV6]]
411    ; GFX9: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV3]](s32), [[UV7]]
412    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
413    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
414    ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C]]
415    ; GFX9: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
416    ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C]]
417    ; GFX9: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP2]](s1)
418    ; GFX9: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ANYEXT2]], [[C]]
419    ; GFX9: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP3]](s1)
420    ; GFX9: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ANYEXT3]], [[C]]
421    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32), [[AND3]](s32)
422    ; GFX9: S_NOP 0, implicit [[BUILD_VECTOR]](<4 x s32>)
423    %0:_(p1) = G_IMPLICIT_DEF
424    %1:_(<4 x s32>) = G_LOAD %0 :: (volatile load 16)
425    %2:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
426    %3:_(<4 x s1>) = G_ICMP intpred(ne), %1, %2
427    %4:_(<4 x s32>) = G_ZEXT %3
428    S_NOP 0, implicit %4
429
430...
431
432---
433name: test_icmp_p0
434body: |
435  bb.0:
436    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
437    ; GFX7-LABEL: name: test_icmp_p0
438    ; GFX7: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
439    ; GFX7: [[COPY1:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
440    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[COPY1]]
441    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
442    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
443    ; GFX8-LABEL: name: test_icmp_p0
444    ; GFX8: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
445    ; GFX8: [[COPY1:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
446    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[COPY1]]
447    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
448    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
449    ; GFX9-LABEL: name: test_icmp_p0
450    ; GFX9: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
451    ; GFX9: [[COPY1:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
452    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p0), [[COPY1]]
453    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
454    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
455    %0:_(p0) = COPY $vgpr0_vgpr1
456    %1:_(p0) = COPY $vgpr0_vgpr1
457    %2:_(s1) = G_ICMP intpred(ne), %0, %1
458    %3:_(s32) = G_SEXT %2
459    $vgpr0 = COPY %3
460...
461
462---
463name: test_icmp_p1
464body: |
465  bb.0:
466    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
467    ; GFX7-LABEL: name: test_icmp_p1
468    ; GFX7: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
469    ; GFX7: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
470    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p1), [[COPY1]]
471    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
472    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
473    ; GFX8-LABEL: name: test_icmp_p1
474    ; GFX8: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
475    ; GFX8: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
476    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p1), [[COPY1]]
477    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
478    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
479    ; GFX9-LABEL: name: test_icmp_p1
480    ; GFX9: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
481    ; GFX9: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
482    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p1), [[COPY1]]
483    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
484    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
485    %0:_(p1) = COPY $vgpr0_vgpr1
486    %1:_(p1) = COPY $vgpr0_vgpr1
487    %2:_(s1) = G_ICMP intpred(ne), %0, %1
488    %3:_(s32) = G_SEXT %2
489    $vgpr0 = COPY %3
490...
491
492---
493name: test_icmp_p2
494body: |
495  bb.0:
496    liveins: $vgpr0, $vgpr1
497
498    ; GFX7-LABEL: name: test_icmp_p2
499    ; GFX7: [[COPY:%[0-9]+]]:_(p2) = COPY $vgpr0
500    ; GFX7: [[COPY1:%[0-9]+]]:_(p2) = COPY $vgpr1
501    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p2), [[COPY1]]
502    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
503    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
504    ; GFX8-LABEL: name: test_icmp_p2
505    ; GFX8: [[COPY:%[0-9]+]]:_(p2) = COPY $vgpr0
506    ; GFX8: [[COPY1:%[0-9]+]]:_(p2) = COPY $vgpr1
507    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p2), [[COPY1]]
508    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
509    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
510    ; GFX9-LABEL: name: test_icmp_p2
511    ; GFX9: [[COPY:%[0-9]+]]:_(p2) = COPY $vgpr0
512    ; GFX9: [[COPY1:%[0-9]+]]:_(p2) = COPY $vgpr1
513    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p2), [[COPY1]]
514    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
515    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
516    %0:_(p2) = COPY $vgpr0
517    %1:_(p2) = COPY $vgpr1
518    %2:_(s1) = G_ICMP intpred(ne), %0, %1
519    %3:_(s32) = G_SEXT %2
520    $vgpr0 = COPY %3
521...
522
523---
524name: test_icmp_p3
525body: |
526  bb.0:
527    liveins: $vgpr0, $vgpr1
528
529    ; GFX7-LABEL: name: test_icmp_p3
530    ; GFX7: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
531    ; GFX7: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr1
532    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p3), [[COPY1]]
533    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
534    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
535    ; GFX8-LABEL: name: test_icmp_p3
536    ; GFX8: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
537    ; GFX8: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr1
538    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p3), [[COPY1]]
539    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
540    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
541    ; GFX9-LABEL: name: test_icmp_p3
542    ; GFX9: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
543    ; GFX9: [[COPY1:%[0-9]+]]:_(p3) = COPY $vgpr1
544    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p3), [[COPY1]]
545    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
546    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
547    %0:_(p3) = COPY $vgpr0
548    %1:_(p3) = COPY $vgpr1
549    %2:_(s1) = G_ICMP intpred(ne), %0, %1
550    %3:_(s32) = G_SEXT %2
551    $vgpr0 = COPY %3
552...
553
554---
555name: test_icmp_p4
556body: |
557  bb.0:
558    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
559    ; GFX7-LABEL: name: test_icmp_p4
560    ; GFX7: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
561    ; GFX7: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
562    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p4), [[COPY1]]
563    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
564    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
565    ; GFX8-LABEL: name: test_icmp_p4
566    ; GFX8: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
567    ; GFX8: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
568    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p4), [[COPY1]]
569    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
570    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
571    ; GFX9-LABEL: name: test_icmp_p4
572    ; GFX9: [[COPY:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
573    ; GFX9: [[COPY1:%[0-9]+]]:_(p4) = COPY $vgpr0_vgpr1
574    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p4), [[COPY1]]
575    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
576    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
577    %0:_(p4) = COPY $vgpr0_vgpr1
578    %1:_(p4) = COPY $vgpr0_vgpr1
579    %2:_(s1) = G_ICMP intpred(ne), %0, %1
580    %3:_(s32) = G_SEXT %2
581    $vgpr0 = COPY %3
582...
583
584---
585name: test_icmp_p5
586body: |
587  bb.0:
588    liveins: $vgpr0, $vgpr1
589
590    ; GFX7-LABEL: name: test_icmp_p5
591    ; GFX7: [[COPY:%[0-9]+]]:_(p5) = COPY $vgpr0
592    ; GFX7: [[COPY1:%[0-9]+]]:_(p5) = COPY $vgpr1
593    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p5), [[COPY1]]
594    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
595    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
596    ; GFX8-LABEL: name: test_icmp_p5
597    ; GFX8: [[COPY:%[0-9]+]]:_(p5) = COPY $vgpr0
598    ; GFX8: [[COPY1:%[0-9]+]]:_(p5) = COPY $vgpr1
599    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p5), [[COPY1]]
600    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
601    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
602    ; GFX9-LABEL: name: test_icmp_p5
603    ; GFX9: [[COPY:%[0-9]+]]:_(p5) = COPY $vgpr0
604    ; GFX9: [[COPY1:%[0-9]+]]:_(p5) = COPY $vgpr1
605    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p5), [[COPY1]]
606    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
607    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
608    %0:_(p5) = COPY $vgpr0
609    %1:_(p5) = COPY $vgpr1
610    %2:_(s1) = G_ICMP intpred(ne), %0, %1
611    %3:_(s32) = G_SEXT %2
612    $vgpr0 = COPY %3
613...
614
615---
616name: test_icmp_p999
617body: |
618  bb.0:
619    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
620    ; GFX7-LABEL: name: test_icmp_p999
621    ; GFX7: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
622    ; GFX7: [[COPY1:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
623    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p999), [[COPY1]]
624    ; GFX7: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
625    ; GFX7: $vgpr0 = COPY [[SEXT]](s32)
626    ; GFX8-LABEL: name: test_icmp_p999
627    ; GFX8: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
628    ; GFX8: [[COPY1:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
629    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p999), [[COPY1]]
630    ; GFX8: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
631    ; GFX8: $vgpr0 = COPY [[SEXT]](s32)
632    ; GFX9-LABEL: name: test_icmp_p999
633    ; GFX9: [[COPY:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
634    ; GFX9: [[COPY1:%[0-9]+]]:_(p999) = COPY $vgpr0_vgpr1
635    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[COPY]](p999), [[COPY1]]
636    ; GFX9: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[ICMP]](s1)
637    ; GFX9: $vgpr0 = COPY [[SEXT]](s32)
638    %0:_(p999) = COPY $vgpr0_vgpr1
639    %1:_(p999) = COPY $vgpr0_vgpr1
640    %2:_(s1) = G_ICMP intpred(ne), %0, %1
641    %3:_(s32) = G_SEXT %2
642    $vgpr0 = COPY %3
643...
644
645---
646name: test_icmp_v2p3
647body: |
648  bb.0:
649    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
650    ; GFX7-LABEL: name: test_icmp_v2p3
651    ; GFX7: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
652    ; GFX7: [[COPY1:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
653    ; GFX7: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY]](<2 x p3>)
654    ; GFX7: [[UV2:%[0-9]+]]:_(p3), [[UV3:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY1]](<2 x p3>)
655    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p3), [[UV2]]
656    ; GFX7: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p3), [[UV3]]
657    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
658    ; GFX7: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
659    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
660    ; GFX7: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 1
661    ; GFX7: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
662    ; GFX7: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 1
663    ; GFX7: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG]](s32), [[SEXT_INREG1]](s32)
664    ; GFX7: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
665    ; GFX8-LABEL: name: test_icmp_v2p3
666    ; GFX8: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
667    ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
668    ; GFX8: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY]](<2 x p3>)
669    ; GFX8: [[UV2:%[0-9]+]]:_(p3), [[UV3:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY1]](<2 x p3>)
670    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p3), [[UV2]]
671    ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p3), [[UV3]]
672    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
673    ; GFX8: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
674    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
675    ; GFX8: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 1
676    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
677    ; GFX8: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 1
678    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG]](s32), [[SEXT_INREG1]](s32)
679    ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
680    ; GFX9-LABEL: name: test_icmp_v2p3
681    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
682    ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
683    ; GFX9: [[UV:%[0-9]+]]:_(p3), [[UV1:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY]](<2 x p3>)
684    ; GFX9: [[UV2:%[0-9]+]]:_(p3), [[UV3:%[0-9]+]]:_(p3) = G_UNMERGE_VALUES [[COPY1]](<2 x p3>)
685    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p3), [[UV2]]
686    ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p3), [[UV3]]
687    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
688    ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ANYEXT]], 1
689    ; GFX9: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
690    ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ANYEXT1]], 1
691    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG]](s32), [[SEXT_INREG1]](s32)
692    ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
693    %0:_(<2 x p3>) = COPY $vgpr0_vgpr1
694    %1:_(<2 x p3>) = COPY $vgpr0_vgpr1
695    %2:_(<2 x s1>) = G_ICMP intpred(ne), %0, %1
696    %3:_(<2 x s32>) = G_SEXT %2
697    $vgpr0_vgpr1 = COPY %3
698...
699
700---
701name: test_icmp_v2p999
702body: |
703  bb.0:
704    liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7
705    ; GFX7-LABEL: name: test_icmp_v2p999
706    ; GFX7: [[COPY:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
707    ; GFX7: [[COPY1:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
708    ; GFX7: [[UV:%[0-9]+]]:_(p999), [[UV1:%[0-9]+]]:_(p999) = G_UNMERGE_VALUES [[COPY]](<2 x p999>)
709    ; GFX7: [[UV2:%[0-9]+]]:_(p999), [[UV3:%[0-9]+]]:_(p999) = G_UNMERGE_VALUES [[COPY1]](<2 x p999>)
710    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p999), [[UV2]]
711    ; GFX7: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p999), [[UV3]]
712    ; GFX7: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
713    ; GFX7: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
714    ; GFX7: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
715    ; GFX7: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 1
716    ; GFX7: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
717    ; GFX7: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 1
718    ; GFX7: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG]](s32), [[SEXT_INREG1]](s32)
719    ; GFX7: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
720    ; GFX8-LABEL: name: test_icmp_v2p999
721    ; GFX8: [[COPY:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
722    ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
723    ; GFX8: [[UV:%[0-9]+]]:_(p999), [[UV1:%[0-9]+]]:_(p999) = G_UNMERGE_VALUES [[COPY]](<2 x p999>)
724    ; GFX8: [[UV2:%[0-9]+]]:_(p999), [[UV3:%[0-9]+]]:_(p999) = G_UNMERGE_VALUES [[COPY1]](<2 x p999>)
725    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p999), [[UV2]]
726    ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p999), [[UV3]]
727    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
728    ; GFX8: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
729    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
730    ; GFX8: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 1
731    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
732    ; GFX8: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 1
733    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG]](s32), [[SEXT_INREG1]](s32)
734    ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
735    ; GFX9-LABEL: name: test_icmp_v2p999
736    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
737    ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x p999>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
738    ; GFX9: [[UV:%[0-9]+]]:_(p999), [[UV1:%[0-9]+]]:_(p999) = G_UNMERGE_VALUES [[COPY]](<2 x p999>)
739    ; GFX9: [[UV2:%[0-9]+]]:_(p999), [[UV3:%[0-9]+]]:_(p999) = G_UNMERGE_VALUES [[COPY1]](<2 x p999>)
740    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV]](p999), [[UV2]]
741    ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UV1]](p999), [[UV3]]
742    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP]](s1)
743    ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ANYEXT]], 1
744    ; GFX9: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ICMP1]](s1)
745    ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ANYEXT1]], 1
746    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG]](s32), [[SEXT_INREG1]](s32)
747    ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
748    %0:_(<2 x p999>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
749    %1:_(<2 x p999>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7
750    %2:_(<2 x s1>) = G_ICMP intpred(ne), %0, %1
751    %3:_(<2 x s32>) = G_SEXT %2
752    $vgpr0_vgpr1 = COPY %3
753...
754
755---
756name: test_icmp_v2s16
757body: |
758  bb.0:
759    liveins: $vgpr0, $vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
760    ; GFX7-LABEL: name: test_icmp_v2s16
761    ; GFX7: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
762    ; GFX7: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
763    ; GFX7: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
764    ; GFX7: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
765    ; GFX7: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
766    ; GFX7: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
767    ; GFX7: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
768    ; GFX7: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[COPY1]](<2 x s16>)
769    ; GFX7: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
770    ; GFX7: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
771    ; GFX7: [[COPY4:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
772    ; GFX7: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C1]]
773    ; GFX7: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
774    ; GFX7: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C1]]
775    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s32), [[AND1]]
776    ; GFX7: [[COPY6:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
777    ; GFX7: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C1]]
778    ; GFX7: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
779    ; GFX7: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C1]]
780    ; GFX7: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND2]](s32), [[AND3]]
781    ; GFX7: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<2 x s32>)
782    ; GFX7: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY3]](<2 x s32>)
783    ; GFX7: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[UV]], [[UV2]]
784    ; GFX7: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[UV1]], [[UV3]]
785    ; GFX7: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SELECT]](s32), [[SELECT1]](s32)
786    ; GFX7: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
787    ; GFX8-LABEL: name: test_icmp_v2s16
788    ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
789    ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
790    ; GFX8: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
791    ; GFX8: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
792    ; GFX8: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
793    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32)
794    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
795    ; GFX8: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
796    ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
797    ; GFX8: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[COPY1]](<2 x s16>)
798    ; GFX8: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST1]](s32)
799    ; GFX8: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
800    ; GFX8: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
801    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[TRUNC]](s16), [[TRUNC2]]
802    ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[TRUNC1]](s16), [[TRUNC3]]
803    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<2 x s32>)
804    ; GFX8: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY3]](<2 x s32>)
805    ; GFX8: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[UV]], [[UV2]]
806    ; GFX8: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[UV1]], [[UV3]]
807    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SELECT]](s32), [[SELECT1]](s32)
808    ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
809    ; GFX9-LABEL: name: test_icmp_v2s16
810    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
811    ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
812    ; GFX9: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
813    ; GFX9: [[COPY3:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
814    ; GFX9: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
815    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32)
816    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
817    ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
818    ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
819    ; GFX9: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[COPY1]](<2 x s16>)
820    ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST1]](s32)
821    ; GFX9: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
822    ; GFX9: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
823    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[TRUNC]](s16), [[TRUNC2]]
824    ; GFX9: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[TRUNC1]](s16), [[TRUNC3]]
825    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<2 x s32>)
826    ; GFX9: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY3]](<2 x s32>)
827    ; GFX9: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[UV]], [[UV2]]
828    ; GFX9: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[UV1]], [[UV3]]
829    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SELECT]](s32), [[SELECT1]](s32)
830    ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
831    %0:_(<2 x s16>) = COPY $vgpr0
832    %1:_(<2 x s16>) = COPY $vgpr1
833    %2:_(<2 x s32>) = COPY $vgpr2_vgpr3
834    %3:_(<2 x s32>) = COPY $vgpr4_vgpr5
835    %4:_(<2 x s1>) = G_ICMP intpred(ne), %0, %1
836    %5:_(<2 x s32>) = G_SELECT %4, %2, %3
837    $vgpr0_vgpr1 = COPY %5
838...
839
840---
841name: test_icmp_s33
842body: |
843  bb.0:
844    liveins: $vgpr0_vgpr1
845    ; GFX7-LABEL: name: test_icmp_s33
846    ; GFX7: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
847    ; GFX7: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
848    ; GFX7: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8589934591
849    ; GFX7: [[COPY1:%[0-9]+]]:_(s64) = COPY [[C]](s64)
850    ; GFX7: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C1]]
851    ; GFX7: [[COPY2:%[0-9]+]]:_(s64) = COPY [[C]](s64)
852    ; GFX7: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C1]]
853    ; GFX7: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s64), [[AND1]]
854    ; GFX7: S_ENDPGM 0, implicit [[ICMP]](s1)
855    ; GFX8-LABEL: name: test_icmp_s33
856    ; GFX8: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
857    ; GFX8: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
858    ; GFX8: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8589934591
859    ; GFX8: [[COPY1:%[0-9]+]]:_(s64) = COPY [[C]](s64)
860    ; GFX8: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C1]]
861    ; GFX8: [[COPY2:%[0-9]+]]:_(s64) = COPY [[C]](s64)
862    ; GFX8: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C1]]
863    ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s64), [[AND1]]
864    ; GFX8: S_ENDPGM 0, implicit [[ICMP]](s1)
865    ; GFX9-LABEL: name: test_icmp_s33
866    ; GFX9: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
867    ; GFX9: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
868    ; GFX9: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8589934591
869    ; GFX9: [[COPY1:%[0-9]+]]:_(s64) = COPY [[C]](s64)
870    ; GFX9: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C1]]
871    ; GFX9: [[COPY2:%[0-9]+]]:_(s64) = COPY [[C]](s64)
872    ; GFX9: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C1]]
873    ; GFX9: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[AND]](s64), [[AND1]]
874    ; GFX9: S_ENDPGM 0, implicit [[ICMP]](s1)
875    %0:_(s64) = COPY $vgpr0_vgpr1
876    %1:_(s33) = G_TRUNC %0
877    %2:_(s33) = G_CONSTANT i33 0
878    %3:_(s1) = G_ICMP intpred(ne), %2, %2
879    S_ENDPGM 0, implicit %3
880...
881