Skip to content

Commit 94230ce

Browse files
authored
[AMDGPU] Fix lack of LDS DMA check in the AA handling (#75249)
SIInstrInfo::areMemAccessesTriviallyDisjoint does a DS offset checks, but does not account for LDS DMA instructions. Added these checks. Without it code falls through and returns true which is wrong. As a result mayAlias would always return false for LDS DMA and a regular LDS instruction or 2 LDS DMA instructions. At the moment this is NFCI because we do not use this AA in a context which may touch LDS DMA instructions. This is also unreacheable now because of the ordered memory ref checks just above in the function and LDS DMA is marked as volatile. This volatile marking is removed in PR #75247, therefore I'd submit this check before #75247.
1 parent 4f54d71 commit 94230ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,6 +3654,9 @@ bool SIInstrInfo::areMemAccessesTriviallyDisjoint(const MachineInstr &MIa,
36543654
if (MIa.hasOrderedMemoryRef() || MIb.hasOrderedMemoryRef())
36553655
return false;
36563656

3657+
if (isLDSDMA(MIa) || isLDSDMA(MIb))
3658+
return false;
3659+
36573660
// TODO: Should we check the address space from the MachineMemOperand? That
36583661
// would allow us to distinguish objects we know don't alias based on the
36593662
// underlying address space, even if it was lowered to a different one,

0 commit comments

Comments
 (0)