Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mlir][arith] Delete unnecessary error logs #94970

Merged
merged 2 commits into from
Jun 11, 2024
Merged

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
Collaborator

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
7 checks passed
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.

None yet

3 participants