• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -O0 -run-pass=legalizer -o - %s | FileCheck -check-prefix=GFX6 %s
3# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -o - %s | FileCheck -check-prefix=GFX8 %s
4# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -O0 -run-pass=legalizer -o - %s | FileCheck -check-prefix=GFX9 %s
5
6---
7name: test_add_s32
8body: |
9  bb.0:
10    liveins: $vgpr0, $vgpr1
11
12    ; GFX6-LABEL: name: test_add_s32
13    ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14    ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
15    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
16    ; GFX6: $vgpr0 = COPY [[ADD]](s32)
17    ; GFX8-LABEL: name: test_add_s32
18    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
19    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
20    ; GFX8: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
21    ; GFX8: $vgpr0 = COPY [[ADD]](s32)
22    ; GFX9-LABEL: name: test_add_s32
23    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
24    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
25    ; GFX9: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
26    ; GFX9: $vgpr0 = COPY [[ADD]](s32)
27    %0:_(s32) = COPY $vgpr0
28    %1:_(s32) = COPY $vgpr1
29    %2:_(s32) = G_ADD %0, %1
30    $vgpr0 = COPY %2
31...
32
33---
34name: test_add_v2s32
35body: |
36  bb.0:
37    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
38
39    ; GFX6-LABEL: name: test_add_v2s32
40    ; GFX6: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
41    ; GFX6: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
42    ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
43    ; GFX6: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
44    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[UV]], [[UV2]]
45    ; GFX6: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[UV1]], [[UV3]]
46    ; GFX6: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ADD]](s32), [[ADD1]](s32)
47    ; GFX6: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
48    ; GFX8-LABEL: name: test_add_v2s32
49    ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
50    ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
51    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
52    ; GFX8: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
53    ; GFX8: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[UV]], [[UV2]]
54    ; GFX8: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[UV1]], [[UV3]]
55    ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ADD]](s32), [[ADD1]](s32)
56    ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
57    ; GFX9-LABEL: name: test_add_v2s32
58    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
59    ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
60    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
61    ; GFX9: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
62    ; GFX9: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[UV]], [[UV2]]
63    ; GFX9: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[UV1]], [[UV3]]
64    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[ADD]](s32), [[ADD1]](s32)
65    ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
66    %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
67    %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
68    %2:_(<2 x s32>) = G_ADD %0, %1
69    $vgpr0_vgpr1 = COPY %2
70...
71
72---
73name: test_add_s16
74body: |
75  bb.0:
76    liveins: $vgpr0, $vgpr1
77
78    ; GFX6-LABEL: name: test_add_s16
79    ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
80    ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
81    ; GFX6: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
82    ; GFX6: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
83    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
84    ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
85    ; GFX6: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
86    ; GFX6: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
87    ; GFX6: $vgpr0 = COPY [[AND]](s32)
88    ; GFX8-LABEL: name: test_add_s16
89    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
90    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
91    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
92    ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
93    ; GFX8: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC1]]
94    ; GFX8: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ADD]](s16)
95    ; GFX8: $vgpr0 = COPY [[ZEXT]](s32)
96    ; GFX9-LABEL: name: test_add_s16
97    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
98    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
99    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
100    ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
101    ; GFX9: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC1]]
102    ; GFX9: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ADD]](s16)
103    ; GFX9: $vgpr0 = COPY [[ZEXT]](s32)
104    %0:_(s32) = COPY $vgpr0
105    %1:_(s32) = COPY $vgpr1
106    %2:_(s16) = G_TRUNC %0
107    %3:_(s16) = G_TRUNC %1
108    %4:_(s16) = G_ADD %2, %3
109    %5:_(s32) = G_ZEXT %4
110    $vgpr0 = COPY %5
111...
112
113---
114name: test_add_v2s16
115body: |
116  bb.0:
117    liveins: $vgpr0, $vgpr1
118
119    ; GFX6-LABEL: name: test_add_v2s16
120    ; GFX6: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
121    ; GFX6: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
122    ; GFX6: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
123    ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
124    ; GFX6: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
125    ; GFX6: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[COPY1]](<2 x s16>)
126    ; GFX6: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
127    ; GFX6: [[COPY2:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
128    ; GFX6: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
129    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
130    ; GFX6: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
131    ; GFX6: [[COPY5:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
132    ; GFX6: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY4]], [[COPY5]]
133    ; GFX6: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
134    ; GFX6: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
135    ; GFX6: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C1]]
136    ; GFX6: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ADD1]](s32)
137    ; GFX6: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C1]]
138    ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
139    ; GFX6: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
140    ; GFX6: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
141    ; GFX6: $vgpr0 = COPY [[BITCAST2]](<2 x s16>)
142    ; GFX8-LABEL: name: test_add_v2s16
143    ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
144    ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
145    ; GFX8: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
146    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32)
147    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
148    ; GFX8: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
149    ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
150    ; GFX8: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[COPY1]](<2 x s16>)
151    ; GFX8: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST1]](s32)
152    ; GFX8: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
153    ; GFX8: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
154    ; GFX8: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC2]]
155    ; GFX8: [[ADD1:%[0-9]+]]:_(s16) = G_ADD [[TRUNC1]], [[TRUNC3]]
156    ; GFX8: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ADD]](s16)
157    ; GFX8: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[ADD1]](s16)
158    ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C]](s32)
159    ; GFX8: [[OR:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL]]
160    ; GFX8: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
161    ; GFX8: $vgpr0 = COPY [[BITCAST2]](<2 x s16>)
162    ; GFX9-LABEL: name: test_add_v2s16
163    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
164    ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr1
165    ; GFX9: [[ADD:%[0-9]+]]:_(<2 x s16>) = G_ADD [[COPY]], [[COPY1]]
166    ; GFX9: $vgpr0 = COPY [[ADD]](<2 x s16>)
167    %0:_(<2 x s16>) = COPY $vgpr0
168    %1:_(<2 x s16>) = COPY $vgpr1
169    %2:_(<2 x s16>) = G_ADD %0, %1
170    $vgpr0 = COPY %2
171...
172
173---
174name: test_add_v3s16
175body: |
176  bb.0:
177    liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4, $vgpr5
178    ; GFX6-LABEL: name: test_add_v3s16
179    ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
180    ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
181    ; GFX6: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
182    ; GFX6: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
183    ; GFX6: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
184    ; GFX6: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
185    ; GFX6: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
186    ; GFX6: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
187    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY6]], [[COPY7]]
188    ; GFX6: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32)
189    ; GFX6: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
190    ; GFX6: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
191    ; GFX6: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY8]], [[COPY9]]
192    ; GFX6: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ADD1]](s32)
193    ; GFX6: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
194    ; GFX6: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
195    ; GFX6: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[COPY10]], [[COPY11]]
196    ; GFX6: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[ADD2]](s32)
197    ; GFX6: S_ENDPGM 0, implicit [[TRUNC]](s16), implicit [[TRUNC1]](s16), implicit [[TRUNC2]](s16)
198    ; GFX8-LABEL: name: test_add_v3s16
199    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
200    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
201    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
202    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
203    ; GFX8: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
204    ; GFX8: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
205    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
206    ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
207    ; GFX8: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32)
208    ; GFX8: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[COPY3]](s32)
209    ; GFX8: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[COPY4]](s32)
210    ; GFX8: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[COPY5]](s32)
211    ; GFX8: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC3]]
212    ; GFX8: [[ADD1:%[0-9]+]]:_(s16) = G_ADD [[TRUNC1]], [[TRUNC4]]
213    ; GFX8: [[ADD2:%[0-9]+]]:_(s16) = G_ADD [[TRUNC2]], [[TRUNC5]]
214    ; GFX8: S_ENDPGM 0, implicit [[ADD]](s16), implicit [[ADD1]](s16), implicit [[ADD2]](s16)
215    ; GFX9-LABEL: name: test_add_v3s16
216    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
217    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
218    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
219    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3
220    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY $vgpr4
221    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
222    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
223    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
224    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY6]](s32), [[COPY7]](s32)
225    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
226    ; GFX9: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
227    ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[DEF]](s32)
228    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY8]](s32), [[COPY9]](s32)
229    ; GFX9: [[DEF1:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
230    ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
231    ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
232    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY10]](s32), [[COPY11]](s32)
233    ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
234    ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY12]](s32), [[DEF]](s32)
235    ; GFX9: [[ADD:%[0-9]+]]:_(<2 x s16>) = G_ADD [[BUILD_VECTOR_TRUNC]], [[BUILD_VECTOR_TRUNC2]]
236    ; GFX9: [[ADD1:%[0-9]+]]:_(<2 x s16>) = G_ADD [[BUILD_VECTOR_TRUNC1]], [[BUILD_VECTOR_TRUNC3]]
237    ; GFX9: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[ADD]](<2 x s16>)
238    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32)
239    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
240    ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
241    ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
242    ; GFX9: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[ADD1]](<2 x s16>)
243    ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST1]](s32)
244    ; GFX9: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
245    ; GFX9: S_ENDPGM 0, implicit [[TRUNC]](s16), implicit [[TRUNC1]](s16), implicit [[TRUNC2]](s16)
246    %0:_(s32) = COPY $vgpr0
247    %1:_(s32) = COPY $vgpr1
248    %2:_(s32) = COPY $vgpr2
249    %3:_(s32) = COPY $vgpr3
250    %4:_(s32) = COPY $vgpr4
251    %5:_(s32) = COPY $vgpr5
252    %6:_(s16) = G_TRUNC %0
253    %7:_(s16) = G_TRUNC %1
254    %8:_(s16) = G_TRUNC %2
255    %9:_(s16) = G_TRUNC %3
256    %10:_(s16) = G_TRUNC %4
257    %11:_(s16) = G_TRUNC %5
258    %12:_(<3 x s16>) = G_BUILD_VECTOR %6, %7, %8
259    %13:_(<3 x s16>) = G_BUILD_VECTOR %9, %10, %11
260    %14:_(<3 x s16>) = G_ADD %12, %13
261    %15:_(s16), %16:_(s16), %17:_(s16) = G_UNMERGE_VALUES %14
262    S_ENDPGM 0, implicit %15, implicit %16, implicit %17
263...
264
265---
266name: test_add_v4s16
267body: |
268  bb.0:
269    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
270
271    ; GFX6-LABEL: name: test_add_v4s16
272    ; GFX6: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
273    ; GFX6: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr2_vgpr3
274    ; GFX6: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
275    ; GFX6: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
276    ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
277    ; GFX6: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
278    ; GFX6: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
279    ; GFX6: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
280    ; GFX6: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY1]](<4 x s16>)
281    ; GFX6: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[UV2]](<2 x s16>)
282    ; GFX6: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST2]], [[C]](s32)
283    ; GFX6: [[BITCAST3:%[0-9]+]]:_(s32) = G_BITCAST [[UV3]](<2 x s16>)
284    ; GFX6: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST3]], [[C]](s32)
285    ; GFX6: [[COPY2:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
286    ; GFX6: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST2]](s32)
287    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
288    ; GFX6: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
289    ; GFX6: [[COPY5:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
290    ; GFX6: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY4]], [[COPY5]]
291    ; GFX6: [[COPY6:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
292    ; GFX6: [[COPY7:%[0-9]+]]:_(s32) = COPY [[BITCAST3]](s32)
293    ; GFX6: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[COPY6]], [[COPY7]]
294    ; GFX6: [[COPY8:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
295    ; GFX6: [[COPY9:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32)
296    ; GFX6: [[ADD3:%[0-9]+]]:_(s32) = G_ADD [[COPY8]], [[COPY9]]
297    ; GFX6: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
298    ; GFX6: [[COPY10:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
299    ; GFX6: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C1]]
300    ; GFX6: [[COPY11:%[0-9]+]]:_(s32) = COPY [[ADD1]](s32)
301    ; GFX6: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY11]], [[C1]]
302    ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
303    ; GFX6: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
304    ; GFX6: [[BITCAST4:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
305    ; GFX6: [[COPY12:%[0-9]+]]:_(s32) = COPY [[ADD2]](s32)
306    ; GFX6: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C1]]
307    ; GFX6: [[COPY13:%[0-9]+]]:_(s32) = COPY [[ADD3]](s32)
308    ; GFX6: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C1]]
309    ; GFX6: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C]](s32)
310    ; GFX6: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
311    ; GFX6: [[BITCAST5:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
312    ; GFX6: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[BITCAST4]](<2 x s16>), [[BITCAST5]](<2 x s16>)
313    ; GFX6: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>)
314    ; GFX8-LABEL: name: test_add_v4s16
315    ; GFX8: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
316    ; GFX8: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr2_vgpr3
317    ; GFX8: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
318    ; GFX8: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
319    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32)
320    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
321    ; GFX8: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
322    ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
323    ; GFX8: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
324    ; GFX8: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST1]](s32)
325    ; GFX8: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
326    ; GFX8: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32)
327    ; GFX8: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY1]](<4 x s16>)
328    ; GFX8: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[UV2]](<2 x s16>)
329    ; GFX8: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST2]](s32)
330    ; GFX8: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST2]], [[C]](s32)
331    ; GFX8: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR2]](s32)
332    ; GFX8: [[BITCAST3:%[0-9]+]]:_(s32) = G_BITCAST [[UV3]](<2 x s16>)
333    ; GFX8: [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST3]](s32)
334    ; GFX8: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST3]], [[C]](s32)
335    ; GFX8: [[TRUNC7:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR3]](s32)
336    ; GFX8: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC4]]
337    ; GFX8: [[ADD1:%[0-9]+]]:_(s16) = G_ADD [[TRUNC1]], [[TRUNC5]]
338    ; GFX8: [[ADD2:%[0-9]+]]:_(s16) = G_ADD [[TRUNC2]], [[TRUNC6]]
339    ; GFX8: [[ADD3:%[0-9]+]]:_(s16) = G_ADD [[TRUNC3]], [[TRUNC7]]
340    ; GFX8: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ADD]](s16)
341    ; GFX8: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[ADD1]](s16)
342    ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C]](s32)
343    ; GFX8: [[OR:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL]]
344    ; GFX8: [[BITCAST4:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
345    ; GFX8: [[ZEXT2:%[0-9]+]]:_(s32) = G_ZEXT [[ADD2]](s16)
346    ; GFX8: [[ZEXT3:%[0-9]+]]:_(s32) = G_ZEXT [[ADD3]](s16)
347    ; GFX8: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[ZEXT3]], [[C]](s32)
348    ; GFX8: [[OR1:%[0-9]+]]:_(s32) = G_OR [[ZEXT2]], [[SHL1]]
349    ; GFX8: [[BITCAST5:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
350    ; GFX8: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[BITCAST4]](<2 x s16>), [[BITCAST5]](<2 x s16>)
351    ; GFX8: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>)
352    ; GFX9-LABEL: name: test_add_v4s16
353    ; GFX9: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
354    ; GFX9: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr2_vgpr3
355    ; GFX9: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
356    ; GFX9: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY1]](<4 x s16>)
357    ; GFX9: [[ADD:%[0-9]+]]:_(<2 x s16>) = G_ADD [[UV]], [[UV2]]
358    ; GFX9: [[ADD1:%[0-9]+]]:_(<2 x s16>) = G_ADD [[UV1]], [[UV3]]
359    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[ADD]](<2 x s16>), [[ADD1]](<2 x s16>)
360    ; GFX9: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>)
361    %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
362    %1:_(<4 x s16>) = COPY $vgpr2_vgpr3
363    %2:_(<4 x s16>) = G_ADD %0, %1
364    $vgpr0_vgpr1 = COPY %2
365...
366
367---
368name: test_add_s64
369body: |
370  bb.0:
371    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
372
373    ; GFX6-LABEL: name: test_add_s64
374    ; GFX6: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
375    ; GFX6: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
376    ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
377    ; GFX6: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s64)
378    ; GFX6: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV2]]
379    ; GFX6: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV3]], [[UADDO1]]
380    ; GFX6: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32)
381    ; GFX6: $vgpr0_vgpr1 = COPY [[MV]](s64)
382    ; GFX8-LABEL: name: test_add_s64
383    ; GFX8: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
384    ; GFX8: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
385    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
386    ; GFX8: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s64)
387    ; GFX8: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV2]]
388    ; GFX8: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV3]], [[UADDO1]]
389    ; GFX8: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32)
390    ; GFX8: $vgpr0_vgpr1 = COPY [[MV]](s64)
391    ; GFX9-LABEL: name: test_add_s64
392    ; GFX9: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
393    ; GFX9: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
394    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
395    ; GFX9: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s64)
396    ; GFX9: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV2]]
397    ; GFX9: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV3]], [[UADDO1]]
398    ; GFX9: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32)
399    ; GFX9: $vgpr0_vgpr1 = COPY [[MV]](s64)
400    %0:_(s64) = COPY $vgpr0_vgpr1
401    %1:_(s64) = COPY $vgpr2_vgpr3
402    %2:_(s64) = G_ADD %0, %1
403    $vgpr0_vgpr1 = COPY %2
404...
405
406---
407name: test_add_s7
408body: |
409  bb.0:
410    liveins: $vgpr0, $vgpr1
411
412    ; GFX6-LABEL: name: test_add_s7
413    ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
414    ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
415    ; GFX6: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
416    ; GFX6: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
417    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
418    ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
419    ; GFX6: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
420    ; GFX6: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
421    ; GFX6: $vgpr0 = COPY [[AND]](s32)
422    ; GFX8-LABEL: name: test_add_s7
423    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
424    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
425    ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
426    ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
427    ; GFX8: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC1]]
428    ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
429    ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ADD]](s16)
430    ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C]]
431    ; GFX8: $vgpr0 = COPY [[AND]](s32)
432    ; GFX9-LABEL: name: test_add_s7
433    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
434    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
435    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
436    ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
437    ; GFX9: [[ADD:%[0-9]+]]:_(s16) = G_ADD [[TRUNC]], [[TRUNC1]]
438    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
439    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ADD]](s16)
440    ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C]]
441    ; GFX9: $vgpr0 = COPY [[AND]](s32)
442    %0:_(s32) = COPY $vgpr0
443    %1:_(s32) = COPY $vgpr1
444    %2:_(s7) = G_TRUNC %0
445    %3:_(s7) = G_TRUNC %1
446    %4:_(s7) = G_ADD %2, %3
447    %5:_(s32) = G_ZEXT %4
448    $vgpr0 = COPY %5
449...
450
451---
452name: test_add_s24
453body: |
454  bb.0:
455    liveins: $vgpr0, $vgpr1
456
457    ; GFX6-LABEL: name: test_add_s24
458    ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
459    ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
460    ; GFX6: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
461    ; GFX6: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
462    ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
463    ; GFX6: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
464    ; GFX6: $vgpr0 = COPY [[COPY4]](s32)
465    ; GFX8-LABEL: name: test_add_s24
466    ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
467    ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
468    ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
469    ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
470    ; GFX8: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
471    ; GFX8: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
472    ; GFX8: $vgpr0 = COPY [[COPY4]](s32)
473    ; GFX9-LABEL: name: test_add_s24
474    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
475    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
476    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
477    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
478    ; GFX9: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY2]], [[COPY3]]
479    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
480    ; GFX9: $vgpr0 = COPY [[COPY4]](s32)
481    %0:_(s32) = COPY $vgpr0
482    %1:_(s32) = COPY $vgpr1
483    %2:_(s24) = G_TRUNC %0
484    %3:_(s24) = G_TRUNC %1
485    %4:_(s24) = G_ADD %2, %3
486    %5:_(s32) = G_ANYEXT %4
487    $vgpr0 = COPY %5
488...
489
490# FIXME
491# ---
492# name: test_add_s33
493# body: |
494#   bb.0:
495#     liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
496
497#     %0:_(s64) = COPY $vgpr0_vgpr1
498#     %1:_(s64) = COPY $vgpr2_vgpr3
499#     %2:_(s33) = G_TRUNC %0
500#     %3:_(s33) = G_TRUNC %1
501#     %4:_(s33) = G_ADD %2, %3
502#     %5:_(s64) = G_ANYEXT %4
503#     $vgpr0_vgpr1 = COPY %5
504# ...
505
506---
507name: test_add_s96
508body: |
509  bb.0:
510    liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4_vgpr5
511
512    ; GFX6-LABEL: name: test_add_s96
513    ; GFX6: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
514    ; GFX6: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5
515    ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s96)
516    ; GFX6: [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s96)
517    ; GFX6: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV3]]
518    ; GFX6: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV4]], [[UADDO1]]
519    ; GFX6: [[UADDE2:%[0-9]+]]:_(s32), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[UV2]], [[UV5]], [[UADDE1]]
520    ; GFX6: [[MV:%[0-9]+]]:_(s96) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32), [[UADDE2]](s32)
521    ; GFX6: $vgpr0_vgpr1_vgpr2 = COPY [[MV]](s96)
522    ; GFX8-LABEL: name: test_add_s96
523    ; GFX8: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
524    ; GFX8: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5
525    ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s96)
526    ; GFX8: [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s96)
527    ; GFX8: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV3]]
528    ; GFX8: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV4]], [[UADDO1]]
529    ; GFX8: [[UADDE2:%[0-9]+]]:_(s32), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[UV2]], [[UV5]], [[UADDE1]]
530    ; GFX8: [[MV:%[0-9]+]]:_(s96) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32), [[UADDE2]](s32)
531    ; GFX8: $vgpr0_vgpr1_vgpr2 = COPY [[MV]](s96)
532    ; GFX9-LABEL: name: test_add_s96
533    ; GFX9: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2
534    ; GFX9: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5
535    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s96)
536    ; GFX9: [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s96)
537    ; GFX9: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV3]]
538    ; GFX9: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV4]], [[UADDO1]]
539    ; GFX9: [[UADDE2:%[0-9]+]]:_(s32), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[UV2]], [[UV5]], [[UADDE1]]
540    ; GFX9: [[MV:%[0-9]+]]:_(s96) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32), [[UADDE2]](s32)
541    ; GFX9: $vgpr0_vgpr1_vgpr2 = COPY [[MV]](s96)
542    %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2
543    %1:_(s96) = COPY $vgpr3_vgpr4_vgpr5
544    %2:_(s96) = G_ADD %0, %1
545    $vgpr0_vgpr1_vgpr2 = COPY %2
546...
547