[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)
commit8381475a7511c17e046bf25b53185a4d109df467
treea2d8f331cb2d9943e09310a1434cfdc90d5b9e93
parent9dea5cdb8ed79adcf44ca6200689cc5467d4ecf2
[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.

llvm-svn: 227002
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/X86/selectiondag-crash.ll [new file with mode: 0644]