[AMDGPU] Recognize x & (-1 >> (32 - y)) pattern.
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 15 Jun 2018 09:56:31 +0000 (09:56 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 15 Jun 2018 09:56:31 +0000 (09:56 +0000)
commitaa8587d1fcfba6b54a826d2590ddf477261b6800
treeb8e2fff13843117ae1b495003829784f1ca8d156
parent1503fc0fd018ad30e02bb8c880330a2e351e4e76
[AMDGPU] Recognize  x &  (-1 >> (32 - y))  pattern.

Summary:
D47980 will canonicalize the `x << (32 - y) >> (32 - y)`,
which is the pattern the AMDGPU expects to `x &  (-1 >> (32 - y))`,
which is not recognized by AMDGPU.

Thus, it needs to be recognized, too.

Reviewers: nhaehnle, bogner, tstellar, arsenm

Reviewed By: arsenm

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

Tags: #amdgpu

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

llvm-svn: 334815
llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
llvm/test/CodeGen/AMDGPU/extract-lowbits.ll