[mlir][sparse] fix compiler warning when using release build.
authorPeiming Liu <peiming@google.com>
Wed, 23 Nov 2022 00:43:10 +0000 (00:43 +0000)
committerPeiming Liu <peiming@google.com>
Wed, 23 Nov 2022 00:53:50 +0000 (00:53 +0000)
Differential Revision: https://reviews.llvm.org/D138533

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

index 1367baa..94ac0cc 100644 (file)
@@ -181,8 +181,7 @@ static bool isInvariantAffine(const CodeGen &codegen, AffineExpr a,
 /// that adheres to the given topological sort.
 static AffineMap permute(const Merger &merger, MLIRContext *context,
                          AffineMap m, ArrayRef<unsigned> topSort) {
-  unsigned sz = topSort.size();
-  assert(m.getNumDims() + merger.getNumFilterLoops() == sz &&
+  assert(m.getNumDims() + merger.getNumFilterLoops() == topSort.size() &&
          "TopoSort/AffineMap size mismatch");
   // Construct the inverse of `m`; to avoid the asymptotic complexity
   // of calling `m.getPermutedPosition` repeatedly.