OSDN Git Service

[AMDGPU] Recognize x & ((1 << y) - 1) pattern.
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 15 Jun 2018 09:56:39 +0000 (09:56 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 15 Jun 2018 09:56:39 +0000 (09:56 +0000)
commitfc84800456fd417fd4c6482688ccad47abbafee8
treefa7c75815003cfb26eab1f23a5470d9baf8c6415
parent1d9a02a498e9127b7e1f67a0ae058bfe44f772c4
[AMDGPU] Recognize x & ((1 << y) - 1) pattern.

Summary:
As a followup for D48007.

Since we already handle `x << (bitwidth - y) >> (bitwidth - y)` pattern,
which does not have ub for both the edge cases (`y == 0`, `y == bitwidth`),
i think also handling a pattern that is ub for `y == bitwidth` should be fine.

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/D48010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334816 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUInstructions.td
test/CodeGen/AMDGPU/extract-lowbits.ll