[Mlir-commits] [mlir] efbd64c - [mlir][arith] Delete unnecessary error logs (#94970)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jun 11 04:41:05 PDT 2024
Author: donald chen
Date: 2024-06-11T19:41:01+08:00
New Revision: efbd64cbd90f4cc4eb5b1166eb9840af3ec1bba8
URL: https://github.com/llvm/llvm-project/commit/efbd64cbd90f4cc4eb5b1166eb9840af3ec1bba8
DIFF: https://github.com/llvm/llvm-project/commit/efbd64cbd90f4cc4eb5b1166eb9840af3ec1bba8.diff
LOG: [mlir][arith] Delete unnecessary error logs (#94970)
Function `getNeutralElement` already indicates "cannot find neutral
element" by returning nullptr through the return value, and no
additional error log needs to be output.
Added:
Modified:
mlir/lib/Dialect/Arith/IR/ArithOps.cpp
mlir/test/Dialect/Linalg/transform-tile-reduction.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index 5797c5681a5fd..2f6647a2a27b1 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -2544,7 +2544,6 @@ std::optional<TypedAttr> mlir::arith::getNeutralElement(Operation *op) {
.Case([](arith::MulIOp op) { return AtomicRMWKind::muli; })
.Default([](Operation *op) { return std::nullopt; });
if (!maybeKind) {
- op->emitError() << "Unknown neutral element for: " << *op;
return std::nullopt;
}
diff --git a/mlir/test/Dialect/Linalg/transform-tile-reduction.mlir b/mlir/test/Dialect/Linalg/transform-tile-reduction.mlir
index f3cf7c4dffa05..8feb3c2a2c306 100644
--- a/mlir/test/Dialect/Linalg/transform-tile-reduction.mlir
+++ b/mlir/test/Dialect/Linalg/transform-tile-reduction.mlir
@@ -355,7 +355,6 @@ module {
%0 = linalg.generic {indexing_maps = [#map, #map1], iterator_types = ["parallel", "reduction"]} ins(%arg0 : tensor<?x?xf32>) outs(%arg1 : tensor<?xf32>) {
^bb0(%in: f32, %out: f32):
%1 = llvm.fmul %in, %in : f32
- // expected-error @below {{Unknown neutral element for:}}
%2 = llvm.fadd %1, %out : f32
linalg.yield %2 : f32
} -> tensor<?xf32>
More information about the Mlir-commits
mailing list