Skip to content

Commit 5b828b0

Browse files
committed
Simplify and inline applyPendingXcntGroup. NFC.
1 parent 5806f11 commit 5b828b0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,19 +1291,13 @@ void WaitcntBrackets::applyXcnt(const AMDGPU::Waitcnt &Wait) {
12911291
// On entry to a block with multiple predescessors, there may
12921292
// be pending SMEM and VMEM events active at the same time.
12931293
// In such cases, only clear one active event at a time.
1294-
auto applyPendingXcntGroup = [this](unsigned E) {
1295-
unsigned LowerBound = getScoreLB(X_CNT);
1296-
applyWaitcnt(X_CNT, 0);
1297-
PendingEvents |= (1 << E);
1298-
setScoreLB(X_CNT, LowerBound);
1299-
};
13001294

13011295
// Wait on XCNT is redundant if we are already waiting for a load to complete.
13021296
// SMEM can return out of order, so only omit XCNT wait if we are waiting till
13031297
// zero.
13041298
if (Wait.KmCnt == 0 && hasPendingEvent(SMEM_GROUP)) {
13051299
if (hasPendingEvent(VMEM_GROUP))
1306-
applyPendingXcntGroup(VMEM_GROUP);
1300+
PendingEvents &= ~(1 << SMEM_GROUP);
13071301
else
13081302
applyWaitcnt(X_CNT, 0);
13091303
return;
@@ -1315,7 +1309,7 @@ void WaitcntBrackets::applyXcnt(const AMDGPU::Waitcnt &Wait) {
13151309
if (Wait.LoadCnt != ~0u && hasPendingEvent(VMEM_GROUP) &&
13161310
!hasPendingEvent(STORE_CNT)) {
13171311
if (hasPendingEvent(SMEM_GROUP))
1318-
applyPendingXcntGroup(SMEM_GROUP);
1312+
PendingEvents &= ~(1 << VMEM_GROUP);
13191313
else
13201314
applyWaitcnt(X_CNT, std::min(Wait.XCnt, Wait.LoadCnt));
13211315
return;

0 commit comments

Comments
 (0)