[SelectionDAG] Enable SimplifyDemandedVectorElts support for simplifying shuffle...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 16 Feb 2018 16:22:14 +0000 (16:22 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 16 Feb 2018 16:22:14 +0000 (16:22 +0000)
commitff53a4a23467dde54233e1b7fe51e8049dfb6dda
tree87ab1d8f3dc4727df9d63888d6cf87a94c7f4551
parent65da14d6c8538428356e8450d9bd50a140abd04e
[SelectionDAG] Enable SimplifyDemandedVectorElts support for simplifying shuffle masks

Based off the DemandedElts mask the and UNDEF elements returned from the SimplifyDemandedVectorElts calls to the shuffle operands, we can attempt to simplify the shuffle mask.

I had to be very conservative here as accepting post-legalized shuffle masks could cause problems for targets that legalize UNDEF mask elements back to inrange values (PowerPC), similarly combining to identity shuffle masks could cause too much UNDEF information to disappear for later combines.

llvm-svn: 325354
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/X86/sse3.ll
llvm/test/CodeGen/X86/vector-shuffle-128-v4.ll
llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll