Skip to content

Commit 837a26f

Browse files
authored
[mlir][sparse] fix unused variable warning on release build (#68824)
1 parent 28b7e28 commit 837a26f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,8 @@ struct SparseSortCOOConverter : public OpConversionPattern<ConvertOp> {
710710

711711
// Otherwise we need another data shuffle and a non-identity map.
712712
assert(dstStt.hasSameDimToLvl(srcStt));
713+
(void)dstStt; // to silence warning when assertion is disabled
714+
713715
auto id = AffineMap::getMultiDimIdentityMap(srcStt.getLvlRank(), ctx);
714716

715717
rewriter.create<SortOp>(loc, nnz, crd, ValueRange{val}, id,

mlir/lib/Dialect/SparseTensor/Transforms/StageSparseOperations.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ struct StageUnorderedConvert : public OpRewritePattern<ConvertOp> {
3636
// source -> coo
3737
// The tmp COO must be unordered, otherwise it is a direct conversion.
3838
assert(!(srcStt.hasSameDimToLvl(dstStt) && srcStt.isAllOrdered()));
39+
(void)srcStt; // to silence warning when assertion is disabled
40+
3941
Type srcCOOTp = getCOOFromTypeWithOrdering(
4042
dstStt.getRankedTensorType(), dstStt.getDimToLvl(), /*ordered=*/false);
4143
Value srcCOO = rewriter.create<ConvertOp>(loc, srcCOOTp, op.getSource());

0 commit comments

Comments
 (0)