InstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe
commit188cca3dd5788c21d8ba1c3bc73ab2e61e6ce50b
authorTom Stellard <tstellar@redhat.com>
Thu, 8 Nov 2018 17:57:57 +0000 (8 17:57 +0000)
committerTom Stellard <tstellar@redhat.com>
Thu, 8 Nov 2018 17:57:57 +0000 (8 17:57 +0000)
tree0bc832dcc9d3f4c26a5ee9be8b422453089ed268
parentda31f7b67012692bb019e53b70df1f8f0c388bcd
InstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe

Summary:
When the 3rd argument to these intrinsics is zero, lowering them
to shift instructions produces poison values, since we end up with
shift amounts equal to the number of bits in the shifted value.  This
means we can only lower these intrinsics if we can prove that the
3rd argument is not zero.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: bnieuwenhuizen, jvesely, wdng, nhaehnle, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346422 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll