AMDGPU: Add a fast path for icmp.i1(src, false, NE)
authorMarek Olsak <marek.olsak@amd.com>
Tue, 15 Jan 2019 02:13:18 +0000 (02:13 +0000)
committerMarek Olsak <marek.olsak@amd.com>
Tue, 15 Jan 2019 02:13:18 +0000 (02:13 +0000)
commit33eb4d947d82de533d132598b3d568363170af3d
tree4f4ac5c08a982c0726d99c8329d4597120070011
parentf793fe14022b727502a9aaba4fd3aabcde737155
AMDGPU: Add a fast path for icmp.i1(src, false, NE)

Summary:
This allows moving the condition from the intrinsic to the standard ICmp
opcode, so that LLVM can do simplifications on it. The icmp.i1 intrinsic
is an identity for retrieving the SGPR mask.

And we can also get the mask from and i1, or i1, xor i1.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 351150
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.icmp.ll
llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll