[PATCH] D115747: [AMDGPU] Hoist waitcnt out of loops when they unecessarily wait for stores

Baptiste Saleil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 12:03:15 PST 2021


bsaleil created this revision.
bsaleil added a reviewer: AMDGPU.
bsaleil added projects: LLVM, AMDGPU.
Herald added subscribers: foad, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
bsaleil requested review of this revision.
Herald added subscribers: llvm-commits, wdng.

waitcnt vmcnt(0) are sometimes inserted in a loop body before using a loaded
value. On pre-GFX0 targets, If the loop also contains a vmem store, we'll
unnecessarily wait for the store to complete for each iteration. This patch
detects these cases and hoists the wait out of the loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115747

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115747.394334.patch
Type: text/x-patch
Size: 13607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211214/e8c2bcc9/attachment.bin>


More information about the llvm-commits mailing list