[mlir] Fix mlir build break due to warning when NDEBUG is not set
authorThomas Raoux <thomasraoux@google.com>
Mon, 10 Aug 2020 22:33:40 +0000 (15:33 -0700)
committerThomas Raoux <thomasraoux@google.com>
Mon, 10 Aug 2020 22:35:02 +0000 (15:35 -0700)
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp

index 522a459..a68f28f 100644 (file)
@@ -1153,6 +1153,7 @@ public:
       if (memrefVectorElementType.getElementType() !=
           xferOp.getVectorType().getElementType())
         return failure();
+#ifndef NDEBUG
       // Check that memref vector type is a suffix of 'vectorType.
       unsigned memrefVecEltRank = memrefVectorElementType.getRank();
       unsigned resultVecRank = xferOp.getVectorType().getRank();
@@ -1165,6 +1166,7 @@ public:
         assert(memrefVecEltShape[i] != resultVecShape[rankOffset + i] &&
                "memref vector element shape should match suffix of vector "
                "result shape.");
+#endif // ifndef NDEBUG
     }
 
     // 1. Get the source/dst address as an LLVM vector pointer.