[DAGCombiner] Combine shuffles of BUILD_VECTOR and SCALAR_TO_VECTOR
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 Apr 2015 10:02:21 +0000 (10:02 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 Apr 2015 10:02:21 +0000 (10:02 +0000)
commit4e60da755a221f080a25079abfcc021f7bf14f1c
tree44fc8589b2463c46de054bdd19fe55cfcc8f887d
parentc39f5dd0e2d689a10d1e7de3da07f1975c0aa8f4
[DAGCombiner] Combine shuffles of BUILD_VECTOR and SCALAR_TO_VECTOR

This patch attempts to fold the shuffling of 'scalar source' inputs - BUILD_VECTOR and SCALAR_TO_VECTOR nodes - if the shuffle node is the only user. This folds away a lot of unnecessary shuffle nodes, and allows quite a bit of constant folding that was being missed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234004 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/arm64-neon-copy.ll
test/CodeGen/AArch64/arm64-vshuffle.ll
test/CodeGen/PowerPC/vperm-lowering.ll
test/CodeGen/X86/mmx-bitcast.ll
test/CodeGen/X86/sse41.ll
test/CodeGen/X86/vec_insert-5.ll
test/CodeGen/X86/vec_insert-mmx.ll
test/CodeGen/X86/vec_zero_cse.ll
test/CodeGen/X86/vector-shuffle-128-v16.ll
test/CodeGen/X86/vector-shuffle-128-v8.ll