[Mlir-commits] [mlir] f1844f1 - [mlir][linalg] Change the FillOp library call signature.
Tobias Gysi
llvmlistbot at llvm.org
Wed Jun 23 02:37:58 PDT 2021
Author: Tobias Gysi
Date: 2021-06-23T09:37:14Z
New Revision: f1844f15c1ad54b78f2d84087df4b51fe5f703f6
URL: https://github.com/llvm/llvm-project/commit/f1844f15c1ad54b78f2d84087df4b51fe5f703f6
DIFF: https://github.com/llvm/llvm-project/commit/f1844f15c1ad54b78f2d84087df4b51fe5f703f6.diff
LOG: [mlir][linalg] Change the FillOp library call signature.
Adapt the FillOp library call signature to the updated operand order introduced in https://reviews.llvm.org/D10412. The patch reverts the special treatment of FillOp in LinalgToStandard.
Differential Revision: https://reviews.llvm.org/D104360
Added:
Modified:
mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
index 5ec7405da5cef..87c279a85e1be 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
@@ -73,18 +73,18 @@ getReassociationIndicesForReshape(ShapedType sourceType, ShapedType targetType);
/// Examples:
///
/// 1. linalg.fill(%f, %A) : f32, memref<f32>
-/// name mangles into `linalg_fill_viewf32_f32_impl`
+/// name mangles into `linalg_fill_f32_viewf32`
///
/// 2. linalg.dot %A, %B, %C :
/// (memref<?xf32, stride_specification>,
/// memref<?xf32, stride_specification>, memref<f32>)
-/// name mangles into `linalg_dot_viewxf32_viewxf32_viewf32_impl`
+/// name mangles into `linalg_dot_viewxf32_viewxf32_viewf32`
///
/// 3. linalg.matmul(...) :
/// memref<?x?xf32, stride_specification>,
/// memref<?x?xf32, stride_specification>,
/// memref<?x?xf32, stride_specification>
-/// name mangles into `linalg_matmul_viewxxf32_viewxxf32_viewxxf32_impl`
+/// name mangles into `linalg_matmul_viewxxf32_viewxxf32_viewxxf32`
std::string generateLibraryCallName(Operation *op);
/// Returns `num` AffineDimExpr dimensions at positions
diff --git a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
index 67a935d4bf0fe..6f422e5f629fb 100644
--- a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
+++ b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
@@ -100,21 +100,9 @@ LogicalResult mlir::linalg::LinalgOpToLibraryCallRewrite::matchAndRewrite(
if (isa<CopyOp>(op))
return failure();
- // Swap the operand order of the FillOp to maintain the pretty printed
- // signature that takes an output buffer followed by the fill value.
- SmallVector<Value> originalOperandOrder = op->getOperands();
- if (auto fillOp = dyn_cast<FillOp>(op.getOperation())) {
- Value value = fillOp.value();
- Value output = fillOp.output();
- op->setOperands(ValueRange{output, value});
- }
-
auto libraryCallName = getLibraryCallSymbolRef(op, rewriter);
- if (!libraryCallName) {
- // Restore the operand order in case it has been modified.
- op->setOperands(originalOperandOrder);
+ if (!libraryCallName)
return failure();
- }
// TODO: Add support for more complex library call signatures that include
// indices or captured values.
More information about the Mlir-commits
mailing list