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

donald chen llvmlistbot at llvm.org
Mon Jun 10 05:26:12 PDT 2024


https://github.com/cxy-1993 created https://github.com/llvm/llvm-project/pull/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.

>From 87ad3ce489eb3c758a715b3345ad958528da7aa2 Mon Sep 17 00:00:00 2001
From: cxy <chenxunyu1993 at gmail.com>
Date: Mon, 10 Jun 2024 20:19:20 +0800
Subject: [PATCH] [mlir][arith] Delete unnecessary error logs

Function `getNeutralElement` already indicates "cannot find neutral element"
by returning nullptr through the return value, and no additional error log needs
to be output.
---
 mlir/lib/Dialect/Arith/IR/ArithOps.cpp | 1 -
 1 file changed, 1 deletion(-)

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



More information about the Mlir-commits mailing list