[mlir][sparse] Canonicalizing arguments to genReshapeDstShape and foreachInSparseConstant

These functions don't need a`PatternRewriter`, they only need an `OpBuilder`.  And, the builder should be the first argument, before the `Location`, to match the style used everywhere else in MLIR.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D148059
This commit is contained in:
wren romano
2023-04-11 15:16:47 -07:00
parent cae2a36d48
commit 9d4df97ff0
4 changed files with 18 additions and 18 deletions

View File

@@ -158,7 +158,7 @@ static LogicalResult genForeachOnSparseConstant(ForeachOp op,
// Foreach on constant.
foreachInSparseConstant(
loc, rewriter, attr, op.getOrder().value_or(AffineMap()),
rewriter, loc, attr, op.getOrder().value_or(AffineMap()),
[&reduc, &rewriter, op](ArrayRef<Value> cvs, Value v) mutable {
SmallVector<Value> args;
args.append(cvs.begin(), cvs.end());
@@ -372,7 +372,7 @@ public:
dstSizes.push_back(constantIndex(rewriter, loc, d));
} else {
ArrayRef<DynSize> dstShape = dstTp.getDimShape();
genReshapeDstShape(loc, rewriter, dstSizes, srcSizes, dstShape,
genReshapeDstShape(rewriter, loc, dstSizes, srcSizes, dstShape,
op.getReassociationIndices());
for (auto [idx, shape] : llvm::enumerate(dstShape)) {
if (shape == ShapedType::kDynamic)