[PATCH] D18162: AMDGPU: Add SIWholeQuadMode pass

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 15:03:50 PDT 2016


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, tstellarAMD, mareko.
nhaehnle added a subscriber: llvm-commits.
Herald added subscribers: arsenm, MatzeB.

Whole quad mode is already enabled for pixel shaders that compute
derivatives, but it must be suspended for instructions that cause a
shader to have side effects (i.e. stores and atomics).

This pass addresses the issue by storing the real (initial) live mask
in a register, masking EXEC before instructions that require exact
execution and (re-)enabling WQM where required.

This pass is run before register coalescing so that we can use
machine SSA for analysis.

The changes in this patch expose a problem with the second machine
scheduling pass: target independent instructions like COPY implicitly
use EXEC when they operate on VGPRs, but this fact is not encoded in
the MIR. This can lead to miscompilation because instructions are
moved past changes to EXEC.

This patch fixes the problem by adding use-implicit operands to
target independent instructions. Some general codegen passes are
relaxed to work with such implicit use operands.

http://reviews.llvm.org/D18162

Files:
  lib/CodeGen/ProcessImplicitDefs.cpp
  lib/CodeGen/TwoAddressInstructionPass.cpp
  lib/Target/AMDGPU/AMDGPU.h
  lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  lib/Target/AMDGPU/CMakeLists.txt
  lib/Target/AMDGPU/SILowerControlFlow.cpp
  lib/Target/AMDGPU/SIRegisterInfo.h
  lib/Target/AMDGPU/SIWholeQuadMode.cpp
  test/CodeGen/AMDGPU/si-scheduler.ll
  test/CodeGen/AMDGPU/wqm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18162.50655.patch
Type: text/x-patch
Size: 38601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160314/81ad86c7/attachment-0001.bin>


More information about the llvm-commits mailing list