[InstCombine] Allow values with multiple users in SimplifyDemandedVectorElts
authorPiotr Sobczak <piotr.sobczak@amd.com>
Mon, 21 Oct 2019 08:12:47 +0000 (08:12 +0000)
committerPiotr Sobczak <piotr.sobczak@amd.com>
Mon, 21 Oct 2019 08:12:47 +0000 (08:12 +0000)
commita861c9aef926f963ea31581bebbd197356323928
tree742e728b082ef23f6c99f3c1cac36dca6d56b7f5
parent01e177ede563680faebc57dcda707632b1b9a45d
[InstCombine] Allow values with multiple users in SimplifyDemandedVectorElts

Summary:
Allow for ignoring the check for a single use in SimplifyDemandedVectorElts
to be able to simplify operands if DemandedElts is known to contain
the union of elements used by all users.
It is a responsibility of a caller of SimplifyDemandedVectorElts to
supply correct DemandedElts.

Simplify a series of extractelement instructions if only a subset of
elements is used.

Reviewers: reames, arsenm, majnemer, nhaehnle

Reviewed By: nhaehnle

Subscribers: wdng, jvesely, nhaehnle, llvm-commits

Tags: #llvm

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

llvm-svn: 375395
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-demanded-vector-elts.ll