[DAGCombiner] Fold CONCAT_VECTORS of EXTRACT_SUBVECTOR (or undef) to VECTOR_SHUFFLE.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 19 Aug 2015 20:09:50 +0000 (20:09 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 19 Aug 2015 20:09:50 +0000 (20:09 +0000)
commit4d3b3bf51b977bb852b83cd9266344f56f6b9c72
treea0c0d1eb7612d96207ac4ec2d01ee95b31142109
parent42bf5e9e58d4c539e2a8f7363bdc7134f1b343c5
[DAGCombiner] Fold CONCAT_VECTORS of EXTRACT_SUBVECTOR (or undef) to VECTOR_SHUFFLE.

Check to see if this is a CONCAT_VECTORS of a bunch of EXTRACT_SUBVECTOR operations. If so, and if the EXTRACT_SUBVECTOR vector inputs come from at most two distinct vectors the same size as the result, attempt to turn this into a legal shuffle.

Differential Revision: http://reviews.llvm.org/D12125

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245490 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/pr15267.ll
test/CodeGen/X86/vector-shuffle-256-v16.ll
test/CodeGen/X86/vector-shuffle-256-v4.ll
test/CodeGen/X86/vector-shuffle-256-v8.ll