[PATCH] D67767: [AMDGPU] Add llvm.amdgcn.wqm.demote intrinsic

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 07:59:04 PDT 2019


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

Add intrinsic which demotes all active lanes to helper lanes.
This is used to implement demote to helper Vulkan extension.

In practice demoting a lane to helper simply means removing it
from the mask of live lanes used for WQM/WWM/Exact mode.
Where the shader does not use WQM, demotes just become kills.

To support demote live lanes must now be tracked through entire
shader.  This involves adding PHI nodes during the WQM pass,
which can expose exec mask change issues.  This is overcome
by split blocks on changes from WQM/WWM to Exact mode.
As a result the WQM pass no longer preserves CFG, slot indexes
or live intervals as these is no way of maintaining these
when blocks are split.

Additionally add llvm.amdgcn.wqm.helper intrinsic to complement
demote operations.  In theory llvm.amdgcn.ps.live can be used
to detect helper lanes; however, ps.live can be moved by LICM.
The movement of ps.live cannot be remedied without changing
its type signature and such a change would require ps.live
users to update as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67767

Files:
  llvm/include/llvm/IR/IntrinsicsAMDGPU.td
  llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td
  llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/lib/Target/AMDGPU/SIInstructions.td
  llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
  llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
  llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wqm.demote.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67767.220868.patch
Type: text/x-patch
Size: 43155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190919/e16a822d/attachment.bin>


More information about the llvm-commits mailing list