xref: /llvm-project/llvm/test/CodeGen/AMDGPU/twoaddr-wmma.mir (revision 69657eb7f67600ec1c5c449d13eef3670dfb64da)
1# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 %s -run-pass twoaddressinstruction -verify-machineinstrs -o - | FileCheck -check-prefix=GCN %s
2# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 %s --passes=two-address-instruction -verify-each -o - | FileCheck -check-prefix=GCN %s
3
4# GCN-LABEL: name: test_v_wmma_f32_16x16x16_f16_twoaddr_w32
5# GCN: early-clobber %2:vreg_256 = V_WMMA_F32_16X16X16_F16_threeaddr_w32 8, killed %1, 8, killed %1, 8, %0, 0, 0, implicit $exec
6
7---
8name:            test_v_wmma_f32_16x16x16_f16_twoaddr_w32
9registers:
10  - { id: 0, class: vreg_256 }
11  - { id: 1, class: vreg_256 }
12  - { id: 2, class: vreg_256 }
13body:             |
14  bb.0:
15
16    %0 = IMPLICIT_DEF
17    %1 = IMPLICIT_DEF
18    early-clobber %2:vreg_256 = V_WMMA_F32_16X16X16_F16_twoaddr_w32 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_256, 0, 0, implicit $exec
19    S_ENDPGM 0, implicit %0
20...
21
22# GCN-LABEL: name: test_v_wmma_f32_16x16x16_bf16_twoaddr_w32
23# GCN: early-clobber %2:vreg_256 = V_WMMA_F32_16X16X16_BF16_threeaddr_w32 8, killed %1, 8, killed %1, 8, %0, 0, 0, implicit $exec
24
25---
26name:            test_v_wmma_f32_16x16x16_bf16_twoaddr_w32
27registers:
28  - { id: 0, class: vreg_256 }
29  - { id: 1, class: vreg_256 }
30  - { id: 2, class: vreg_256 }
31body:             |
32  bb.0:
33
34    %0 = IMPLICIT_DEF
35    %1 = IMPLICIT_DEF
36    early-clobber %2:vreg_256 = V_WMMA_F32_16X16X16_BF16_twoaddr_w32 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_256, 0, 0, implicit $exec
37    S_ENDPGM 0, implicit %0
38...
39
40# GCN-LABEL: name: test_v_wmma_f16_16x16x16_f16_twoaddr_w32
41# GCN: early-clobber %2:vreg_256 = V_WMMA_F16_16X16X16_F16_threeaddr_w32 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, 0, implicit $exec
42
43---
44name:            test_v_wmma_f16_16x16x16_f16_twoaddr_w32
45registers:
46  - { id: 0, class: vreg_256 }
47  - { id: 1, class: vreg_256 }
48  - { id: 2, class: vreg_256 }
49body:             |
50  bb.0:
51
52    %0 = IMPLICIT_DEF
53    %1 = IMPLICIT_DEF
54    early-clobber %2:vreg_256 = V_WMMA_F16_16X16X16_F16_twoaddr_w32 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_256, 0, 0, 0, 0, implicit $exec
55    S_ENDPGM 0, implicit %0
56...
57
58# GCN-LABEL: name: test_v_wmma_bf16_16x16x16_bf16_twoaddr_w32
59# GCN: early-clobber %2:vreg_256 = V_WMMA_BF16_16X16X16_BF16_threeaddr_w32 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, 0, implicit $exec
60
61---
62name:            test_v_wmma_bf16_16x16x16_bf16_twoaddr_w32
63registers:
64  - { id: 0, class: vreg_256 }
65  - { id: 1, class: vreg_256 }
66  - { id: 2, class: vreg_256 }
67body:             |
68  bb.0:
69
70    %0 = IMPLICIT_DEF
71    %1 = IMPLICIT_DEF
72    early-clobber %2:vreg_256 = V_WMMA_BF16_16X16X16_BF16_twoaddr_w32 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_256, 0, 0, 0, 0, implicit $exec
73    S_ENDPGM 0, implicit %0
74...
75
76# GCN-LABEL: name: test_v_wmma_i32_16x16x16_iu8_twoaddr_w32
77# GCN: early-clobber %2:vreg_256 = V_WMMA_I32_16X16X16_IU8_threeaddr_w32 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, implicit $exec
78
79---
80name:            test_v_wmma_i32_16x16x16_iu8_twoaddr_w32
81registers:
82  - { id: 0, class: vreg_256 }
83  - { id: 1, class: vreg_128 }
84  - { id: 2, class: vreg_256 }
85body:             |
86  bb.0:
87
88    %0 = IMPLICIT_DEF
89    %1 = IMPLICIT_DEF
90    early-clobber %2:vreg_256 = V_WMMA_I32_16X16X16_IU8_twoaddr_w32 8, killed %1:vreg_128, 8, killed %1:vreg_128, 8, %0:vreg_256, 0, 0, 0, implicit $exec
91    S_ENDPGM 0, implicit %0
92...
93
94# GCN-LABEL: name: test_v_wmma_i32_16x16x16_iu4_twoaddr_w32
95# GCN: early-clobber %2:vreg_256 = V_WMMA_I32_16X16X16_IU4_threeaddr_w32 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, implicit $exec
96
97---
98name:            test_v_wmma_i32_16x16x16_iu4_twoaddr_w32
99registers:
100  - { id: 0, class: vreg_256 }
101  - { id: 1, class: vreg_64 }
102  - { id: 2, class: vreg_256 }
103body:             |
104  bb.0:
105
106    %0 = IMPLICIT_DEF
107    %1 = IMPLICIT_DEF
108    early-clobber %2:vreg_256 = V_WMMA_I32_16X16X16_IU4_twoaddr_w32 8, killed %1:vreg_64, 8, killed %1:vreg_64, 8, %0:vreg_256, 0, 0, 0, implicit $exec
109    S_ENDPGM 0, implicit %0
110...
111
112# GCN-LABEL: name: test_v_wmma_f32_16x16x16_f16_twoaddr_w64
113# GCN: early-clobber %2:vreg_128 = V_WMMA_F32_16X16X16_F16_threeaddr_w64 8, killed %1, 8, killed %1, 8, %0, 0, 0, implicit $exec
114
115---
116name:            test_v_wmma_f32_16x16x16_f16_twoaddr_w64
117registers:
118  - { id: 0, class: vreg_128 }
119  - { id: 1, class: vreg_256 }
120  - { id: 2, class: vreg_128 }
121body:             |
122  bb.0:
123
124    %0 = IMPLICIT_DEF
125    %1 = IMPLICIT_DEF
126    early-clobber %2:vreg_128 = V_WMMA_F32_16X16X16_F16_twoaddr_w64 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_128, 0, 0, implicit $exec
127    S_ENDPGM 0, implicit %0
128...
129
130# GCN-LABEL: name: test_v_wmma_f32_16x16x16_bf16_twoaddr_w64
131# GCN: early-clobber %2:vreg_128 = V_WMMA_F32_16X16X16_BF16_threeaddr_w64 8, killed %1, 8, killed %1, 8, %0, 0, 0, implicit $exec
132
133---
134name:            test_v_wmma_f32_16x16x16_bf16_twoaddr_w64
135registers:
136  - { id: 0, class: vreg_128 }
137  - { id: 1, class: vreg_256 }
138  - { id: 2, class: vreg_128 }
139body:             |
140  bb.0:
141
142    %0 = IMPLICIT_DEF
143    %1 = IMPLICIT_DEF
144    early-clobber %2:vreg_128 = V_WMMA_F32_16X16X16_BF16_twoaddr_w64 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_128, 0, 0, implicit $exec
145    S_ENDPGM 0, implicit %0
146...
147
148# GCN-LABEL: name: test_v_wmma_f16_16x16x16_f16_twoaddr_w64
149# GCN: early-clobber %2:vreg_128 = V_WMMA_F16_16X16X16_F16_threeaddr_w64 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, 0, implicit $exec
150
151---
152name:            test_v_wmma_f16_16x16x16_f16_twoaddr_w64
153registers:
154  - { id: 0, class: vreg_128 }
155  - { id: 1, class: vreg_256 }
156  - { id: 2, class: vreg_128 }
157body:             |
158  bb.0:
159
160    %0 = IMPLICIT_DEF
161    %1 = IMPLICIT_DEF
162    early-clobber %2:vreg_128 = V_WMMA_F16_16X16X16_F16_twoaddr_w64 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_128, 0, 0, 0, 0, implicit $exec
163    S_ENDPGM 0, implicit %0
164...
165
166# GCN-LABEL: name: test_v_wmma_bf16_16x16x16_bf16_twoaddr_w64
167# GCN: early-clobber %2:vreg_128 = V_WMMA_BF16_16X16X16_BF16_threeaddr_w64 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, 0, implicit $exec
168
169---
170name:            test_v_wmma_bf16_16x16x16_bf16_twoaddr_w64
171registers:
172  - { id: 0, class: vreg_128 }
173  - { id: 1, class: vreg_256 }
174  - { id: 2, class: vreg_128 }
175body:             |
176  bb.0:
177
178    %0 = IMPLICIT_DEF
179    %1 = IMPLICIT_DEF
180    early-clobber %2:vreg_128 = V_WMMA_BF16_16X16X16_BF16_twoaddr_w64 8, killed %1:vreg_256, 8, killed %1:vreg_256, 8, %0:vreg_128, 0, 0, 0, 0, implicit $exec
181    S_ENDPGM 0, implicit %0
182...
183
184# GCN-LABEL: name: test_v_wmma_i32_16x16x16_iu8_twoaddr_w64
185# GCN: early-clobber %2:vreg_128 = V_WMMA_I32_16X16X16_IU8_threeaddr_w64 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, implicit $exec
186
187---
188name:            test_v_wmma_i32_16x16x16_iu8_twoaddr_w64
189registers:
190  - { id: 0, class: vreg_128 }
191  - { id: 1, class: vreg_128 }
192  - { id: 2, class: vreg_128 }
193body:             |
194  bb.0:
195
196    %0 = IMPLICIT_DEF
197    %1 = IMPLICIT_DEF
198    early-clobber %2:vreg_128 = V_WMMA_I32_16X16X16_IU8_twoaddr_w64 8, killed %1:vreg_128, 8, killed %1:vreg_128, 8, %0:vreg_128, 0, 0, 0, implicit $exec
199    S_ENDPGM 0, implicit %0
200...
201
202# GCN-LABEL: name: test_v_wmma_i32_16x16x16_iu4_twoaddr_w64
203# GCN: early-clobber %2:vreg_128 = V_WMMA_I32_16X16X16_IU4_threeaddr_w64 8, killed %1, 8, killed %1, 8, %0, 0, 0, 0, implicit $exec
204
205---
206name:            test_v_wmma_i32_16x16x16_iu4_twoaddr_w64
207registers:
208  - { id: 0, class: vreg_128 }
209  - { id: 1, class: vreg_64 }
210  - { id: 2, class: vreg_128 }
211body:             |
212  bb.0:
213
214    %0 = IMPLICIT_DEF
215    %1 = IMPLICIT_DEF
216    early-clobber %2:vreg_128 = V_WMMA_I32_16X16X16_IU4_twoaddr_w64 8, killed %1:vreg_64, 8, killed %1:vreg_64, 8, %0:vreg_128, 0, 0, 0, implicit $exec
217    S_ENDPGM 0, implicit %0
218...
219