Skip to content

Commit d14c8f0

Browse files
committed
[X86] getFauxShuffleMask - don't allow undefs in constant for AND/ANDNP shuffle masks
Early out from getTargetConstantBitsFromNode call instead of just returning if an undef was found.
1 parent 23b233c commit d14c8f0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5719,12 +5719,13 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
57195719
SDValue N1 = N.getOperand(1);
57205720
bool IsAndN = (X86ISD::ANDNP == Opcode);
57215721
uint64_t ZeroMask = IsAndN ? 255 : 0;
5722-
if (!getTargetConstantBitsFromNode(IsAndN ? N0 : N1, 8, UndefElts, EltBits))
5722+
if (!getTargetConstantBitsFromNode(IsAndN ? N0 : N1, 8, UndefElts, EltBits,
5723+
/*AllowWholeUndefs*/ false,
5724+
/*AllowPartialUndefs*/ false))
57235725
return false;
57245726
// We can't assume an undef src element gives an undef dst - the other src
57255727
// might be zero.
5726-
if (!UndefElts.isZero())
5727-
return false;
5728+
assert(UndefElts.isZero() && "Expected UNDEF element in AND/ANDNP mask");
57285729
for (int i = 0, e = (int)EltBits.size(); i != e; ++i) {
57295730
const APInt &ByteBits = EltBits[i];
57305731
if (ByteBits != 0 && ByteBits != 255)

0 commit comments

Comments
 (0)