[DAG] Fix wrong canonicalization performed on shuffle nodes.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Sat, 24 Jan 2015 11:54:29 +0000 (11:54 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Sat, 24 Jan 2015 11:54:29 +0000 (11:54 +0000)
commitb981dc4a2139ee0adf5748d65a25252ba9faef82
tree1774e9edf6aee0d852cbfefa8922c7fd55a32603
parent047f8903b4314a50220d20650bfbf4199e148682
[DAG] Fix wrong canonicalization performed on shuffle nodes.

This fixes a regression introduced by r226816.
When replacing a splat shuffle node with a constant build_vector,
make sure that the new build_vector has a valid number of elements.

Thanks to Patrik Hagglund for reporting this problem and providing a
small reproducible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227002 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/selectiondag-crash.ll [new file with mode: 0644]