aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Gysi <gysit@google.com>2021-06-23 09:06:04 +0000
committerTobias Gysi <gysit@google.com>2021-06-23 09:37:14 +0000
commitf1844f15c1ad54b78f2d84087df4b51fe5f703f6 (patch)
tree4ec5abfebd97fcda71efef1461aa377a377a021b
parentaa58fdb3960bf1ea25c2c088fba96700cb7e7071 (diff)
downloadllvm-f1844f15c1ad54b78f2d84087df4b51fe5f703f6.zip
llvm-f1844f15c1ad54b78f2d84087df4b51fe5f703f6.tar.gz
llvm-f1844f15c1ad54b78f2d84087df4b51fe5f703f6.tar.bz2
[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
-rw-r--r--mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h6
-rw-r--r--mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp14
2 files changed, 4 insertions, 16 deletions
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
index 5ec7405..87c279a 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 67a935d..6f422e5 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.