From 2d40980ee0eb7d83d51e5a24f7b390c12df02a66 Mon Sep 17 00:00:00 2001 From: hanhanW Date: Thu, 24 Apr 2025 14:31:55 -0700 Subject: [PATCH] [mlir][NFC] Use Builder for getReassociationIndicesAttribute method. The method does not need to create any operation, so we can use Builder. It can be reused by any attribute getter implementation, so it does not need to declare OpBuilder in the implementation. Signed-off-by: hanhanW --- mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h | 2 +- mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h b/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h index 3af89a6ab3799..af575e10acc8e 100644 --- a/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h +++ b/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h @@ -57,7 +57,7 @@ getSymbolLessAffineMaps(ArrayRef reassociation); /// Wraps a list of reassociations in an ArrayAttr. ArrayAttr -getReassociationIndicesAttribute(OpBuilder &b, +getReassociationIndicesAttribute(Builder &b, ArrayRef reassociation); /// Convert Array> to Array>. diff --git a/mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp b/mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp index 0336423c57b1d..ed40a080441bc 100644 --- a/mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp +++ b/mlir/lib/Dialect/Utils/ReshapeOpsUtils.cpp @@ -158,7 +158,7 @@ unsigned getMaxPosOfType(ArrayRef exprArrays) { } ArrayAttr mlir::getReassociationIndicesAttribute( - OpBuilder &b, ArrayRef reassociation) { + Builder &b, ArrayRef reassociation) { SmallVector reassociationAttr = llvm::to_vector<4>(llvm::map_range( reassociation, [&](const ReassociationIndices &indices) -> Attribute {