diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp @@ -268,6 +268,8 @@ } void runOnOperation() override { + if (vectorLength == 0) + return signalPassFailure(); auto *ctx = &getContext(); RewritePatternSet patterns(ctx); populateSparseVectorizationPatterns(