[DagCombiner] Allow shuffles to merge through bitcasts
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 5 Mar 2015 17:14:04 +0000 (17:14 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 5 Mar 2015 17:14:04 +0000 (17:14 +0000)
commita744a15e97506ff09a6ac380083a9f0006c695f7
tree6142c6ac7a90cda527967c9461560ac39af770b5
parentcc2c1c9bf6bf5593ff44d0698fd0421189729293
[DagCombiner] Allow shuffles to merge through bitcasts

Currently shuffles may only be combined if they are of the same type, despite the fact that bitcasts are often introduced in between shuffle nodes (e.g. x86 shuffle type widening).

This patch allows a single input shuffle to peek through bitcasts and if the input is another shuffle will merge them, shuffling using the smallest sized type, and re-applying the bitcasts at the inputs and output instead.

Dropped old ShuffleToZext test - this patch removes the use of the zext and vector-zext.ll covers these anyhow.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231380 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/2013-02-12-ShuffleToZext.ll [deleted file]
test/CodeGen/X86/vector-shuffle-128-v16.ll
test/CodeGen/X86/vector-shuffle-128-v2.ll
test/CodeGen/X86/vector-shuffle-128-v4.ll
test/CodeGen/X86/vector-shuffle-256-v4.ll
test/CodeGen/X86/vector-shuffle-mmx.ll