[X86] Fixes bug in build_vector v4x32 lowering
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Sun, 23 Nov 2014 13:09:06 +0000 (13:09 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Sun, 23 Nov 2014 13:09:06 +0000 (13:09 +0000)
commitd5391478340c6e63b28d03c29ea9fde580b38e93
tree70e77a037974c926214144964db2e8a165b5ee84
parent71777d18adaefa3aa9e6c0874835ca45ff636f72
[X86] Fixes bug in build_vector v4x32 lowering

r222375 made some improvements to build_vector lowering of v4x32 and v4xf32 into an insertps, but it missed a case where:

1. A single extracted element is used twice.
2. The lower of the two non-zero indexes should be preserved, and the higher should be used for the dest mask.

This caused a crash, since the source value for the insertps ends-up uninitialized.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222635 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/sse41.ll