1 # RUN: llc -mtriple=amdgcn -mcpu=gfx908 -start-before=greedy,0 -stop-after=virtregrewriter,2 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GCN,GFX908 %s
4 # GCN-LABEL: name: alloc_vgpr_64
5 # GFX908: $vgpr3_vgpr4 = GLOBAL_LOAD
7 tracksRegLiveness: true
9 - { reg: '$vgpr0_vgpr1' }
13 liveins: $vgpr0_vgpr1, $vgpr2
15 %0:vreg_64 = COPY $vgpr0_vgpr1
16 %1:vgpr_32 = COPY $vgpr2
17 %2:vreg_64 = GLOBAL_LOAD_DWORDX2 %0, 0, 0, implicit $exec
18 GLOBAL_STORE_DWORDX2 %0, %2, 0, 0, implicit $exec
19 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
23 # GCN-LABEL: name: alloc_vgpr_96
24 # GFX908: $vgpr3_vgpr4_vgpr5 = GLOBAL_LOAD
26 tracksRegLiveness: true
28 - { reg: '$vgpr0_vgpr1' }
32 liveins: $vgpr0_vgpr1, $vgpr2
34 %0:vreg_64 = COPY $vgpr0_vgpr1
35 %1:vgpr_32 = COPY $vgpr2
36 %2:vreg_96 = GLOBAL_LOAD_DWORDX3 %0, 0, 0, implicit $exec
37 GLOBAL_STORE_DWORDX3 %0, %2, 0, 0, implicit $exec
38 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
42 # GCN-LABEL: name: alloc_vgpr_128
43 # GFX908: $vgpr3_vgpr4_vgpr5_vgpr6 = GLOBAL_LOAD
45 tracksRegLiveness: true
47 - { reg: '$vgpr0_vgpr1' }
51 liveins: $vgpr0_vgpr1, $vgpr2
53 %0:vreg_64 = COPY $vgpr0_vgpr1
54 %1:vgpr_32 = COPY $vgpr2
55 %2:vreg_128 = GLOBAL_LOAD_DWORDX4 %0, 0, 0, implicit $exec
56 GLOBAL_STORE_DWORDX4 %0, %2, 0, 0, implicit $exec
57 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
61 # GCN-LABEL: name: alloc_vgpr_160
62 # GFX908: $vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = IMAGE_LOAD
64 tracksRegLiveness: true
66 - { reg: '$vgpr0_vgpr1' }
70 liveins: $vgpr0_vgpr1, $vgpr2
72 %0:vreg_64 = COPY $vgpr0_vgpr1
73 %1:vgpr_32 = COPY $vgpr2
74 %2:vreg_160 = IMAGE_LOAD_V5_V1 %1, undef %3:sgpr_256, 0, 0, 0, 0, 0, 1, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
75 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
76 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
80 # GCN-LABEL: name: alloc_vgpr_256
81 # GFX908: $vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10 = COPY
83 tracksRegLiveness: true
85 - { reg: '$vgpr0_vgpr1' }
89 liveins: $vgpr0_vgpr1, $vgpr2
91 %0:vreg_64 = COPY $vgpr0_vgpr1
92 %1:vgpr_32 = COPY $vgpr2
93 %3:sgpr_256 = IMPLICIT_DEF
94 %2:vreg_256 = COPY %3:sgpr_256
95 %4:vreg_128 = IMAGE_SAMPLE_C_CL_O_V4_V8 %2, %3:sgpr_256, undef %5:sgpr_128, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
96 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
97 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
101 # GCN-LABEL: name: alloc_vgpr_512
102 # GFX908: $vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18 = IMPLICIT_DEF
104 tracksRegLiveness: true
106 - { reg: '$vgpr0_vgpr1' }
110 liveins: $vgpr0_vgpr1, $vgpr2
112 %0:vreg_64 = COPY $vgpr0_vgpr1
113 %1:vgpr_32 = COPY $vgpr2
114 %2:vreg_512 = IMPLICIT_DEF
115 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
116 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
117 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
118 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
119 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
123 # GCN-LABEL: name: alloc_vgpr_1024
124 # GFX908: $vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25_vgpr26_vgpr27_vgpr28_vgpr29_vgpr30_vgpr31_vgpr32_vgpr33_vgpr34 = IMPLICIT_DEF
125 name: alloc_vgpr_1024
126 tracksRegLiveness: true
128 - { reg: '$vgpr0_vgpr1' }
132 liveins: $vgpr0_vgpr1, $vgpr2
134 %0:vreg_64 = COPY $vgpr0_vgpr1
135 %1:vgpr_32 = COPY $vgpr2
136 %2:vreg_1024 = IMPLICIT_DEF
137 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
138 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
139 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
140 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
141 GLOBAL_STORE_DWORDX4 %0, %2.sub16_sub17_sub18_sub19, 0, 0, implicit $exec
142 GLOBAL_STORE_DWORDX4 %0, %2.sub20_sub21_sub22_sub23, 0, 0, implicit $exec
143 GLOBAL_STORE_DWORDX4 %0, %2.sub24_sub25_sub26_sub27, 0, 0, implicit $exec
144 GLOBAL_STORE_DWORDX4 %0, %2.sub28_sub29_sub30_sub31, 0, 0, implicit $exec
145 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
149 # GCN-LABEL: name: alloc_agpr_64
150 # GFX908: $agpr1_agpr2 = IMPLICIT_DEF
152 tracksRegLiveness: true
154 - { reg: '$vgpr0_vgpr1' }
158 liveins: $vgpr0_vgpr1, $agpr0
160 %0:vreg_64 = COPY $vgpr0_vgpr1
161 %3:areg_64 = IMPLICIT_DEF
162 %2:vreg_64 = COPY %3:areg_64
163 GLOBAL_STORE_DWORDX2 %0, %2, 0, 0, implicit $exec
164 %1:vgpr_32 = COPY $agpr0
165 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
169 # GCN-LABEL: name: alloc_agpr_128
170 # GFX908: $agpr1_agpr2_agpr3_agpr4 = IMPLICIT_DEF
172 tracksRegLiveness: true
174 - { reg: '$vgpr0_vgpr1' }
178 liveins: $vgpr0_vgpr1, $agpr0
180 %0:vreg_64 = COPY $vgpr0_vgpr1
181 %3:areg_128 = IMPLICIT_DEF
182 %2:vreg_128 = COPY %3:areg_128
183 GLOBAL_STORE_DWORDX4 %0, %2, 0, 0, implicit $exec
184 %1:vgpr_32 = COPY $agpr0
185 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
189 # GCN-LABEL: name: alloc_agpr_512
190 # GFX908: $agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15_agpr16 = IMPLICIT_DEF
192 tracksRegLiveness: true
194 - { reg: '$vgpr0_vgpr1' }
198 liveins: $vgpr0_vgpr1, $agpr0
200 %0:vreg_64 = COPY $vgpr0_vgpr1
201 %3:areg_512 = IMPLICIT_DEF
202 %2:vreg_512 = COPY %3:areg_512
203 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
204 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
205 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
206 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
207 %1:vgpr_32 = COPY $agpr0
208 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
212 # GCN-LABEL: name: alloc_agpr_1024
213 # GFX908: $agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15_agpr16_agpr17_agpr18_agpr19_agpr20_agpr21_agpr22_agpr23_agpr24_agpr25_agpr26_agpr27_agpr28_agpr29_agpr30_agpr31_agpr32 = IMPLICIT_DEF
214 name: alloc_agpr_1024
215 tracksRegLiveness: true
217 - { reg: '$vgpr0_vgpr1' }
221 liveins: $vgpr0_vgpr1, $agpr0
223 %0:vreg_64 = COPY $vgpr0_vgpr1
224 %3:areg_1024 = IMPLICIT_DEF
225 %2:vreg_1024 = COPY %3:areg_1024
226 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
227 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
228 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
229 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
230 GLOBAL_STORE_DWORDX4 %0, %2.sub16_sub17_sub18_sub19, 0, 0, implicit $exec
231 GLOBAL_STORE_DWORDX4 %0, %2.sub20_sub21_sub22_sub23, 0, 0, implicit $exec
232 GLOBAL_STORE_DWORDX4 %0, %2.sub24_sub25_sub26_sub27, 0, 0, implicit $exec
233 GLOBAL_STORE_DWORDX4 %0, %2.sub28_sub29_sub30_sub31, 0, 0, implicit $exec
234 %1:vgpr_32 = COPY $agpr0
235 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec