[llvm] r282732 - [X86] Avoid "unused" warnings if no asserts

Douglas Katzman via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 10:26:12 PDT 2016


Author: dougk
Date: Thu Sep 29 12:26:12 2016
New Revision: 282732

URL: http://llvm.org/viewvc/llvm-project?rev=282732&view=rev
Log:
[X86] Avoid "unused" warnings if no asserts

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=282732&r1=282731&r2=282732&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp Thu Sep 29 12:26:12 2016
@@ -98,6 +98,7 @@ static bool extractConstantMask(const Co
 void DecodePSHUFBMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {
   Type *MaskTy = C->getType();
   unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();
+  (void)MaskTySize;
   assert(MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512);
 
   // The shuffle mask requires a byte vector.
@@ -136,6 +137,7 @@ void DecodeVPERMILPMask(const Constant *
                         SmallVectorImpl<int> &ShuffleMask) {
   Type *MaskTy = C->getType();
   unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();
+  (void)MaskTySize;
   assert(MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512);
   assert(ElSize == 32 || ElSize == 64);
 
@@ -171,6 +173,7 @@ void DecodeVPERMIL2PMask(const Constant
                          SmallVectorImpl<int> &ShuffleMask) {
   Type *MaskTy = C->getType();
   unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();
+  (void)MaskTySize;
   assert(MaskTySize == 128 || MaskTySize == 256);
 
   // The shuffle mask requires elements the same size as the target.
@@ -221,8 +224,7 @@ void DecodeVPERMIL2PMask(const Constant
 }
 
 void DecodeVPPERMMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {
-  Type *MaskTy = C->getType();
-  assert(MaskTy->getPrimitiveSizeInBits() == 128);
+  assert(C->getType()->getPrimitiveSizeInBits() == 128);
 
   // The shuffle mask requires a byte vector.
   SmallBitVector UndefElts;




More information about the llvm-commits mailing list