[Mlir-commits] [mlir] 39f75ab - Fix unused-variable warnings after d0ee094d6acf72608e927bf2e9ba69c57da59a96.

James Y Knight llvmlistbot at llvm.org
Mon Jan 10 08:29:29 PST 2022


Author: James Y Knight
Date: 2022-01-10T16:28:54Z
New Revision: 39f75ab6a7e3aa04cf80c218f4bb2ef331ce3d48

URL: https://github.com/llvm/llvm-project/commit/39f75ab6a7e3aa04cf80c218f4bb2ef331ce3d48
DIFF: https://github.com/llvm/llvm-project/commit/39f75ab6a7e3aa04cf80c218f4bb2ef331ce3d48.diff

LOG: Fix unused-variable warnings after d0ee094d6acf72608e927bf2e9ba69c57da59a96.

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
    mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
index 2d4f4b2a6500..216790841431 100644
--- a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
+++ b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
@@ -349,10 +349,12 @@ mlir::linalg::comprehensive_bufferize::BufferizationState::BufferizationState(
 
 // bufferization.to_memref is not allowed to change the rank.
 static void ensureToMemrefOpIsValid(Value tensor, Type memrefType) {
+#ifndef NDEBUG
   auto rankedTensorType = tensor.getType().dyn_cast<RankedTensorType>();
   assert((!rankedTensorType || memrefType.cast<MemRefType>().getRank() ==
                                    rankedTensorType.getRank()) &&
          "to_memref would be invalid: mismatching ranks");
+#endif
 }
 
 static Value lookupBuffer(RewriterBase &rewriter, Value tensor) {

diff  --git a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp
index 2eaed56669d7..be55eca51986 100644
--- a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp
@@ -21,10 +21,12 @@ namespace scf_ext {
 
 // bufferization.to_memref is not allowed to change the rank.
 static void ensureToMemrefOpIsValid(Value tensor, Type memrefType) {
+#ifndef NDEBUG
   auto rankedTensorType = tensor.getType().dyn_cast<RankedTensorType>();
   assert((!rankedTensorType || (memrefType.cast<MemRefType>().getRank() ==
                                 rankedTensorType.getRank())) &&
          "to_memref would be invalid: mismatching ranks");
+#endif
 }
 
 /// Bufferization of scf.execute_region. Can be analyzed, but bufferization not


        


More information about the Mlir-commits mailing list