Skip to content

Commit 4770a1e

Browse files
committed
[AMDGPU][SIInsertWaitCnts] move vmemaccess check
1 parent 44466c2 commit 4770a1e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,13 @@ bool SIInsertWaitcnts::generateWaitcntInstBefore(MachineInstr &MI,
20972097
Wait.DsCnt = 0;
20982098
}
20992099

2100+
// Since the translation for VMEM addresses occur in-order, we can skip the
2101+
// XCnt if the current instruction is of VMEM type and has a memory
2102+
// dependency with another VMEM instruction in flight.
2103+
if (isVmemAccess(MI)) {
2104+
Wait.XCnt = ~0u;
2105+
}
2106+
21002107
// Verify that the wait is actually needed.
21012108
ScoreBrackets.simplifyWaitcnt(Wait);
21022109

@@ -2168,13 +2175,6 @@ bool SIInsertWaitcnts::generateWaitcnt(AMDGPU::Waitcnt Wait,
21682175
<< "Update Instr: " << *It);
21692176
}
21702177

2171-
// Since the translation for VMEM addresses occur in-order, we can skip the
2172-
// XCnt if the current instruction is of VMEM type and has a memory
2173-
// dependency with another VMEM instruction in flight.
2174-
if (Wait.XCnt != ~0u && isVmemAccess(*It)) {
2175-
Wait.XCnt = ~0u;
2176-
}
2177-
21782178
if (WCG->createNewWaitcnt(Block, It, Wait))
21792179
Modified = true;
21802180

0 commit comments

Comments
 (0)