[x86] Fix yet another issue with widening vector shuffle elements.

I spotted this by inspection when debugging something else, so I have no
test case what-so-ever, and am not even sure it is possible to
realistically trigger the bug. But this is what was intended here.

llvm-svn: 218565
This commit is contained in:
Chandler Carruth 2014-09-27 08:40:33 +00:00
parent 5ed88de99b
commit f4b9e6b9d9
1 changed files with 2 additions and 2 deletions

View File

@ -9884,11 +9884,11 @@ static bool canWidenShuffleElements(ArrayRef<int> Mask,
// Check for an undef mask and a mask value properly aligned to fit with
// a pair of values. If we find such a case, use the non-undef mask's value.
if (Mask[i] == -1 && Mask[i + 1] % 2 == 1) {
if (Mask[i] == -1 && Mask[i + 1] >= 0 && Mask[i + 1] % 2 == 1) {
WidenedMask.push_back(Mask[i + 1] / 2);
continue;
}
if (Mask[i + 1] == -1 && Mask[i] % 2 == 0) {
if (Mask[i + 1] == -1 && Mask[i] >= 0 && Mask[i] % 2 == 0) {
WidenedMask.push_back(Mask[i] / 2);
continue;
}