[Mlir-commits] [mlir] a942f7c - [mlir][sparse] move variable into assert to avoid 'unused' error (#68604)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 9 09:11:30 PDT 2023


Author: Aart Bik
Date: 2023-10-09T09:11:26-07:00
New Revision: a942f7c86ee7f3c0a054cfdf85d3a32244550acd

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

LOG: [mlir][sparse] move variable into assert to avoid 'unused' error (#68604)

Added: 
    

Modified: 
    mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
index bb92029ff1e924d..e44d8565fc867de 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
@@ -200,8 +200,7 @@ class NewCallParams final {
   /// MLIR buffers as needed, and returning `this` for method chaining.
   NewCallParams &genBuffers(SparseTensorType stt,
                             ArrayRef<Value> dimSizesValues) {
-    const Dimension dimRank = stt.getDimRank();
-    assert(dimSizesValues.size() == static_cast<size_t>(dimRank));
+    assert(dimSizesValues.size() == static_cast<size_t>(stt.getDimRank()));
     // Sparsity annotations.
     params[kParamLvlTypes] = genLvlTypesBuffer(builder, loc, stt);
     // Construct dimSizes, lvlSizes, dim2lvl, and lvl2dim buffers.


        


More information about the Mlir-commits mailing list