Apply clang-tidy fixes for performance-unnecessary-value-param in SparseTensorCodegen...
authorMehdi Amini <joker.eph@gmail.com>
Thu, 5 Jan 2023 19:28:48 +0000 (19:28 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 6 Jan 2023 10:38:54 +0000 (10:38 +0000)
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp

index 0ffcfd8..a680ddf 100644 (file)
@@ -103,10 +103,9 @@ static scf::ForOp createFor(OpBuilder &builder, Location loc, Value upper,
 /// Gets the dimension size for the given sparse tensor at the given
 /// original dimension 'dim'. Returns std::nullopt if no sparse encoding is
 /// attached to the given tensor type.
-static std::optional<Value> sizeFromTensorAtDim(OpBuilder &builder,
-                                                Location loc,
-                                                SparseTensorDescriptor desc,
-                                                unsigned dim) {
+static std::optional<Value>
+sizeFromTensorAtDim(OpBuilder &builder, Location loc,
+                    const SparseTensorDescriptor &desc, unsigned dim) {
   RankedTensorType rtp = desc.getTensorType();
   // Access into static dimension can query original type directly.
   // Note that this is typically already done by DimOp's folding.