]> granicus.if.org Git - llvm/commitdiff
[X86] getFauxShuffleMask - bail for non-byte aligned shuffle types
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 16 Jan 2019 18:15:31 +0000 (18:15 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 16 Jan 2019 18:15:31 +0000 (18:15 +0000)
Remove the existing assertion and just return false for unexpected shuffle value types (<X x i1> mainly....).

Found while updating combineX86ShufflesRecursively to run within SimplifyDemandedVectorElts/SimplifyDemandedBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351365 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index f0f5f6fc18197a1e2c2b379d545410b6375327e9..9e17f4c455a3ebcdbc0732f497e8b19a7098b580 100644 (file)
@@ -6483,8 +6483,8 @@ static bool getFauxShuffleMask(SDValue N, SmallVectorImpl<int> &Mask,
   unsigned NumElts = VT.getVectorNumElements();
   unsigned NumSizeInBits = VT.getSizeInBits();
   unsigned NumBitsPerElt = VT.getScalarSizeInBits();
-  assert((NumBitsPerElt % 8) == 0 && (NumSizeInBits % 8) == 0 &&
-         "Expected byte aligned value types");
+  if ((NumBitsPerElt % 8) != 0 || (NumSizeInBits % 8) != 0)
+    return false;
 
   unsigned Opcode = N.getOpcode();
   switch (Opcode) {