Skip to content

Conversation

cxy-1993
Copy link
Contributor

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

@llvmbot
Copy link
Member

llvmbot commented Jun 10, 2024

@llvm/pr-subscribers-mlir-linalg
@llvm/pr-subscribers-mlir-arith

@llvm/pr-subscribers-mlir

Author: donald chen (cxy-1993)

Changes

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

Function `getNeutralElement` already indicates "cannot find neutral element"
by returning nullptr through the return value, and no additional error log needs
to be output.
@cxy-1993 cxy-1993 merged commit efbd64c into llvm:main Jun 11, 2024
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Jun 12, 2024
Function `getNeutralElement` already indicates "cannot find neutral
element" by returning nullptr through the return value, and no
additional error log needs to be output.
@HerrCai0907 HerrCai0907 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants