[Mlir-commits] [mlir] 837a26f - [mlir][sparse] fix unused variable warning on release build (#68824)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 11 10:48:03 PDT 2023


Author: Peiming Liu
Date: 2023-10-11T10:47:58-07:00
New Revision: 837a26f237fbd72c1827ca75733315827a9259fb

URL: https://github.com/llvm/llvm-project/commit/837a26f237fbd72c1827ca75733315827a9259fb
DIFF: https://github.com/llvm/llvm-project/commit/837a26f237fbd72c1827ca75733315827a9259fb.diff

LOG: [mlir][sparse] fix unused variable warning on release build (#68824)

Added: 
    

Modified: 
    mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
    mlir/lib/Dialect/SparseTensor/Transforms/StageSparseOperations.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
index fdecfe303d31351..78f5562b392a682 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
@@ -710,6 +710,8 @@ struct SparseSortCOOConverter : public OpConversionPattern<ConvertOp> {
 
     // Otherwise we need another data shuffle and a non-identity map.
     assert(dstStt.hasSameDimToLvl(srcStt));
+    (void)dstStt; // to silence warning when assertion is disabled
+
     auto id = AffineMap::getMultiDimIdentityMap(srcStt.getLvlRank(), ctx);
 
     rewriter.create<SortOp>(loc, nnz, crd, ValueRange{val}, id,

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