mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
R600/SI: Insert s_waitcnt before s_barrier instructions.
This ensures that all memory operations are complete when all threads reach the barrier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225290 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -428,7 +428,11 @@ bool SIInsertWaits::runOnMachineFunction(MachineFunction &MF) {
|
||||
for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
|
||||
I != E; ++I) {
|
||||
|
||||
Changes |= insertWait(MBB, I, handleOperands(*I));
|
||||
// Wait for everything before a barrier.
|
||||
if (I->getOpcode() == AMDGPU::S_BARRIER)
|
||||
Changes |= insertWait(MBB, I, LastIssued);
|
||||
else
|
||||
Changes |= insertWait(MBB, I, handleOperands(*I));
|
||||
pushInstruction(MBB, I);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user