[Mlir-commits] [mlir] [mlir][arith] Delete unnecessary error logs (PR #94970)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jun 10 05:26:46 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: donald chen (cxy-1993)

<details>
<summary>Changes</summary>

Function `getNeutralElement` already indicates "cannot find neutral element" by returning nullptr through the return value, and no additional error log needs to be output.

---
Full diff: https://github.com/llvm/llvm-project/pull/94970.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/Arith/IR/ArithOps.cpp (-1) 


``````````diff
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;
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/94970


More information about the Mlir-commits mailing list