[Mlir-commits] [mlir] [mlir][sparse] fix unused variable warning on release build (PR #68822)

Peiming Liu llvmlistbot at llvm.org
Wed Oct 11 10:32:36 PDT 2023


https://github.com/PeimingLiu created https://github.com/llvm/llvm-project/pull/68822

None

>From 219f88e855cd3d02aa48314e7ac4dcdd438d96cf Mon Sep 17 00:00:00 2001
From: Peiming Liu <peiming at google.com>
Date: Wed, 11 Oct 2023 17:30:46 +0000
Subject: [PATCH] [mlir][sparse] fix unused variable warning on release build

---
 .../Dialect/SparseTensor/Transforms/StageSparseOperations.cpp   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/StageSparseOperations.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/StageSparseOperations.cpp
index 60ac71de4dd71ca..4ab4b05a7a420c7 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/StageSparseOperations.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/StageSparseOperations.cpp
@@ -36,6 +36,8 @@ struct StageUnorderedConvert : public OpRewritePattern<ConvertOp> {
     // source -> coo
     // The tmp COO must be unordered, otherwise it is a direct conversion.
     assert(!(srcStt.hasSameDimToLvl(dstStt) && srcStt.isAllOrdered()));
+    (void)srcStt; // to silence warning when assertion is disabled
+
     Type srcCOOTp = getCOOFromTypeWithOrdering(
         dstStt.getRankedTensorType(), dstStt.getDimToLvl(), /*ordered=*/false);
     Value srcCOO = rewriter.create<ConvertOp>(loc, srcCOOTp, op.getSource());



More information about the Mlir-commits mailing list