Skip to content

Commit

Permalink
[X86] Only accept SM_SentinelUndef (-1) as an undefined shuffle mask …
Browse files Browse the repository at this point in the history
…in range

As discussed on D23027 we should be trying to be more strict on what is an undefined mask value.

llvm-svn: 279435
  • Loading branch information
RKSimon committed Aug 22, 2016
1 parent a1d9a67 commit 13fa330
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Expand Up @@ -4201,7 +4201,7 @@ bool X86TargetLowering::hasAndNotCompare(SDValue Y) const {
return true;
}

/// Val is either less than zero (undef) or equal to the specified value.
/// Val is the undef sentinel value or equal to the specified value.
static bool isUndefOrEqual(int Val, int CmpVal) {
return ((Val == SM_SentinelUndef) || (Val == CmpVal));
}
Expand All @@ -4212,10 +4212,10 @@ static bool isUndefOrZero(int Val) {
}

/// Return true if every element in Mask, beginning
/// from position Pos and ending in Pos+Size is undef.
/// from position Pos and ending in Pos+Size is the undef sentinel value.
static bool isUndefInRange(ArrayRef<int> Mask, unsigned Pos, unsigned Size) {
for (unsigned i = Pos, e = Pos + Size; i != e; ++i)
if (0 <= Mask[i])
if (Mask[i] != SM_SentinelUndef)
return false;
return true;
}
Expand Down

0 comments on commit 13fa330

Please sign in to comment.