OSDN Git Service

[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)
commite0288d90cb0ee719325d4edefe57d8c805c21324
tree7419f8e17c2fbd46658e9c0d15ab2a43be426038
parenta60b694525c6ea43c57941dc3756d344a6dedb7e
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325354 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/sse3.ll
test/CodeGen/X86/vector-shuffle-128-v4.ll
test/CodeGen/X86/vector-shuffle-combining-avx2.ll