OSDN Git Service

AMDGPU: fix missing s_waitcnt
authorTim Corringham <tcorring@amd.com>
Mon, 4 Dec 2017 12:30:49 +0000 (12:30 +0000)
committerTim Corringham <tcorring@amd.com>
Mon, 4 Dec 2017 12:30:49 +0000 (12:30 +0000)
commit1e6aa1171dfd1536e74c174e4e412b78cedcac24
tree1f3753d26530967c9f8b5b61835af53fa283f587
parenta53a7f062724ce041e148dd26df1f2fb5073d8d6
AMDGPU: fix missing s_waitcnt

Summary:
The pass that inserts s_waitcnt instructions where needed propagated
info used to track dependencies for each block by iterating over the
predecessor blocks. The iteration was terminated when a predecessor
that had not yet been processed was encountered. Any info in blocks
later in the list was therefore not processed, leading to the
possiblility of a required s_waitcnt not being inserted.

The fix is simply to change the "break" to "continue" for the
relevant loops, so that all visited blocks are processed. This
is likely what was intended when the code was written.

There is no test case provided for this fix because:
1) the only example that reproduces this is large and resistant to
being reduced
2) the change is trivial

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Differential Revision: https://reviews.llvm.org/D40544

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319651 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIInsertWaitcnts.cpp