[PATCH] D70418: AMDGPU: Handle waitcnt overflow

Austin Kerbow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 20:14:13 PST 2019


kerbowa created this revision.
kerbowa added reviewers: rampitec, arsenm.
Herald added subscribers: llvm-commits, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

The waitcnt pass can overflow the counters when the number of outstanding events
for a type exceed the capacity of the counter. This can lead to inefficient
insertion of waitcnts, or to waitcnt instructions with max values for each type.
The last situation can cause an instruction which when disassembled appears to
be an illegal waitcnt without an operand.

In these cases we should add a wait for the 'counter maximum' - 1, and update the
waitcnt brackets accordingly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70418

Files:
  llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
  llvm/test/CodeGen/AMDGPU/waitcnt-overflow.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70418.229965.patch
Type: text/x-patch
Size: 12753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191119/3a49cec9/attachment-0001.bin>


More information about the llvm-commits mailing list