[AMDGPU] Implement llvm.amdgcn.set.inactive intrinsic
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 4 Aug 2017 18:36:54 +0000 (18:36 +0000)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 4 Aug 2017 18:36:54 +0000 (18:36 +0000)
commit66b9bd6e503bdd87616ab04509ffb3f70220c281
treeef831c300d054fcfca5e13142fa969db41c3fbf5
parent92638ab62559ce082c02680efca7280344ca05dd
[AMDGPU] Implement llvm.amdgcn.set.inactive intrinsic

Summary:
This intrinsic lets us set inactive lanes to an identity value when
implementing wavefront reductions. In combination with Whole Wavefront
Mode, it lets inactive lanes be skipped over as required by GLSL/Vulkan.
Lowering the intrinsic needs to happen post-RA so that RA knows that the
destination isn't completely overwritten due to the EXEC shenanigans, so
we need another pseudo-instruction to represent the un-lowered
intrinsic.

Reviewers: tstellar, arsenm

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

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

llvm-svn: 310088
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.set.inactive.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/wqm.ll