Skip to content

Commit 8042095

Browse files
committed
Refactor with hasMixedPendingEvents. NFC.
This is just stylistic. It allows using the identical condition in the SMEM and VMEM cases and potentially guards against more X_CNT event types being added in future.
1 parent 5b828b0 commit 8042095

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ void WaitcntBrackets::applyXcnt(const AMDGPU::Waitcnt &Wait) {
12961296
// SMEM can return out of order, so only omit XCNT wait if we are waiting till
12971297
// zero.
12981298
if (Wait.KmCnt == 0 && hasPendingEvent(SMEM_GROUP)) {
1299-
if (hasPendingEvent(VMEM_GROUP))
1299+
if (hasMixedPendingEvents(X_CNT))
13001300
PendingEvents &= ~(1 << SMEM_GROUP);
13011301
else
13021302
applyWaitcnt(X_CNT, 0);
@@ -1308,7 +1308,7 @@ void WaitcntBrackets::applyXcnt(const AMDGPU::Waitcnt &Wait) {
13081308
// decremented to the same number as LOADCnt.
13091309
if (Wait.LoadCnt != ~0u && hasPendingEvent(VMEM_GROUP) &&
13101310
!hasPendingEvent(STORE_CNT)) {
1311-
if (hasPendingEvent(SMEM_GROUP))
1311+
if (hasMixedPendingEvents(X_CNT))
13121312
PendingEvents &= ~(1 << VMEM_GROUP);
13131313
else
13141314
applyWaitcnt(X_CNT, std::min(Wait.XCnt, Wait.LoadCnt));

0 commit comments

Comments
 (0)