[x86] Fix PR21139, one of the last remaining regressions found in the
authorChandler Carruth <chandlerc@gmail.com>
Sun, 5 Oct 2014 12:07:34 +0000 (12:07 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 5 Oct 2014 12:07:34 +0000 (12:07 +0000)
commit30ae72f02caa0f6af848a882f5489aae2dfb228d
treee6395f300114e0f9d57c2e61c08dbb425bb459d8
parenta644b090deabb4500a3f6c8610435a35aac0136a
[x86] Fix PR21139, one of the last remaining regressions found in the
new vector shuffle lowering.

This is loosely based on a patch by Marius Wachtler to the PR (thanks!).
I refactored it a bi to use std::count_if and a mutable array ref but
the core idea was exactly right. I also added some direct testing of
this case.

I believe PR21137 is now the only remaining regression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219081 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/vector-shuffle-128-v16.ll
test/CodeGen/X86/vector-zext.ll