[llvm] r283050 - [X86][SSE] Cleaned up shuffle decode assertion messages

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 1 13:12:57 PDT 2016


Author: rksimon
Date: Sat Oct  1 15:12:56 2016
New Revision: 283050

URL: http://llvm.org/viewvc/llvm-project?rev=283050&view=rev
Log:
[X86][SSE] Cleaned up shuffle decode assertion messages

Modified:
    llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp

Modified: llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp?rev=283050&r1=283049&r2=283050&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp Sat Oct  1 15:12:56 2016
@@ -69,9 +69,10 @@ static bool extractConstantMask(const Co
   }
 
   // Now extract the undef/constant bit data into the raw shuffle masks.
-  assert((CstSizeInBits % MaskEltSizeInBits) == 0 && "");
-  unsigned NumMaskElts = CstSizeInBits / MaskEltSizeInBits;
+  assert((CstSizeInBits % MaskEltSizeInBits) == 0 &&
+         "Unaligned shuffle mask size");
 
+  unsigned NumMaskElts = CstSizeInBits / MaskEltSizeInBits;
   UndefElts = SmallBitVector(NumMaskElts, false);
   RawMask.resize(NumMaskElts, 0);
 
@@ -99,7 +100,8 @@ void DecodePSHUFBMask(const Constant *C,
   Type *MaskTy = C->getType();
   unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();
   (void)MaskTySize;
-  assert(MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512);
+  assert((MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512) &&
+         "Unexpected vector size.");
 
   // The shuffle mask requires a byte vector.
   SmallBitVector UndefElts;
@@ -138,8 +140,9 @@ void DecodeVPERMILPMask(const Constant *
   Type *MaskTy = C->getType();
   unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();
   (void)MaskTySize;
-  assert(MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512);
-  assert(ElSize == 32 || ElSize == 64);
+  assert((MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512) &&
+         "Unexpected vector size.");
+  assert((ElSize == 32 || ElSize == 64) && "Unexpected vector element size.");
 
   // The shuffle mask requires elements the same size as the target.
   SmallBitVector UndefElts;
@@ -174,7 +177,7 @@ void DecodeVPERMIL2PMask(const Constant
   Type *MaskTy = C->getType();
   unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();
   (void)MaskTySize;
-  assert(MaskTySize == 128 || MaskTySize == 256);
+  assert((MaskTySize == 128 || MaskTySize == 256) && "Unexpected vector size.");
 
   // The shuffle mask requires elements the same size as the target.
   SmallBitVector UndefElts;
@@ -224,7 +227,8 @@ void DecodeVPERMIL2PMask(const Constant
 }
 
 void DecodeVPPERMMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {
-  assert(C->getType()->getPrimitiveSizeInBits() == 128);
+  assert(C->getType()->getPrimitiveSizeInBits() == 128 &&
+         "Unexpected vector size.");
 
   // The shuffle mask requires a byte vector.
   SmallBitVector UndefElts;




More information about the llvm-commits mailing list