Skip to content

Commit 06c1b3e

Browse files
committed
addressed suggested changes
1 parent b7a84e4 commit 06c1b3e

File tree

2 files changed

+15
-54
lines changed

2 files changed

+15
-54
lines changed

llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,9 @@ SILoadStoreOptimizer::checkAndPrepareMerge(CombineInfo &CI,
13521352
DataRC1, SubReg);
13531353
}
13541354

1355+
if (Data0->getReg().isPhysical() || Data1->getReg().isPhysical()) {
1356+
return nullptr;
1357+
}
13551358
bool canBeConstrainedData0 =
13561359
MRI->constrainRegClass(Data0->getReg(), DataRC0);
13571360
bool canBeConstrainedData1 =

llvm/test/CodeGen/AMDGPU/load-store-opt-ds-regclass-constrain.mir

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,17 @@ body: |
217217
; CHECK-LABEL: name: ds_write_b32__av32_physical
218218
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2
219219
; CHECK-NEXT: {{ $}}
220-
; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
221-
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
222-
; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
223-
; CHECK-NEXT: DS_WRITE2_B32_gfx9 [[COPY]], [[COPY1]], [[COPY2]], 10, 24, 0, implicit $exec :: (store (s32), addrspace 3)
220+
; CHECK-NEXT: %0:vgpr_32 = COPY $vgpr0
221+
; CHECK-NEXT: %1:av_32 = COPY $vgpr1
222+
; CHECK-NEXT: DS_WRITE_B32_gfx9 %0, %1, 40, 0, implicit $exec :: (store (s32), addrspace 3)
223+
; CHECK-NEXT: DS_WRITE_B32_gfx9 %0, $vgpr2, 96, 0, implicit $exec :: (store (s32), addrspace 3)
224+
224225
%0:vgpr_32 = COPY $vgpr0
225226
%1:av_32 = COPY $vgpr1
226227
DS_WRITE_B32_gfx9 %0, %1, 40, 0, implicit $exec :: (store (s32), addrspace 3)
227228
DS_WRITE_B32_gfx9 %0, $vgpr2, 96, 0, implicit $exec :: (store (s32), addrspace 3)
228229
...
229230

230-
...
231-
232231
---
233232
name: ds_write_b32__physical_av32
234233
body: |
@@ -238,54 +237,13 @@ body: |
238237
; CHECK-LABEL: name: ds_write_b32__physical_av32
239238
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2
240239
; CHECK-NEXT: {{ $}}
241-
; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
242-
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr2
243-
; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr1
244-
; CHECK-NEXT: DS_WRITE2_B32_gfx9 [[COPY]], [[COPY2]], [[COPY1]], 10, 24, 0, implicit $exec :: (store (s32), addrspace 3)
245-
%0:vgpr_32 = COPY $vgpr0
246-
%2:av_32 = COPY $vgpr2
247-
DS_WRITE_B32_gfx9 %0, $vgpr1, 40, 0, implicit $exec :: (store (s32), addrspace 3)
248-
DS_WRITE_B32_gfx9 %0, %2, 96, 0, implicit $exec :: (store (s32), addrspace 3)
249-
...
250-
251-
---
252-
name: ds_write_b64__physical_av64
253-
body: |
254-
bb.0:
255-
liveins: $vgpr0, $vgpr2_vgpr3, $vgpr4_vgpr5
240+
; CHECK-NEXT: %0:vgpr_32 = COPY $vgpr0
241+
; CHECK-NEXT: %1:av_32 = COPY $vgpr2
242+
; CHECK-NEXT: DS_WRITE_B32_gfx9 %0, $vgpr1, 40, 0, implicit $exec :: (store (s32), addrspace 3)
243+
; CHECK-NEXT: DS_WRITE_B32_gfx9 %0, %1, 96, 0, implicit $exec :: (store (s32), addrspace 3)
256244
257-
; CHECK-LABEL: name: ds_write_b64__physical_av64
258-
; CHECK: liveins: $vgpr0, $vgpr2_vgpr3, $vgpr4_vgpr5
259-
; CHECK-NEXT: {{ $}}
260-
; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
261-
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = COPY $vgpr2_vgpr3
262-
; CHECK-NEXT: [[COPY2:%[0-9]+]]:vreg_64_align2 = COPY $vgpr4_vgpr5
263-
; CHECK-NEXT: DS_WRITE2_B64_gfx9 [[COPY]], [[COPY1]], [[COPY2]], 5, 12, 0, implicit $exec :: (store (s64), addrspace 3)
264245
%0:vgpr_32 = COPY $vgpr0
265-
%1:av_64_align2 = COPY $vgpr2_vgpr3
266-
DS_WRITE_B64_gfx9 %0, %1, 40, 0, implicit $exec :: (store (s64), addrspace 3)
267-
DS_WRITE_B64_gfx9 %0, $vgpr4_vgpr5, 96, 0, implicit $exec :: (store (s64), addrspace 3)
268-
...
269-
270-
246+
%1:av_32 = COPY $vgpr2
247+
DS_WRITE_B32_gfx9 %0, $vgpr1, 40, 0, implicit $exec :: (store (s32), addrspace 3)
248+
DS_WRITE_B32_gfx9 %0, %1, 96, 0, implicit $exec :: (store (s32), addrspace 3)
271249
...
272-
273-
---
274-
name: ds_write_b64__av64__physical
275-
body: |
276-
bb.0:
277-
liveins: $vgpr0, $vgpr2_vgpr3, $vgpr4_vgpr5
278-
279-
; CHECK-LABEL: name: ds_write_b64__av64__physical
280-
; CHECK: liveins: $vgpr0, $vgpr2_vgpr3, $vgpr4_vgpr5
281-
; CHECK-NEXT: {{ $}}
282-
; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
283-
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = COPY $vgpr4_vgpr5
284-
; CHECK-NEXT: [[COPY2:%[0-9]+]]:vreg_64_align2 = COPY $vgpr2_vgpr3
285-
; CHECK-NEXT: DS_WRITE2_B64_gfx9 [[COPY]], [[COPY2]], [[COPY1]], 5, 12, 0, implicit $exec :: (store (s64), addrspace 3)
286-
%0:vgpr_32 = COPY $vgpr0
287-
%2:av_64_align2 = COPY $vgpr4_vgpr5
288-
DS_WRITE_B64_gfx9 %0, $vgpr2_vgpr3, 40, 0, implicit $exec :: (store (s64), addrspace 3)
289-
DS_WRITE_B64_gfx9 %0, %2, 96, 0, implicit $exec :: (store (s64), addrspace 3)
290-
...
291-

0 commit comments

Comments
 (0)