1 # RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -run-pass si-load-store-opt -o - %s | FileCheck -check-prefix=GFX12 %s
4 # GFX12-LABEL: name: image_load_merged_v1v3
5 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
6 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %10.sub0
7 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %10.sub1_sub2_sub3
9 name: image_load_merged_v1v3
12 %0:sgpr_64 = COPY $sgpr0_sgpr1
13 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
14 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
15 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
16 %4:vgpr_32 = COPY %2.sub3
17 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
18 %6:vgpr_32 = COPY %5.sub0
19 %7:vgpr_32 = COPY %5.sub1
20 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
21 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
24 # GFX12-LABEL: name: image_load_merged_v1v3_reversed
25 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
26 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %10.sub3
27 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %10.sub0_sub1_sub2
29 name: image_load_merged_v1v3_reversed
32 %0:sgpr_64 = COPY $sgpr0_sgpr1
33 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
34 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
35 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
36 %4:vgpr_32 = COPY %2.sub3
37 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
38 %6:vgpr_32 = COPY %5.sub0
39 %7:vgpr_32 = COPY %5.sub1
40 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
41 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
45 # GFX12-LABEL: name: image_load_merged_v2v2
46 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
47 # GFX12: %{{[0-9]+}}:vreg_64 = COPY %10.sub0_sub1
48 # GFX12: %{{[0-9]+}}:vreg_64 = COPY killed %10.sub2_sub3
50 name: image_load_merged_v2v2
53 %0:sgpr_64 = COPY $sgpr0_sgpr1
54 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
55 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
56 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
57 %4:vgpr_32 = COPY %2.sub3
58 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
59 %6:vgpr_32 = COPY %5.sub0
60 %7:vgpr_32 = COPY %5.sub1
61 %8:vreg_64 = IMAGE_LOAD_V2_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 3, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
62 %9:vreg_64 = IMAGE_LOAD_V2_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 12, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
66 # GFX12-LABEL: name: image_load_merged_v2v2_reversed
67 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
68 # GFX12: %{{[0-9]+}}:vreg_64 = COPY %10.sub2_sub3
69 # GFX12: %{{[0-9]+}}:vreg_64 = COPY killed %10.sub0_sub1
71 name: image_load_merged_v2v2_reversed
74 %0:sgpr_64 = COPY $sgpr0_sgpr1
75 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
76 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
77 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
78 %4:vgpr_32 = COPY %2.sub3
79 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
80 %6:vgpr_32 = COPY %5.sub0
81 %7:vgpr_32 = COPY %5.sub1
82 %8:vreg_64 = IMAGE_LOAD_V2_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 12, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
83 %9:vreg_64 = IMAGE_LOAD_V2_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 3, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
87 # GFX12-LABEL: name: image_load_merged_v3v1
88 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
89 # GFX12: %{{[0-9]+}}:vreg_96 = COPY %10.sub0_sub1_sub2
90 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY killed %10.sub3
92 name: image_load_merged_v3v1
95 %0:sgpr_64 = COPY $sgpr0_sgpr1
96 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
97 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
98 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
99 %4:vgpr_32 = COPY %2.sub3
100 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
101 %6:vgpr_32 = COPY %5.sub0
102 %7:vgpr_32 = COPY %5.sub1
103 %8:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
104 %9:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
108 # GFX12-LABEL: name: image_load_merged_v3v1_reversed
109 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
110 # GFX12: %{{[0-9]+}}:vreg_96 = COPY %10.sub1_sub2_sub3
111 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY killed %10.sub0
113 name: image_load_merged_v3v1_reversed
116 %0:sgpr_64 = COPY $sgpr0_sgpr1
117 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
118 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
119 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
120 %4:vgpr_32 = COPY %2.sub3
121 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
122 %6:vgpr_32 = COPY %5.sub0
123 %7:vgpr_32 = COPY %5.sub1
124 %8:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
125 %9:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
129 # GFX12-LABEL: name: image_load_divided_merged
130 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
132 name: image_load_divided_merged
135 %0:sgpr_64 = COPY $sgpr0_sgpr1
136 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
137 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
138 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
139 %4:vgpr_32 = COPY %2.sub3
140 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
141 %6:vgpr_32 = COPY %5.sub0
142 %7:vgpr_32 = COPY %5.sub1
143 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
144 %9:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
145 %10:vgpr_32 = COPY %9.sub0
146 %11:vgpr_32 = COPY %9.sub1
147 %12:vreg_128 = BUFFER_LOAD_DWORDX4_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
148 %13:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %10:vgpr_32, %11:vgpr_32, %3:sgpr_256, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
149 %14:vreg_128 = BUFFER_LOAD_DWORDX4_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
150 %15:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
154 # GFX12-LABEL: name: image_load_divided_not_merged
155 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
156 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
158 name: image_load_divided_not_merged
161 %0:sgpr_64 = COPY $sgpr0_sgpr1
162 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
163 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
164 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
165 %4:vreg_128 = COPY %2
166 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
167 %6:vgpr_32 = COPY %5.sub0
168 %7:vgpr_32 = COPY %5.sub1
169 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
170 IMAGE_STORE_V4_V2_gfx12 %4:vreg_128, %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 15, 1, 0, 0, 0, 0, 0, implicit $exec :: (store 16)
171 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
175 # GFX12-LABEL: name: image_load_dmask_overlapped_not_merged
176 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 4, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
177 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
179 name: image_load_dmask_overlapped_not_merged
182 %0:sgpr_64 = COPY $sgpr0_sgpr1
183 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
184 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
185 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
186 %4:vgpr_32 = COPY %2.sub3
187 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
188 %6:vgpr_32 = COPY %5.sub0
189 %7:vgpr_32 = COPY %5.sub1
190 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 4, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
191 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
195 # GFX12-LABEL: name: image_load_dmask_not_disjoint_not_merged
196 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 4, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
197 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 11, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
199 name: image_load_dmask_not_disjoint_not_merged
202 %0:sgpr_64 = COPY $sgpr0_sgpr1
203 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
204 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
205 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
206 %4:vgpr_32 = COPY %2.sub3
207 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
208 %6:vgpr_32 = COPY %5.sub0
209 %7:vgpr_32 = COPY %5.sub1
210 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 4, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
211 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 11, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
215 # GFX12-LABEL: name: image_load_not_merged_0
216 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
217 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %9, %10, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
219 name: image_load_not_merged_0
222 %0:sgpr_64 = COPY $sgpr0_sgpr1
223 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
224 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
225 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
226 %4:vgpr_32 = COPY %2.sub3
227 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
228 %6:vgpr_32 = COPY %5.sub0
229 %7:vgpr_32 = COPY %5.sub1
230 %8:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 1, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
231 %9:vgpr_32 = COPY %8.sub0
232 %10:vgpr_32 = COPY %8.sub1
233 %11:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
234 %12:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %9, %10, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
238 # GFX12-LABEL: name: image_load_not_merged_1
239 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %7, %8, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
240 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %7, %8, %4, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
242 name: image_load_not_merged_1
245 %0:sgpr_64 = COPY $sgpr0_sgpr1
246 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
247 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
248 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
249 %4:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
250 %5:vgpr_32 = COPY %2.sub3
251 %6:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
252 %7:vgpr_32 = COPY %6.sub0
253 %8:vgpr_32 = COPY %6.sub1
254 %9:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %7, %8, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
255 %10:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %7, %8, %4, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
259 # GFX12-LABEL: name: image_load_not_merged_4
260 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
261 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
263 name: image_load_not_merged_4
266 %0:sgpr_64 = COPY $sgpr0_sgpr1
267 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
268 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
269 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
270 %4:vgpr_32 = COPY %2.sub3
271 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
272 %6:vgpr_32 = COPY %5.sub0
273 %7:vgpr_32 = COPY %5.sub1
274 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
275 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
279 # GFX12-LABEL: name: image_load_not_merged_5
280 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
281 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 1, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
283 name: image_load_not_merged_5
286 %0:sgpr_64 = COPY $sgpr0_sgpr1
287 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
288 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
289 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
290 %4:vgpr_32 = COPY %2.sub3
291 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
292 %6:vgpr_32 = COPY %5.sub0
293 %7:vgpr_32 = COPY %5.sub1
294 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
295 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 1, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
299 # GFX12-LABEL: name: image_load_not_merged_6
300 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
301 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
303 name: image_load_not_merged_6
306 %0:sgpr_64 = COPY $sgpr0_sgpr1
307 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
308 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
309 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
310 %4:vgpr_32 = COPY %2.sub3
311 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
312 %6:vgpr_32 = COPY %5.sub0
313 %7:vgpr_32 = COPY %5.sub1
314 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
315 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
319 # GFX12-LABEL: name: image_load_not_merged_7
320 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
321 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 1, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
323 name: image_load_not_merged_7
326 %0:sgpr_64 = COPY $sgpr0_sgpr1
327 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
328 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
329 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
330 %4:vgpr_32 = COPY %2.sub3
331 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
332 %6:vgpr_32 = COPY %5.sub0
333 %7:vgpr_32 = COPY %5.sub1
334 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
335 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 1, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
339 # GFX12-LABEL: name: image_load_not_merged_8
340 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V1_gfx12 %6, %3, 8, 1, 0, 0, 1, 0, 0, implicit $exec :: (dereferenceable load (s64), align 16, addrspace 4)
341 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
343 name: image_load_not_merged_8
346 %0:sgpr_64 = COPY $sgpr0_sgpr1
347 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
348 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
349 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
350 %4:vgpr_32 = COPY %2.sub3
351 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
352 %6:vgpr_32 = COPY %5.sub0
353 %7:vgpr_32 = COPY %5.sub1
354 %8:vgpr_32 = IMAGE_LOAD_V1_V1_gfx12 %6, %3, 8, 1, 0, 0, 1, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
355 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
359 # GFX12-LABEL: name: image_load_not_merged_9
360 # GFX12: %{{[0-9]+}}:vreg_64 = IMAGE_LOAD_V2_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 1, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
361 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
363 name: image_load_not_merged_9
366 %0:sgpr_64 = COPY $sgpr0_sgpr1
367 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
368 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
369 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
370 %4:vgpr_32 = COPY %2.sub3
371 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
372 %6:vgpr_32 = COPY %5.sub0
373 %7:vgpr_32 = COPY %5.sub1
374 %8:vreg_64 = IMAGE_LOAD_V2_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 1, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
375 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
379 # GFX12-LABEL: name: image_load_not_merged_11
380 # GFX12: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 1, implicit $exec :: (dereferenceable load (s32), addrspace 4)
381 # GFX12: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
383 name: image_load_not_merged_11
386 %0:sgpr_64 = COPY $sgpr0_sgpr1
387 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
388 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
389 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
390 %4:vgpr_32 = COPY %2.sub3
391 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
392 %6:vgpr_32 = COPY %5.sub0
393 %7:vgpr_32 = COPY %5.sub1
394 %8:vgpr_32 = IMAGE_LOAD_V1_V2_gfx12 %6, %7, %3, 8, 1, 0, 0, 0, 0, 1, implicit $exec :: (dereferenceable load 4, addrspace 4)
395 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx12 %6, %7, %3, 7, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
399 # GFX12-LABEL: name: image_load_mip_merged_v1v3
400 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_MIP_V4_V3_gfx12 %6, %7, %8, %3, 15, 1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
401 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %11.sub0
402 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %11.sub1_sub2_sub3
404 name: image_load_mip_merged_v1v3
407 %0:sgpr_64 = COPY $sgpr0_sgpr1
408 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
409 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
410 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
411 %4:vgpr_32 = COPY %2.sub3
412 %5:vreg_96 = BUFFER_LOAD_DWORDX3_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
413 %6:vgpr_32 = COPY %5.sub0
414 %7:vgpr_32 = COPY %5.sub1
415 %8:vgpr_32 = COPY %5.sub2
416 %9:vgpr_32 = IMAGE_LOAD_MIP_V1_V3_gfx12 %6:vgpr_32, %7:vgpr_32, %8:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
417 %10:vreg_96 = IMAGE_LOAD_MIP_V3_V3_gfx12 %6:vgpr_32, %7:vgpr_32, %8:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
421 # GFX12-LABEL: name: image_load_mip_pck_merged_v1v3
422 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_MIP_PCK_V4_V3_gfx12 %6, %7, %8, %3, 15, 1, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
423 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %11.sub0
424 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %11.sub1_sub2_sub3
426 name: image_load_mip_pck_merged_v1v3
429 %0:sgpr_64 = COPY $sgpr0_sgpr1
430 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
431 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
432 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
433 %4:vgpr_32 = COPY %2.sub3
434 %5:vreg_96 = BUFFER_LOAD_DWORDX3_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
435 %6:vgpr_32 = COPY %5.sub0
436 %7:vgpr_32 = COPY %5.sub1
437 %8:vgpr_32 = COPY %5.sub2
438 %9:vgpr_32 = IMAGE_LOAD_MIP_PCK_V1_V3_gfx12 %6:vgpr_32, %7:vgpr_32, %8:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
439 %10:vreg_96 = IMAGE_LOAD_MIP_PCK_V3_V3_gfx12 %6:vgpr_32, %7:vgpr_32, %8:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
443 # GFX12-LABEL: name: image_load_mip_pck_sgn_merged_v1v3
444 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_MIP_PCK_SGN_V4_V3_gfx12 %6, %7, %8, %3, 15, 1, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
445 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %11.sub0
446 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %11.sub1_sub2_sub3
448 name: image_load_mip_pck_sgn_merged_v1v3
451 %0:sgpr_64 = COPY $sgpr0_sgpr1
452 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
453 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
454 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
455 %4:vgpr_32 = COPY %2.sub3
456 %5:vreg_96 = BUFFER_LOAD_DWORDX3_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
457 %6:vgpr_32 = COPY %5.sub0
458 %7:vgpr_32 = COPY %5.sub1
459 %8:vgpr_32 = COPY %5.sub2
460 %9:vgpr_32 = IMAGE_LOAD_MIP_PCK_SGN_V1_V3_gfx12 %6:vgpr_32, %7:vgpr_32, %8:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
461 %10:vreg_96 = IMAGE_LOAD_MIP_PCK_SGN_V3_V3_gfx12 %6:vgpr_32, %7:vgpr_32, %8:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
465 # GFX12-LABEL: name: image_load_pck_merged_v1v3
466 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_PCK_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
467 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %10.sub0
468 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %10.sub1_sub2_sub3
470 name: image_load_pck_merged_v1v3
473 %0:sgpr_64 = COPY $sgpr0_sgpr1
474 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
475 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
476 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
477 %4:vgpr_32 = COPY %2.sub3
478 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
479 %6:vgpr_32 = COPY %5.sub0
480 %7:vgpr_32 = COPY %5.sub1
481 %8:vgpr_32 = IMAGE_LOAD_PCK_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
482 %9:vreg_96 = IMAGE_LOAD_PCK_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
486 # GFX12-LABEL: name: image_load_pck_sgn_merged_v1v3
487 # GFX12: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_PCK_SGN_V4_V2_gfx12 %6, %7, %3, 15, 1, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
488 # GFX12: %{{[0-9]+}}:vgpr_32 = COPY %10.sub0
489 # GFX12: %{{[0-9]+}}:vreg_96 = COPY killed %10.sub1_sub2_sub3
491 name: image_load_pck_sgn_merged_v1v3
494 %0:sgpr_64 = COPY $sgpr0_sgpr1
495 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
496 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
497 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
498 %4:vgpr_32 = COPY %2.sub3
499 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
500 %6:vgpr_32 = COPY %5.sub0
501 %7:vgpr_32 = COPY %5.sub1
502 %8:vgpr_32 = IMAGE_LOAD_PCK_SGN_V1_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 1, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
503 %9:vreg_96 = IMAGE_LOAD_PCK_SGN_V3_V2_gfx12 %6:vgpr_32, %7:vgpr_32, %3:sgpr_256, 14, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)