1 # RUN: llc -mtriple=amdgcn -mcpu=gfx90a -start-before=greedy,0 -stop-after=virtregrewriter,2 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GCN,GFX90A %s
2 # Using the unaligned vector tuples are OK as long as they aren't used
3 # in a real instruction.
6 # GCN-LABEL: name: alloc_vgpr_64
7 # GFX90A: $vgpr4_vgpr5 = GLOBAL_LOAD
9 tracksRegLiveness: true
11 - { reg: '$vgpr0_vgpr1' }
15 liveins: $vgpr0_vgpr1, $vgpr2
17 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
18 %1:vgpr_32 = COPY $vgpr2
19 %2:vreg_64_align2 = GLOBAL_LOAD_DWORDX2 %0, 0, 0, implicit $exec
20 GLOBAL_STORE_DWORDX2 %0, %2, 0, 0, implicit $exec
21 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
25 # GCN-LABEL: name: alloc_vgpr_96
26 # GFX90A: $vgpr4_vgpr5_vgpr6 = GLOBAL_LOAD
28 tracksRegLiveness: true
30 - { reg: '$vgpr0_vgpr1' }
34 liveins: $vgpr0_vgpr1, $vgpr2
36 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
37 %1:vgpr_32 = COPY $vgpr2
38 %2:vreg_96_align2 = GLOBAL_LOAD_DWORDX3 %0, 0, 0, implicit $exec
39 GLOBAL_STORE_DWORDX3 %0, %2, 0, 0, implicit $exec
40 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
44 # GCN-LABEL: name: alloc_vgpr_128
45 # GFX90A: $vgpr4_vgpr5_vgpr6_vgpr7 = GLOBAL_LOAD
47 tracksRegLiveness: true
49 - { reg: '$vgpr0_vgpr1' }
53 liveins: $vgpr0_vgpr1, $vgpr2
55 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
56 %1:vgpr_32 = COPY $vgpr2
57 %2:vreg_128_align2 = GLOBAL_LOAD_DWORDX4 %0, 0, 0, implicit $exec
58 GLOBAL_STORE_DWORDX4 %0, %2, 0, 0, implicit $exec
59 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
63 # GCN-LABEL: name: alloc_vgpr_160
64 # GFX90A: $vgpr4_vgpr5_vgpr6_vgpr7_vgpr8 = IMAGE_LOAD
66 tracksRegLiveness: true
68 - { reg: '$vgpr0_vgpr1' }
72 liveins: $vgpr0_vgpr1, $vgpr2
74 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
75 %1:vgpr_32 = COPY $vgpr2
76 %2:vreg_160_align2 = IMAGE_LOAD_V5_V1 %0.sub0, undef %3:sgpr_256, 0, 0, 0, 0, 0, 1, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
77 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
78 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
82 # GCN-LABEL: name: alloc_vgpr_256
83 # GFX90A: $vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11 = COPY
85 tracksRegLiveness: true
87 - { reg: '$vgpr0_vgpr1' }
91 liveins: $vgpr0_vgpr1, $vgpr2
93 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
94 %1:vgpr_32 = COPY $vgpr2
95 %3:sgpr_256 = IMPLICIT_DEF
96 %2:vreg_256_align2 = COPY %3:sgpr_256
97 %4:vreg_128_align2 = 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)
98 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
99 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
103 # GCN-LABEL: name: alloc_vgpr_512
104 # GFX90A: $vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15_vgpr16_vgpr17_vgpr18_vgpr19 = IMPLICIT_DEF
106 tracksRegLiveness: true
108 - { reg: '$vgpr0_vgpr1' }
112 liveins: $vgpr0_vgpr1, $vgpr2
114 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
115 %1:vgpr_32 = COPY $vgpr2
116 %2:vreg_512_align2 = IMPLICIT_DEF
117 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
118 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
119 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
120 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
121 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
125 # GCN-LABEL: name: alloc_vgpr_1024
126 # GFX90A: $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_vgpr35 = IMPLICIT_DEF
127 name: alloc_vgpr_1024
128 tracksRegLiveness: true
130 - { reg: '$vgpr0_vgpr1' }
134 liveins: $vgpr0_vgpr1, $vgpr2
136 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
137 %1:vgpr_32 = COPY $vgpr2
138 %2:vreg_1024_align2 = IMPLICIT_DEF
139 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
140 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
141 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
142 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
143 GLOBAL_STORE_DWORDX4 %0, %2.sub16_sub17_sub18_sub19, 0, 0, implicit $exec
144 GLOBAL_STORE_DWORDX4 %0, %2.sub20_sub21_sub22_sub23, 0, 0, implicit $exec
145 GLOBAL_STORE_DWORDX4 %0, %2.sub24_sub25_sub26_sub27, 0, 0, implicit $exec
146 GLOBAL_STORE_DWORDX4 %0, %2.sub28_sub29_sub30_sub31, 0, 0, implicit $exec
147 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
151 # GCN-LABEL: name: alloc_agpr_64
152 # GFX90A: $agpr1_agpr2 = IMPLICIT_DEF
154 tracksRegLiveness: true
156 - { reg: '$vgpr0_vgpr1' }
160 liveins: $vgpr0_vgpr1, $agpr0
162 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
163 %3:areg_64 = IMPLICIT_DEF
164 %2:vreg_64_align2 = COPY %3:areg_64
165 GLOBAL_STORE_DWORDX2 %0, %2, 0, 0, implicit $exec
166 %1:vgpr_32 = COPY $agpr0
167 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
171 # GCN-LABEL: name: alloc_agpr_128
172 # GFX90A: $agpr1_agpr2_agpr3_agpr4 = IMPLICIT_DEF
174 tracksRegLiveness: true
176 - { reg: '$vgpr0_vgpr1' }
180 liveins: $vgpr0_vgpr1, $agpr0
182 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
183 %3:areg_128 = IMPLICIT_DEF
184 %2:vreg_128_align2 = COPY %3:areg_128
185 GLOBAL_STORE_DWORDX4 %0, %2, 0, 0, implicit $exec
186 %1:vgpr_32 = COPY $agpr0
187 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
191 # GCN-LABEL: name: alloc_agpr_512
192 # GFX90A: $agpr1_agpr2_agpr3_agpr4_agpr5_agpr6_agpr7_agpr8_agpr9_agpr10_agpr11_agpr12_agpr13_agpr14_agpr15_agpr16 = IMPLICIT_DEF
194 tracksRegLiveness: true
196 - { reg: '$vgpr0_vgpr1' }
200 liveins: $vgpr0_vgpr1, $agpr0
202 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
203 %3:areg_512 = IMPLICIT_DEF
204 %2:vreg_512_align2 = COPY %3:areg_512
205 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
206 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
207 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
208 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
209 %1:vgpr_32 = COPY $agpr0
210 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec
214 # GCN-LABEL: name: alloc_agpr_1024
215 # GFX90A: $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
216 name: alloc_agpr_1024
217 tracksRegLiveness: true
219 - { reg: '$vgpr0_vgpr1' }
223 liveins: $vgpr0_vgpr1, $agpr0
225 %0:vreg_64_align2 = COPY $vgpr0_vgpr1
226 %3:areg_1024 = IMPLICIT_DEF
227 %2:vreg_1024_align2 = COPY %3:areg_1024
228 GLOBAL_STORE_DWORDX4 %0, %2.sub0_sub1_sub2_sub3, 0, 0, implicit $exec
229 GLOBAL_STORE_DWORDX4 %0, %2.sub4_sub5_sub6_sub7, 0, 0, implicit $exec
230 GLOBAL_STORE_DWORDX4 %0, %2.sub8_sub9_sub10_sub11, 0, 0, implicit $exec
231 GLOBAL_STORE_DWORDX4 %0, %2.sub12_sub13_sub14_sub15, 0, 0, implicit $exec
232 GLOBAL_STORE_DWORDX4 %0, %2.sub16_sub17_sub18_sub19, 0, 0, implicit $exec
233 GLOBAL_STORE_DWORDX4 %0, %2.sub20_sub21_sub22_sub23, 0, 0, implicit $exec
234 GLOBAL_STORE_DWORDX4 %0, %2.sub24_sub25_sub26_sub27, 0, 0, implicit $exec
235 GLOBAL_STORE_DWORDX4 %0, %2.sub28_sub29_sub30_sub31, 0, 0, implicit $exec
236 %1:vgpr_32 = COPY $agpr0
237 GLOBAL_STORE_DWORD %0, %1, 0, 0, implicit $exec