[Mlir-commits] [mlir] [MLIR][Linalg] Remove linalg.exp op (PR #215822)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Aug 12 08:15:48 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-scf
Author: Renato Golin (rengolin)
<details>
<summary>Changes</summary>
Remove op, change tests to abs/log to continue working as is. Will eventually need to check support for elementwise on linalg fusion and other transforms (assumed working for now).
This is another example of what the removal of a more widely used op will look like. Basically, it's used in tests because it's easy to construct textual representations of `linalg.exp` in tests than `linalg.generic` or `linalg.elementwise`, but otherwise should not affect the validity of the tests themselves.
The question raised here is: do we keep the named op variants as aliases to `linalg.elementwise<kind>` for ease of use, or is it not worth it?
Ref:
https://discourse.llvm.org/t/rfc-update-semantics-of-linalg-named-operations-unary-binary-ternary/91531 https://github.com/llvm/llvm-project/pull/215608
---
Patch is 88.34 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/215822.diff
25 Files Affected:
- (modified) mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h (+2-2)
- (modified) mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml (-35)
- (modified) mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp (+2-4)
- (modified) mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp (+1-3)
- (modified) mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp (+2-4)
- (modified) mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py (-12)
- (modified) mlir/test/Dialect/Linalg/elementwise/named-to-elementwise.mlir (-13)
- (modified) mlir/test/Dialect/Linalg/generalize-named-ops.mlir (-21)
- (modified) mlir/test/Dialect/Linalg/linalg-morph-category-ops.mlir (+4-4)
- (modified) mlir/test/Dialect/Linalg/linalg-morph-elementwise-to-named.mlir (+5-11)
- (modified) mlir/test/Dialect/Linalg/linalg-morph-multi-step.mlir (+2-5)
- (modified) mlir/test/Dialect/Linalg/match-ops-interpreter.mlir (+2-2)
- (modified) mlir/test/Dialect/Linalg/named-ops-fail.mlir (-16)
- (modified) mlir/test/Dialect/Linalg/named-ops.mlir (-31)
- (modified) mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-category-ops.mlir (-6)
- (modified) mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-named-ops.mlir (-4)
- (modified) mlir/test/Dialect/Linalg/scalable-unpack-producer-fusion.mlir (+15-15)
- (modified) mlir/test/Dialect/Linalg/specialize-generic-ops.mlir (+6-22)
- (modified) mlir/test/Dialect/Linalg/transform-op-fuse-into-containing.mlir (+18-18)
- (modified) mlir/test/Dialect/Linalg/transform-op-fuse.mlir (+59-59)
- (modified) mlir/test/Dialect/Linalg/transform-op-generalize.mlir (+2-2)
- (modified) mlir/test/Dialect/Linalg/transform-op-specialize-elemwise-unary.mlir (+4-12)
- (modified) mlir/test/Dialect/SCF/canonicalize.mlir (+4-4)
- (modified) mlir/test/Interfaces/TilingInterface/tile-and-fuse-consumer-using-slices.mlir (+10-10)
- (modified) mlir/test/Interfaces/TilingInterface/tile-and-fuse-consumer.mlir (+11-11)
``````````diff
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
index 9ff32216ce042..c0194662e9b1b 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h
@@ -147,8 +147,8 @@ std::optional<SmallVector<int64_t>>
isaTransposeOpInterface(GenericOp genericOp);
/// Checks whether a given `genericOp` is semantically equivalent to a single
-/// linalg elementwise unary op, e.g. `linalg.exp` or
-/// `linalg.elementwise kind=#linalg.elementwise_kind<exp>`.
+/// linalg elementwise unary op, e.g. `linalg.abs` or
+/// `linalg.elementwise kind=#linalg.elementwise_kind<abs>`.
/// If `allowNonIdentityMaps` is true, operations with custom indexing maps are
/// included in the check. Note that these operations can only be represented by
/// the category op.
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml b/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
index 521afc991063f..e613f5407a309 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
@@ -44,41 +44,6 @@ structured_op: !LinalgStructuredOpConfig
- !ScalarExpression
scalar_arg: I
--- !LinalgOpConfig
-metadata: !LinalgOpMetadata
- name: exp
- cpp_class_name: ExpOp
- doc: |-
- Applies exp(x) elementwise.
-
- No numeric casting is performed on the input operand.
-structured_op: !LinalgStructuredOpConfig
- args:
- - !LinalgOperandDefConfig
- name: I
- kind: input_tensor
- type_var: T1
- shape_map: affine_map<() -> ()>
- - !LinalgOperandDefConfig
- name: O
- kind: output_tensor
- type_var: T1
- shape_map: affine_map<() -> ()>
- indexing_maps: !LinalgIndexingMapsConfig
- static_indexing_maps:
- - affine_map<() -> ()>
- - affine_map<() -> ()>
- iterator_types: []
- assignments:
- - !ScalarAssign
- arg: O
- value: !ScalarExpression
- scalar_fn:
- kind: unary
- fn_name: exp
- operands:
- - !ScalarExpression
- scalar_arg: I
---- !LinalgOpConfig
metadata: !LinalgOpMetadata
name: log
cpp_class_name: LogOp
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp b/mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp
index 6d1f61100dbf5..1b01dbb1207e1 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/CategoryToNamedOp.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
//
// This file implements rewriting of linalg category ops (e.g.
-// `linalg.elementwise`) to their equivalent named ops (e.g. `linalg.add`,
-// `linalg.exp`). This is the reverse of NamedToElementwise.cpp.
+// `linalg.elementwise`) to their equivalent named ops (e.g. `linalg.add`).
+// This is the reverse of NamedToElementwise.cpp.
//
//===----------------------------------------------------------------------===//
@@ -46,8 +46,6 @@ struct ElementwiseToNamedPattern : public OpRewritePattern<ElementwiseOp> {
};
switch (op.getKind()) {
- case ElementwiseKind::exp:
- return replaceWith(ExpOp{});
case ElementwiseKind::log:
return replaceWith(LogOp{});
case ElementwiseKind::abs:
diff --git a/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp b/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
index c9045566473cb..f6fd0cf4ee072 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
//
// This file implements rewriting those linalg named ops that are essentially
-// elementwise e.g. `linalg.exp`, to `linalg.elementwise`. This allows further
+// elementwise e.g. `linalg.abs`, to `linalg.elementwise`. This allows further
// optimization on `linalg.elementwise` such as folding transpose, broadcast.
//
//===----------------------------------------------------------------------===//
@@ -35,7 +35,6 @@ ElementwiseKind getKind(Operation *op) {
.Case([](DivOp) { return ElementwiseKind::div; })
.Case([](DivUnsignedOp) { return ElementwiseKind::div_unsigned; })
.Case([](PowFOp) { return ElementwiseKind::powf; })
- .Case([](ExpOp) { return ElementwiseKind::exp; })
.Case([](LogOp) { return ElementwiseKind::log; })
.Case([](AbsOp) { return ElementwiseKind::abs; })
.Case([](CeilOp) { return ElementwiseKind::ceil; })
@@ -79,7 +78,6 @@ void mlir::linalg::populateLinalgNamedToElementwisePatterns(
patterns.add<NamedToElementwisePattern<DivOp>>(patterns.getContext());
patterns.add<NamedToElementwisePattern<DivUnsignedOp>>(patterns.getContext());
patterns.add<NamedToElementwisePattern<PowFOp>>(patterns.getContext());
- patterns.add<NamedToElementwisePattern<ExpOp>>(patterns.getContext());
patterns.add<NamedToElementwisePattern<LogOp>>(patterns.getContext());
patterns.add<NamedToElementwisePattern<AbsOp>>(patterns.getContext());
patterns.add<NamedToElementwisePattern<CeilOp>>(patterns.getContext());
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
index 1bdcd0be31329..fba3ee6f599da 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
@@ -105,9 +105,9 @@ static bool findIndexOfScalarOperand(GenericOp genericOp, int &index) {
// } -> tensor<?x?xf32>
//
// is specialized to either
-// linalg.exp ins(...) outs(...) -> ...
+// linalg.abs ins(...) outs(...) -> ...
// or
-// linalg.elementwise kind=#linalg.elementwise_kind<exp> ...
+// linalg.elementwise kind=#linalg.elementwise_kind<abs> ...
//
// Only the category op can carry non-identity indexing maps; these are
// transferred verbatim from the `genericOp`.
@@ -191,8 +191,6 @@ static FailureOr<LinalgOp> specializeLinalgElementwise(RewriterBase &rewriter,
};
if (isUnary) {
- if (isa<math::ExpOp>(op))
- return replaceOp(ExpOp{}, ElementwiseKind::exp);
if (isa<math::LogOp>(op))
return replaceOp(LogOp{}, ElementwiseKind::log);
if (isa<math::AbsFOp>(op))
diff --git a/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py b/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
index 9c24f94fcf612..7ea50e42f8d0d 100644
--- a/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
+++ b/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
@@ -21,18 +21,6 @@ def copy(
O[None] = cast(U, I[None])
- at linalg_structured_op
-def exp(
- I=TensorDef(T1),
- O=TensorDef(T1, output=True),
-):
- """Applies exp(x) elementwise.
-
- No numeric casting is performed on the input operand.
- """
- O[None] = UnaryFn.exp(I[None])
-
-
@linalg_structured_op
def log(
I=TensorDef(T1),
diff --git a/mlir/test/Dialect/Linalg/elementwise/named-to-elementwise.mlir b/mlir/test/Dialect/Linalg/elementwise/named-to-elementwise.mlir
index 2332b287ace8d..17276d30efcc8 100644
--- a/mlir/test/Dialect/Linalg/elementwise/named-to-elementwise.mlir
+++ b/mlir/test/Dialect/Linalg/elementwise/named-to-elementwise.mlir
@@ -1,18 +1,5 @@
// RUN: mlir-opt %s -linalg-morph-ops=named-to-category -split-input-file | FileCheck %s
-// CHECK: @exp(%[[A:.+]]: tensor<16x8xf32>, %[[B:.+]]: tensor<16x8xf32>) -> tensor<16x8xf32> {
-// CHECK: {{.*}} = linalg.elementwise
-// CHECK-SAME: kind=#linalg.elementwise_kind<exp>
-// CHECK-SAME: ins(%[[A]] : tensor<16x8xf32>)
-// CHECK-SAME: outs(%[[B]] : tensor<16x8xf32>) -> tensor<16x8xf32>
-//
-func.func @exp(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16x8xf32> {
- %exp = linalg.exp ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
- return %exp : tensor<16x8xf32>
-}
-
-// ----
-
// CHECK: @add(%[[A:.+]]: tensor<16x8xf32>, %[[B:.+]]: tensor<16x8xf32>, %[[C:.+]]: tensor<16x8xf32>) -> tensor<16x8xf32> {
// CHECK: {{.*}} = linalg.elementwise
// CHECK-SAME: kind=#linalg.elementwise_kind<add>
diff --git a/mlir/test/Dialect/Linalg/generalize-named-ops.mlir b/mlir/test/Dialect/Linalg/generalize-named-ops.mlir
index e346bee901f1d..d77b3222e27ed 100644
--- a/mlir/test/Dialect/Linalg/generalize-named-ops.mlir
+++ b/mlir/test/Dialect/Linalg/generalize-named-ops.mlir
@@ -531,27 +531,6 @@ func.func @generalize_divu(%lhs: memref<7x14x21xi32>, %rhs: memref<7x14x21xi32>,
// -----
-func.func @generalize_exp(%arg: memref<7x14x21xf32>, %out: memref<7x14x21xf32>) {
- linalg.exp ins(%arg : memref<7x14x21xf32>) outs(%out : memref<7x14x21xf32>)
- return
-}
-
-// CHECK: #[[MAP:.+]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)>
-
-// CHECK: func @generalize_exp
-// CHECK-SAME: (%[[ARG:.+]]: memref<7x14x21xf32>, %[[OUT:.+]]: memref<7x14x21xf32>)
-
-// CHECK: linalg.generic
-// CHECK-SAME: indexing_maps = [#[[MAP]], #[[MAP]]]
-// CHECK-SAME: iterator_types = ["parallel", "parallel", "parallel"]}
-// CHECK-SAME: ins(%[[LHS]] : memref<7x14x21xf32>) outs(%[[OUT]] : memref<7x14x21xf32>)
-
-// CHECK: ^{{.+}}(%[[BBARG0:.+]]: f32, %[[BBARG1:.+]]: f32)
-// CHECK-NEXT: %[[EXP:.+]] = math.exp %[[BBARG0]] : f32
-// CHECK-NEXT: linalg.yield %[[EXP]] : f32
-
-// -----
-
func.func @generalize_log(%arg: memref<7x14x21xf32>, %out: memref<7x14x21xf32>) {
linalg.log ins(%arg : memref<7x14x21xf32>) outs(%out : memref<7x14x21xf32>)
return
diff --git a/mlir/test/Dialect/Linalg/linalg-morph-category-ops.mlir b/mlir/test/Dialect/Linalg/linalg-morph-category-ops.mlir
index 246902389bb9e..67ef2ea27b342 100644
--- a/mlir/test/Dialect/Linalg/linalg-morph-category-ops.mlir
+++ b/mlir/test/Dialect/Linalg/linalg-morph-category-ops.mlir
@@ -4,12 +4,12 @@
// RUN: mlir-opt %s -linalg-morph-ops=named-to-category | \
// RUN: mlir-opt -linalg-morph-ops=category-to-generic | FileCheck %s --check-prefix=CATEGORY_TO_GENERIC
-func.func @exp(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16x8xf32> {
- %exp = linalg.exp ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
- return %exp : tensor<16x8xf32>
+func.func @abs(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16x8xf32> {
+ %abs = linalg.abs ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
+ return %abs : tensor<16x8xf32>
}
// NAMED_TO_CATEGORY: linalg.elementwise
-// NAMED_TO_CATEGORY-NOT: linalg.exp
+// NAMED_TO_CATEGORY-NOT: linalg.abs
// CATEGORY_TO_GENERIC: linalg.generic
// CATEGORY_TO_GENERIC-NOT: linalg.elementwise
diff --git a/mlir/test/Dialect/Linalg/linalg-morph-elementwise-to-named.mlir b/mlir/test/Dialect/Linalg/linalg-morph-elementwise-to-named.mlir
index 82365f5de8f92..43d15a203015f 100644
--- a/mlir/test/Dialect/Linalg/linalg-morph-elementwise-to-named.mlir
+++ b/mlir/test/Dialect/Linalg/linalg-morph-elementwise-to-named.mlir
@@ -7,10 +7,8 @@
// RUN: FileCheck %s
func.func @unary_ops(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16x8xf32> {
- %exp = linalg.elementwise kind=#linalg.elementwise_kind<exp>
- ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
%log = linalg.elementwise kind=#linalg.elementwise_kind<log>
- ins(%exp : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
+ ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
%abs = linalg.elementwise kind=#linalg.elementwise_kind<abs>
ins(%log : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
%ceil = linalg.elementwise kind=#linalg.elementwise_kind<ceil>
@@ -38,12 +36,8 @@ func.func @unary_ops(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16x
// CHECK-LABEL: unary_ops
// CHECK-SAME: %[[A:.+]]: tensor<16x8xf32>, %[[B:.+]]: tensor<16x8xf32>)
-// CHECK-NOT: linalg.elementwise
-// CHECK: %[[EXP:.+]] = linalg.exp
-// CHECK-SAME: ins(%[[A]] : tensor<16x8xf32>)
-// CHECK-SAME: outs(%[[B]] : tensor<16x8xf32>) -> tensor<16x8xf32>
// CHECK: %[[LOG:.+]] = linalg.log
-// CHECK-SAME: ins(%[[EXP]] : tensor<16x8xf32>)
+// CHECK-SAME: ins(%[[A]] : tensor<16x8xf32>)
// CHECK-SAME: outs(%[[B]] : tensor<16x8xf32>) -> tensor<16x8xf32>
// CHECK: %[[ABS:.+]] = linalg.abs
// CHECK-SAME: ins(%[[LOG]] : tensor<16x8xf32>)
@@ -210,7 +204,7 @@ func.func @ternary_select(%A: tensor<?x?xi1>, %B: tensor<?x?xf32>,
// Non-identity indexing maps: should NOT be converted to named op.
func.func @non_identity_maps(%A: tensor<?xf32>, %Out: tensor<?x?xf32>) -> tensor<?x?xf32> {
%0 = linalg.elementwise
- kind=#linalg.elementwise_kind<exp>
+ kind=#linalg.elementwise_kind<abs>
indexing_maps = [affine_map<(d0, d1) -> (d1)>, affine_map<(d0, d1) -> (d0, d1)>]
ins(%A : tensor<?xf32>) outs(%Out : tensor<?x?xf32>) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
@@ -218,10 +212,10 @@ func.func @non_identity_maps(%A: tensor<?xf32>, %Out: tensor<?x?xf32>) -> tensor
// CHECK-LABEL: non_identity_maps
// CHECK-SAME: %[[A:.+]]: tensor<?xf32>, %[[OUT:.+]]: tensor<?x?xf32>)
-// CHECK: linalg.elementwise kind=#linalg.elementwise_kind<exp>
+// CHECK: linalg.elementwise kind=#linalg.elementwise_kind<abs>
// CHECK-SAME: ins(%[[A]] : tensor<?xf32>)
// CHECK-SAME: outs(%[[OUT]] : tensor<?x?xf32>) -> tensor<?x?xf32>
-// CHECK-NOT: linalg.exp
+// CHECK-NOT: linalg.abs
// -----
diff --git a/mlir/test/Dialect/Linalg/linalg-morph-multi-step.mlir b/mlir/test/Dialect/Linalg/linalg-morph-multi-step.mlir
index 0a0ddbcd85a0a..a49156213a297 100644
--- a/mlir/test/Dialect/Linalg/linalg-morph-multi-step.mlir
+++ b/mlir/test/Dialect/Linalg/linalg-morph-multi-step.mlir
@@ -5,8 +5,7 @@
// RUN: FileCheck %s --check-prefix=ALL,ROUND_TRIP
func.func @unary_ops(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16x8xf32> {
- %exp = linalg.exp ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
- %log = linalg.log ins(%exp : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
+ %log = linalg.log ins(%A : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
%abs = linalg.abs ins(%log : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
%ceil = linalg.ceil ins(%abs : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
%floor = linalg.floor ins(%ceil : tensor<16x8xf32>) outs(%B : tensor<16x8xf32>) -> tensor<16x8xf32>
@@ -23,8 +22,7 @@ func.func @unary_ops(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16
// ALL-LABEL: unary_ops
-// NAMED_TO_GENERIC-COUNT-13: linalg.generic
-// NAMED_TO_GENERIC-NOT: linalg.exp
+// NAMED_TO_GENERIC-COUNT-12: linalg.generic
// NAMED_TO_GENERIC-NOT: linalg.log
// NAMED_TO_GENERIC-NOT: linalg.abs
// NAMED_TO_GENERIC-NOT: linalg.ceil
@@ -38,7 +36,6 @@ func.func @unary_ops(%A : tensor<16x8xf32>, %B : tensor<16x8xf32>) -> tensor<16
// NAMED_TO_GENERIC-NOT: linalg.tanh
// NAMED_TO_GENERIC-NOT: linalg.erf
-// ROUND_TRIP: linalg.exp
// ROUND_TRIP: linalg.log
// ROUND_TRIP: linalg.abs
// ROUND_TRIP: linalg.ceil
diff --git a/mlir/test/Dialect/Linalg/match-ops-interpreter.mlir b/mlir/test/Dialect/Linalg/match-ops-interpreter.mlir
index 66cae5cfd923d..ec2229af54b6f 100644
--- a/mlir/test/Dialect/Linalg/match-ops-interpreter.mlir
+++ b/mlir/test/Dialect/Linalg/match-ops-interpreter.mlir
@@ -846,11 +846,11 @@ module attributes { transform.with_named_sequence } {
// expected-remark @below {{matched result value}}
// expected-remark @below {{op result}}
// expected-note @below {{value handle points to an op result #0}}
- linalg.exp ins(%3 : tensor<42x42xf32>) outs(%0 : tensor<42x42xf32>) -> tensor<42x42xf32>
+ linalg.abs ins(%3 : tensor<42x42xf32>) outs(%0 : tensor<42x42xf32>) -> tensor<42x42xf32>
// expected-remark @below {{matched result value}}
// expected-remark @below {{op result}}
// expected-note @below {{value handle points to an op result #0}}
- linalg.exp ins(%3 : tensor<42x42xf32>) outs(%0 : tensor<42x42xf32>) -> tensor<42x42xf32>
+ linalg.abs ins(%3 : tensor<42x42xf32>) outs(%0 : tensor<42x42xf32>) -> tensor<42x42xf32>
return
}
}
diff --git a/mlir/test/Dialect/Linalg/named-ops-fail.mlir b/mlir/test/Dialect/Linalg/named-ops-fail.mlir
index bf9c1b705f157..83055899d6884 100644
--- a/mlir/test/Dialect/Linalg/named-ops-fail.mlir
+++ b/mlir/test/Dialect/Linalg/named-ops-fail.mlir
@@ -80,22 +80,6 @@ func.func @divu_broadcast(%arg0: memref<8x16xi32>, %arg1: memref<4x8x16xi32>, %a
// -----
-func.func @exp_type_cast(%arg: memref<4x8x16xf16>, %out: memref<4x8x16xf32>) {
- // CHECK: operand 1 ('f16') doesn't match the element type of the enclosing linalg.generic op ('f32')
- linalg.exp ins(%arg : memref<4x8x16xf16>) outs(%out: memref<4x8x16xf32>)
- return
-}
-
-// -----
-
-func.func @exp_broadcast(%arg: memref<8x16xf32>, %out: memref<4x8x16xf32>) {
- // CHECK: op expected operand #0 rank (2) to match the result rank of indexing_map (3)
- linalg.exp ins(%arg : memref<8x16xf32>) outs(%out: memref<4x8x16xf32>)
- return
-}
-
-// -----
-
func.func @log_type_cast(%arg: memref<4x8x16xf16>, %out: memref<4x8x16xf32>) {
// CHECK: operand 1 ('f16') doesn't match the element type of the enclosing linalg.generic op ('f32')
linalg.log ins(%arg : memref<4x8x16xf16>) outs(%out: memref<4x8x16xf32>)
diff --git a/mlir/test/Dialect/Linalg/named-ops.mlir b/mlir/test/Dialect/Linalg/named-ops.mlir
index 8068c23a4a0fd..0faca91e52569 100644
--- a/mlir/test/Dialect/Linalg/named-ops.mlir
+++ b/mlir/test/Dialect/Linalg/named-ops.mlir
@@ -2170,37 +2170,6 @@ func.func @div_unsigned_tensor(%arg0: tensor<4x8x16xi32>, %arg1: tensor<4x8x16xi
// -----
-// CHECK-LABEL: func @exp_dynamic
-func.func @exp_dynamic(%arg0: memref<?x?x?xf32>, %arg1: memref<?x?x?xf32>) {
- // CHECK: linalg.exp
- // CHECK-SAME: ins(%{{.+}} : memref<?x?x?xf32>) outs(%{{.+}} : memref<?x?x?xf32>)
- linalg.exp ins(%arg0 : memref<?x?x?xf32>) outs(%arg1: memref<?x?x?xf32>)
- return
-}
-
-// -----
-
-// CHECK-LABEL: func @exp_static
-func.func @exp_static(%arg0: memref<4x8x16xf32>, %arg1: memref<4x8x16xf32>) {
- // CHECK: linalg.exp
- // CHECK-SAME: ins(%{{.+}} : memref<4x8x16xf32>) outs(%{{.+}} : memref<4x8x16xf32>)
- linalg.exp ins(%arg0 : memref<4x8x16xf32>) outs(%arg1: memref<4x8x16xf32>)
- return
-}
-
-// -----
-
-// CHECK-LABEL: func @exp_tensor
-func.func @exp_tensor(%arg0: tensor<4x8x16xf32>) -> tensor<4x8x16xf32> {
- %0 = tensor.empty() : tensor<4x8x16xf32>
- // CHECK: linalg.exp
- // CHECK-SAME: ins(%{{.+}} : tensor<4x8x16xf32>) outs(%{{.+}} : tensor<4x8x16xf32>)
- %1 = linalg.exp ins(%arg0 : tensor<4x8x16xf32>) outs(%0: tensor<4x8x16xf32>) -> tensor<4x8x16xf32>
- return %1 : tensor<4x8x16xf32>
-}
-
-// -----
-
// CHECK-LABEL: func @log_dynamic
func.func @log_dynamic(%arg0: memref<?x?x?xf32>, %arg1: memref<?x?x?xf32>) {
// CHECK: linalg.log
diff --git a/mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-category-ops.mlir b/mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-category-ops.mlir
index b9d7db6227816..fb234825d187c 100644
--- a/mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-category-ops.mlir
+++ b/mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-category-ops.mlir
@@ -6,8 +6,6 @@
// RUN: | FileCheck %s
func.func @unary_ops(%A: memref<7x14x21xf32>, %Out: memref<7x14x21xf32>) {
- linalg.elementwise kind=#linalg.elementwise_kind<exp>
- ins(%A : memref<7x14x21xf32>) outs(%Out : memref<7x14x21xf32>)
linalg.elementwise kind=#linalg.elementwise_kind<log>
ins(%A : memref<7x14x21xf32>) outs(%Out : memref<7x14x21xf32>)
linalg.elementwise kind=#linalg.elementwise_kind<abs>
@@ -61,10 +59,6 @@ func.func @unary_ops(%A: memref<7x14x21xf32>, %Out: memref<7x14x21xf32>) {
// CHECK-LABEL: unary_ops
// CHECK-SAME: %[[A:.+]]: memref<7x14x21xf32>, %[[OUT:.+]]: memref<7x14x21xf32>)
-// CHECK-NOT: linalg.generic
-// CHECK: linalg.elementwise kind=#linalg.elementwise_kind<exp>
-// CHECK-SAME: ins(%[[A]] : memref<7x14x21xf32>)
-// CHECK-SAME: outs(%[[OUT]] : memref<7x14x21xf32>)
// CHECK: linalg.elementwise kind=#linalg.elementwise_kind<log>
// CHECK-SAME: ins(%[[A]] : memref<7x14x21xf32>)
// CHECK-SAME: outs(%[[OUT]] : memref<7x14x21xf32>)
diff --git a/mlir/test/Dialect/Linalg/roundtrip-morphism-linalg-nam...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/215822
More information about the Mlir-commits
mailing list