1 # RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass si-load-store-opt -o - %s | FileCheck -check-prefix=GFX11 %s
3 # GFX11-LABEL: name: image_load_merged_v1v3
4 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
5 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub0
6 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub1_sub2_sub3
8 name: image_load_merged_v1v3
11 %0:sgpr_64 = COPY $sgpr0_sgpr1
12 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
13 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
14 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
15 %4:vgpr_32 = COPY %2.sub3
16 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
17 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
18 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
21 # GFX11-LABEL: name: image_load_merged_v1v3_reversed
22 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
23 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub3
24 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub0_sub1_sub2
26 name: image_load_merged_v1v3_reversed
29 %0:sgpr_64 = COPY $sgpr0_sgpr1
30 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
31 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
32 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
33 %4:vgpr_32 = COPY %2.sub3
34 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
35 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
36 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
40 # GFX11-LABEL: name: image_load_merged_v2v2
41 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
42 # GFX11: %{{[0-9]+}}:vreg_64 = COPY %8.sub0_sub1
43 # GFX11: %{{[0-9]+}}:vreg_64 = COPY killed %8.sub2_sub3
45 name: image_load_merged_v2v2
48 %0:sgpr_64 = COPY $sgpr0_sgpr1
49 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
50 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
51 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
52 %4:vgpr_32 = COPY %2.sub3
53 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
54 %6:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5:vreg_64, %3:sgpr_256, 3, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
55 %7:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5:vreg_64, %3:sgpr_256, 12, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
59 # GFX11-LABEL: name: image_load_merged_v2v2_reversed
60 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
61 # GFX11: %{{[0-9]+}}:vreg_64 = COPY %8.sub2_sub3
62 # GFX11: %{{[0-9]+}}:vreg_64 = COPY killed %8.sub0_sub1
64 name: image_load_merged_v2v2_reversed
67 %0:sgpr_64 = COPY $sgpr0_sgpr1
68 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
69 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
70 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
71 %4:vgpr_32 = COPY %2.sub3
72 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
73 %6:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5:vreg_64, %3:sgpr_256, 12, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
74 %7:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5:vreg_64, %3:sgpr_256, 3, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
78 # GFX11-LABEL: name: image_load_merged_v3v1
79 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
80 # GFX11: %{{[0-9]+}}:vreg_96 = COPY %8.sub0_sub1_sub2
81 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY killed %8.sub3
83 name: image_load_merged_v3v1
86 %0:sgpr_64 = COPY $sgpr0_sgpr1
87 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
88 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
89 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
90 %4:vgpr_32 = COPY %2.sub3
91 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
92 %6:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
93 %7:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
97 # GFX11-LABEL: name: image_load_merged_v3v1_reversed
98 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
99 # GFX11: %{{[0-9]+}}:vreg_96 = COPY %8.sub1_sub2_sub3
100 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY killed %8.sub0
102 name: image_load_merged_v3v1_reversed
105 %0:sgpr_64 = COPY $sgpr0_sgpr1
106 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
107 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
108 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
109 %4:vgpr_32 = COPY %2.sub3
110 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
111 %6:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
112 %7:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
116 # GFX11-LABEL: name: image_load_divided_merged
117 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), addrspace 4)
119 name: image_load_divided_merged
122 %0:sgpr_64 = COPY $sgpr0_sgpr1
123 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
124 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
125 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
126 %4:vgpr_32 = COPY %2.sub3
127 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
128 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
129 %7:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
130 %8:vreg_128 = BUFFER_LOAD_DWORDX4_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
131 %9:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %7:vreg_64, %3:sgpr_256, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
132 %10:vreg_128 = BUFFER_LOAD_DWORDX4_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
133 %11:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
137 # GFX11-LABEL: name: image_load_divided_not_merged
138 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
139 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
141 name: image_load_divided_not_merged
144 %0:sgpr_64 = COPY $sgpr0_sgpr1
145 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
146 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
147 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
148 %4:vreg_128 = COPY %2
149 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
150 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
151 IMAGE_STORE_V4_V2 %4:vreg_128, %5:vreg_64, %3:sgpr_256, 15, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (store 16)
152 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
156 # GFX11-LABEL: name: image_load_dmask_overlapped_not_merged
157 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 4, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
158 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
160 name: image_load_dmask_overlapped_not_merged
163 %0:sgpr_64 = COPY $sgpr0_sgpr1
164 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
165 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
166 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
167 %4:vgpr_32 = COPY %2.sub3
168 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
169 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 4, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
170 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
174 # GFX11-LABEL: name: image_load_dmask_not_disjoint_not_merged
175 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 4, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
176 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 11, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
178 name: image_load_dmask_not_disjoint_not_merged
181 %0:sgpr_64 = COPY $sgpr0_sgpr1
182 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
183 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
184 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
185 %4:vgpr_32 = COPY %2.sub3
186 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
187 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 4, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
188 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 11, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
192 # GFX11-LABEL: name: image_load_not_merged_0
193 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
194 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %6, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
196 name: image_load_not_merged_0
199 %0:sgpr_64 = COPY $sgpr0_sgpr1
200 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
201 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
202 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
203 %4:vgpr_32 = COPY %2.sub3
204 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
205 %6:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 1, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
206 %7:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
207 %8:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %6, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
211 # GFX11-LABEL: name: image_load_not_merged_1
212 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %6, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
213 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %6, %4, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
215 name: image_load_not_merged_1
218 %0:sgpr_64 = COPY $sgpr0_sgpr1
219 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
220 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
221 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
222 %4:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
223 %5:vgpr_32 = COPY %2.sub3
224 %6:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
225 %7:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %6, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
226 %8:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %6, %4, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
230 # GFX11-LABEL: name: image_load_not_merged_3
231 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
232 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
234 name: image_load_not_merged_3
237 %0:sgpr_64 = COPY $sgpr0_sgpr1
238 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
239 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
240 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
241 %4:vgpr_32 = COPY %2.sub3
242 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
243 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
244 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
248 # GFX11-LABEL: name: image_load_not_merged_4
249 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
250 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
252 name: image_load_not_merged_4
255 %0:sgpr_64 = COPY $sgpr0_sgpr1
256 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
257 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
258 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
259 %4:vgpr_32 = COPY %2.sub3
260 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
261 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
262 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
266 # GFX11-LABEL: name: image_load_not_merged_5
267 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
268 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
270 name: image_load_not_merged_5
273 %0:sgpr_64 = COPY $sgpr0_sgpr1
274 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
275 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
276 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
277 %4:vgpr_32 = COPY %2.sub3
278 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
279 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
280 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
284 # GFX11-LABEL: name: image_load_not_merged_6
285 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
286 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
288 name: image_load_not_merged_6
291 %0:sgpr_64 = COPY $sgpr0_sgpr1
292 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
293 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
294 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
295 %4:vgpr_32 = COPY %2.sub3
296 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
297 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
298 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
302 # GFX11-LABEL: name: image_load_not_merged_7
303 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
304 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
306 name: image_load_not_merged_7
309 %0:sgpr_64 = COPY $sgpr0_sgpr1
310 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
311 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
312 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
313 %4:vgpr_32 = COPY %2.sub3
314 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
315 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
316 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 1, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
320 # GFX11-LABEL: name: image_load_not_merged_8
321 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V1_gfx11 %6, %3, 8, 1, -1, 0, 0, 1, 0, 0, 0, implicit $exec :: (dereferenceable load (s64), align 16, addrspace 4)
322 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
324 name: image_load_not_merged_8
327 %0:sgpr_64 = COPY $sgpr0_sgpr1
328 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
329 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
330 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
331 %4:vgpr_32 = COPY %2.sub3
332 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
333 %6:vgpr_32 = COPY %5.sub0
334 %7:vgpr_32 = IMAGE_LOAD_V1_V1_gfx11 %6, %3, 8, 1, -1, 0, 0, 1, 0, 0, 0, implicit $exec :: (dereferenceable load 8, align 16, addrspace 4)
335 %8:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
339 # GFX11-LABEL: name: image_load_not_merged_9
340 # GFX11: %{{[0-9]+}}:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 1, 0, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
341 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
343 name: image_load_not_merged_9
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:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 1, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
353 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
357 # GFX11-LABEL: name: image_load_not_merged_10
358 # GFX11: %{{[0-9]+}}:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 1, 0, implicit $exec :: (dereferenceable load (s32), addrspace 4)
359 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
361 name: image_load_not_merged_10
364 %0:sgpr_64 = COPY $sgpr0_sgpr1
365 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
366 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
367 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
368 %4:vgpr_32 = COPY %2.sub3
369 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
370 %6:vreg_64 = IMAGE_LOAD_V2_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 1, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
371 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
375 # GFX11-LABEL: name: image_load_not_merged_11
376 # GFX11: %{{[0-9]+}}:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 1, implicit $exec :: (dereferenceable load (s32), addrspace 4)
377 # GFX11: %{{[0-9]+}}:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 4)
379 name: image_load_not_merged_11
382 %0:sgpr_64 = COPY $sgpr0_sgpr1
383 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
384 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
385 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
386 %4:vgpr_32 = COPY %2.sub3
387 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
388 %6:vgpr_32 = IMAGE_LOAD_V1_V2_gfx11 %5, %3, 8, 1, -1, 0, 0, 0, 0, 0, 1, implicit $exec :: (dereferenceable load 4, addrspace 4)
389 %7:vreg_96 = IMAGE_LOAD_V3_V2_gfx11 %5, %3, 7, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
393 # GFX11-LABEL: name: image_load_mip_merged_v1v3
394 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_MIP_V4_V3_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
395 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub0
396 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub1_sub2_sub3
398 name: image_load_mip_merged_v1v3
401 %0:sgpr_64 = COPY $sgpr0_sgpr1
402 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
403 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
404 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
405 %4:vgpr_32 = COPY %2.sub3
406 %5:vreg_96 = BUFFER_LOAD_DWORDX3_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
407 %6:vgpr_32 = IMAGE_LOAD_MIP_V1_V3_gfx11 %5:vreg_96, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
408 %7:vreg_96 = IMAGE_LOAD_MIP_V3_V3_gfx11 %5:vreg_96, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
414 # GFX11-LABEL: name: image_load_mip_pck_merged_v1v3
415 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_MIP_PCK_V4_V3_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
416 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub0
417 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub1_sub2_sub3
419 name: image_load_mip_pck_merged_v1v3
422 %0:sgpr_64 = COPY $sgpr0_sgpr1
423 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
424 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
425 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
426 %4:vgpr_32 = COPY %2.sub3
427 %5:vreg_96 = BUFFER_LOAD_DWORDX3_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
428 %6:vgpr_32 = IMAGE_LOAD_MIP_PCK_V1_V3_gfx11 %5:vreg_96, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
429 %7:vreg_96 = IMAGE_LOAD_MIP_PCK_V3_V3_gfx11 %5:vreg_96, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
435 # GFX11-LABEL: name: image_load_mip_pck_sgn_merged_v1v3
436 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_MIP_PCK_SGN_V4_V3_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
437 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub0
438 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub1_sub2_sub3
440 name: image_load_mip_pck_sgn_merged_v1v3
443 %0:sgpr_64 = COPY $sgpr0_sgpr1
444 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
445 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
446 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
447 %4:vgpr_32 = COPY %2.sub3
448 %5:vreg_96 = BUFFER_LOAD_DWORDX3_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
449 %6:vgpr_32 = IMAGE_LOAD_MIP_PCK_SGN_V1_V3_gfx11 %5:vreg_96, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
450 %7:vreg_96 = IMAGE_LOAD_MIP_PCK_SGN_V3_V3_gfx11 %5:vreg_96, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
454 # GFX11-LABEL: name: image_load_pck_merged_v1v3
455 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_PCK_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
456 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub0
457 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub1_sub2_sub3
459 name: image_load_pck_merged_v1v3
462 %0:sgpr_64 = COPY $sgpr0_sgpr1
463 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
464 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
465 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
466 %4:vgpr_32 = COPY %2.sub3
467 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
468 %6:vgpr_32 = IMAGE_LOAD_PCK_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
469 %7:vreg_96 = IMAGE_LOAD_PCK_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)
473 # GFX11-LABEL: name: image_load_pck_sgn_merged_v1v3
474 # GFX11: %{{[0-9]+}}:vreg_128 = IMAGE_LOAD_PCK_SGN_V4_V2_gfx11 %5, %3, 15, 1, -1, 0, 0, 0, 0, 0, implicit $exec, implicit $exec :: (dereferenceable load (s128), align 4, addrspace 4)
475 # GFX11: %{{[0-9]+}}:vgpr_32 = COPY %8.sub0
476 # GFX11: %{{[0-9]+}}:vreg_96 = COPY killed %8.sub1_sub2_sub3
478 name: image_load_pck_sgn_merged_v1v3
481 %0:sgpr_64 = COPY $sgpr0_sgpr1
482 %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM %0, 36, 0
483 %2:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr99
484 %3:sgpr_256 = S_LOAD_DWORDX8_IMM %1, 208, 0
485 %4:vgpr_32 = COPY %2.sub3
486 %5:vreg_64 = BUFFER_LOAD_DWORDX2_OFFSET %2:sgpr_128, 0, 0, 0, 0, implicit $exec :: (dereferenceable invariant load 16)
487 %6:vgpr_32 = IMAGE_LOAD_PCK_SGN_V1_V2_gfx11 %5:vreg_64, %3:sgpr_256, 1, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 4, addrspace 4)
488 %7:vreg_96 = IMAGE_LOAD_PCK_SGN_V3_V2_gfx11 %5:vreg_64, %3:sgpr_256, 14, 1, -1, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 12, align 16, addrspace 4)