AMDGPU/SI: add llvm.amdgcn.ps.live intrinsic
authorNicolai Haehnle <nhaehnle@gmail.com>
Fri, 22 Apr 2016 04:04:08 +0000 (04:04 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Fri, 22 Apr 2016 04:04:08 +0000 (04:04 +0000)
commitb0c97487094ce0fd14ec4516a382b449a5631bbf
tree146a88e308ad355886e65ef63de1031dcfff33ba
parent5dff95c04de0d096563462530160fd5fc221fd8f
AMDGPU/SI: add llvm.amdgcn.ps.live intrinsic

Summary:
This intrinsic returns true if the current thread belongs to a live pixel
and false if it belongs to a pixel that we are executing only for derivative
computation. It will be used by Mesa to implement gl_HelperInvocation.

Note that for pixels that are killed during the shader, this implementation
also returns true, but it doesn't matter because those pixels are always
disabled in the EXEC mask.

This unearthed a corner case in the instruction verifier, which complained
about a v_cndmask 0, 1, exec, exec<imp-use> instruction. That's stupid but
correct code, so make the verifier accept it as such.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D19191

llvm-svn: 267102
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/CodeGen/MachineInstr.cpp
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ps.live.ll [new file with mode: 0644]