[mlir] Fix a warning
authorKazu Hirata <kazu@google.com>
Tue, 17 Jan 2023 21:01:22 +0000 (13:01 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 17 Jan 2023 21:01:22 +0000 (13:01 -0800)
This patch fixes:

  mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp:820:13:
  error: unused function 'hasAtMostOneResultFunctionOfDim'
  [-Werror,-Wunused-function]

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

index 3a33e04..c2eafcf 100644 (file)
@@ -816,6 +816,7 @@ SmallVector<OpFoldResult> transform::PackOp::getMixedPackedSizes() {
   return getMixedValues(getStaticPackedSizes(), getPackedSizes(), b);
 }
 
+#ifndef NDEBUG
 /// Return true if `map` has 0 or 1 result function of AffineDimExpr(dim).
 static bool hasAtMostOneResultFunctionOfDim(AffineMap map, int64_t dim) {
   bool found = false;
@@ -828,6 +829,7 @@ static bool hasAtMostOneResultFunctionOfDim(AffineMap map, int64_t dim) {
   }
   return true;
 }
+#endif // NDEBUG
 
 /// Return the index of the first result of `map` that is a function of
 /// AffineDimExpr(dim), std::nullopt otherwise.