Skip to content

Commit

Permalink
SWDEV-139118 fix missing s_waitcnt
Browse files Browse the repository at this point in the history
The pass that adds s_waitcnt instructions where needed was prematurely ending
processing when traversing the blocks, with the result that required s_waitcnts
were sometimes not insterted resulting in incorrect shader behaviour.

Change-Id: I9f6e1d5affe5f7ea5d243bc697d1a77038551d86
  • Loading branch information
Tim Corringham committed Nov 23, 2017
1 parent 56a9cab commit eb5eb1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Target/AMDGPU/SIInsertWaitcnts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ void SIInsertWaitcnts::mergeInputScoreBrackets(MachineBasicBlock &Block) {
BlockWaitcntBracketsMap[pred].get();
bool Visited = BlockVisitedSet.find(pred) != BlockVisitedSet.end();
if (!Visited || PredScoreBrackets->getWaitAtBeginning()) {
break;
continue;
}
for (enum InstCounterType T = VM_CNT; T < NUM_INST_CNTS;
T = (enum InstCounterType)(T + 1)) {
Expand Down Expand Up @@ -1310,7 +1310,7 @@ void SIInsertWaitcnts::mergeInputScoreBrackets(MachineBasicBlock &Block) {
BlockWaitcntBracketsMap[Pred].get();
bool Visited = BlockVisitedSet.find(Pred) != BlockVisitedSet.end();
if (!Visited || PredScoreBrackets->getWaitAtBeginning()) {
break;
continue;
}

int GDSSpan = PredScoreBrackets->getEventUB(GDS_GPR_LOCK) -
Expand Down Expand Up @@ -1357,7 +1357,7 @@ void SIInsertWaitcnts::mergeInputScoreBrackets(MachineBasicBlock &Block) {
// Set the register scoreboard.
for (MachineBasicBlock *Pred : Block.predecessors()) {
if (BlockVisitedSet.find(Pred) == BlockVisitedSet.end()) {
break;
continue;
}

BlockWaitcntBrackets *PredScoreBrackets =
Expand Down Expand Up @@ -1471,7 +1471,7 @@ void SIInsertWaitcnts::mergeInputScoreBrackets(MachineBasicBlock &Block) {
// the delayed nature of these operations.
for (MachineBasicBlock *Pred : Block.predecessors()) {
if (BlockVisitedSet.find(Pred) == BlockVisitedSet.end()) {
break;
continue;
}

BlockWaitcntBrackets *PredScoreBrackets =
Expand Down

0 comments on commit eb5eb1c

Please sign in to comment.